diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2010-10-11 22:16:46 -0400 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2010-10-11 22:16:46 -0400 |
| commit | 67120d35e28b85bbb4d10f4568f6e3b85c8e0460 (patch) | |
| tree | c3885cc25dff02d03ea7d7b02d7d767d63c38284 /src/pl/plpython/expected/plpython_trigger.out | |
| parent | 3b6eb752d99360e4e21ddff2c3edf750ab9b026a (diff) | |
Fix plpython so that it again honors typmod while assigning to tuple fields.
This was broken in 9.0 while improving plpython's conversion behavior for
bytea and boolean. Per bug report from maizi.
Diffstat (limited to 'src/pl/plpython/expected/plpython_trigger.out')
| -rw-r--r-- | src/pl/plpython/expected/plpython_trigger.out | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/pl/plpython/expected/plpython_trigger.out b/src/pl/plpython/expected/plpython_trigger.out index 3192ff1d48e..bdcf3e8eb4e 100644 --- a/src/pl/plpython/expected/plpython_trigger.out +++ b/src/pl/plpython/expected/plpython_trigger.out @@ -453,3 +453,29 @@ SELECT * FROM trigger_test; 0 | (1 row) +-- +-- Test that triggers honor typmod when assigning to tuple fields, +-- as per an early 9.0 bug report +-- +SET DateStyle = 'ISO'; +CREATE FUNCTION set_modif_time() RETURNS trigger AS $$ + TD['new']['modif_time'] = '2010-10-13 21:57:28.930486' + return 'MODIFY' +$$ LANGUAGE plpythonu; +CREATE TABLE pb (a TEXT, modif_time TIMESTAMP(0) WITHOUT TIME ZONE); +CREATE TRIGGER set_modif_time BEFORE UPDATE ON pb + FOR EACH ROW EXECUTE PROCEDURE set_modif_time(); +INSERT INTO pb VALUES ('a', '2010-10-09 21:57:33.930486'); +SELECT * FROM pb; + a | modif_time +---+--------------------- + a | 2010-10-09 21:57:34 +(1 row) + +UPDATE pb SET a = 'b'; +SELECT * FROM pb; + a | modif_time +---+--------------------- + b | 2010-10-13 21:57:29 +(1 row) + |
