Re: plpython bug

Поиск
Список
Период
Сортировка
От Mage
Тема Re: plpython bug
Дата
Msg-id 427A0331.7070606@mage.hu
обсуждение исходный текст
Ответ на plpython bug  (Mage <mage@mage.hu>)
Список 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



В списке pgsql-general по дате отправления:

Предыдущее
От: "Costin Manda"
Дата:
Сообщение: indexes on functions, then modifying functions
Следующее
От: "Dinesh Pandey"
Дата:
Сообщение: can I send execution log into a file.