Re: plpython bug

From: Mage <mage(at)mage(dot)hu>
To: Pgsql-General <pgsql-general(at)postgresql(dot)org>
Subject: Re: plpython bug
Date: 2005-05-05 11:27:45
Message-ID: 427A0331.7070606@mage.hu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Update:

it might be not plpython, but similar to the plperl bug I found last time.

The script which can produce the bug:

--------

create table test (id int, date timestamp);

create or replace function trigger_test() returns trigger as $$
plpy.info(TD['new'])
return 'MODIFY'
$$ language plpythonu;

create trigger test_update before update on test for each row execute
procedure trigger_test();

insert into test values (1, now());
insert into test values (2, now());

update test set id = 3;

create or replace function test_perl() returns boolean as $$
use locale;
use POSIX qw(locale_h);
setlocale(LC_COLLATE,'hu_HU');
setlocale(LC_CTYPE,'hu_HU');
setlocale(LC_NUMERIC,'hu_HU');
return True
$$ language plperlu;

create or replace function trigger_test() returns trigger as $$
plpy.info(TD['new'])
plpy.execute('select * from test_perl()')
return 'MODIFY'
$$ language plpythonu;

update test set id = 4;

---------

CREATE TABLE
CREATE FUNCTION
CREATE TRIGGER
INSERT 9138862 1
INSERT 9138863 1
INFO: ({'date': '2005-05-05 13:20:43.793551', 'id': 3},)
INFO: ({'date': '2005-05-05 13:20:43.794401', 'id': 3},)
UPDATE 2
CREATE FUNCTION
CREATE FUNCTION
INFO: ({'date': '2005-05-05 13:20:43.793551', 'id': 4},)
ERROR: invalid input syntax for type timestamp: "2005-05-05
13:20:43.793551"

-------

I don't think that plperl or plperlu with locales should be used in
production environment.

Mage

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dinesh Pandey 2005-05-05 11:39:26 can I send execution log into a file.
Previous Message Costin Manda 2005-05-05 11:04:30 indexes on functions, then modifying functions