summaryrefslogtreecommitdiff
path: root/src/pl/plpython/expected/plpython_trigger.out
Commit message (Collapse)AuthorAgeFilesLines
* Fix plpython's handling of functions used as triggers on multiple tables.Tom Lane2013-01-251-0/+24
| | | | | | | | | | | | plpython tried to use a single cache entry for a trigger function, but it needs a separate cache entry for each table the trigger is applied to, because there is table-dependent data in there. This was done correctly before 9.1, but commit 46211da1b84bc3537e799ee1126098e71c2428e8 broke it by simplifying the lookup key from "function OID and triggered table OID" to "function OID and is-trigger boolean". Go back to using both OIDs as the lookup key. Per bug report from Sandro Santilli. Andres Freund
* Adjust PL/Python regression tests some more for Python 3.3.Tom Lane2012-09-081-2/+2
| | | | | | | | | | | Commit 2cfb1c6f77734db81b6e74bcae630f93b94f69be fixed some issues caused by Python 3.3 choosing to iterate through dict entries in a different order than before. But here's another one: the test cases adjusted here made two bad entries in a dict and expected the one complained of would always be the same. Possibly this should be back-patched further than 9.2, but there seems little point unless the earlier fix is too.
* PL/Python: Adjust the regression tests for Python 3.3Peter Eisentraut2012-05-111-2/+8
| | | | | | | | | The string representation of ImportError changed. Remove printing that; it's not necessary for the test. The order in which members of a dict are printed changed. But this was always implementation-dependent, so we have just been lucky for a long time. Do the printing the hard way to ensure sorted order.
* PL/Python: Accept strings in functions returning composite typesPeter Eisentraut2012-04-261-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before 9.1, PL/Python functions returning composite types could return a string and it would be parsed using record_in. The 9.1 changes made PL/Python only expect dictionaries, tuples, or objects supporting getattr as output of composite functions, resulting in a regression and a confusing error message, as the strings were interpreted as sequences and the code for transforming lists to database tuples was used. Fix this by treating strings separately as before, before checking for the other types. The reason why it's important to support string to database tuple conversion is that trigger functions on tables with composite columns get the composite row passed in as a string (from record_out). Without supporting converting this back using record_in, this makes it impossible to implement pass-through behavior for these columns, as PL/Python no longer accepts strings for composite values. A better solution would be to fix the code that transforms composite inputs into Python objects to produce dictionaries that would then be correctly interpreted by the Python->PostgreSQL counterpart code. But that would be too invasive to backpatch to 9.1, and it is too late in the 9.2 cycle to attempt it. It should be revisited in the future, though. Reported as bug #6559 by Kirill Simonov. Jan Urbański
* Table function support for PL/PythonPeter Eisentraut2011-02-261-0/+18
| | | | | | | This allows functions with multiple OUT parameters returning both one or multiple records (RECORD or SETOF RECORD). Jan Urbański, reviewed by Hitoshi Harada
* Remove useless whitespace at end of linesPeter Eisentraut2010-11-231-1/+1
|
* Fix plpython so that it again honors typmod while assigning to tuple fields.Tom Lane2010-10-111-0/+26
| | | | | This was broken in 9.0 while improving plpython's conversion behavior for bytea and boolean. Per bug report from maizi.
* Support triggers on views.Tom Lane2010-10-101-4/+74
| | | | | | | | | | | | | | | This patch adds the SQL-standard concept of an INSTEAD OF trigger, which is fired instead of performing a physical insert/update/delete. The trigger function is passed the entire old and/or new rows of the view, and must figure out what to do to the underlying tables to implement the update. So this feature can be used to implement updatable views using trigger programming style rather than rule hacking. In passing, this patch corrects the names of some columns in the information_schema.triggers view. It seems the SQL committee renamed them somewhere between SQL:99 and SQL:2003. Dean Rasheed, reviewed by Bernd Helmle; some additional hacking by me.
* Python 3 support in PL/PythonPeter Eisentraut2009-12-151-1/+1
| | | | | | Behaves more or less unchanged compared to Python 2, but the new language variant is called plpython3u. Documentation describing the naming scheme is included.
* Improve PL/Python elog outputPeter Eisentraut2009-11-031-100/+100
| | | | | When the elog functions (plpy.info etc.) get a single argument, just print that argument instead of printing the single-member tuple like ('foo',).
* Add Unicode support in PL/PythonPeter Eisentraut2009-09-121-0/+27
| | | | | | | | | | | | PL/Python now accepts Unicode objects where it previously only accepted string objects (for example, as return value). Unicode objects are converted to the PostgreSQL server encoding as necessary. This change is also necessary for future Python 3 support, which treats all strings as Unicode objects. Since this removes the error conditions that the plpython_unicode test file tested for, the alternative result files are no longer necessary.
* Enhanced error context support in PL/PythonPeter Eisentraut2009-08-251-4/+8
| | | | | | | Extract the "while creating return value" and "while modifying trigger row" parts of some error messages into another layer of error context. This will simplify the upcoming patch to improve data type support, but it can stand on its own.
* Make PL/Python tests more compatible with Python 3Peter Eisentraut2009-08-241-2/+2
| | | | | | This changes a bunch of incidentially used constructs in the PL/Python regression tests to equivalent constructs in cases where Python 3 no longer supports the old syntax. Support for older Python versions is unchanged.
* Augment test coverage in PL/Python, especially for error conditions.Peter Eisentraut2009-08-131-8/+279
|
* Split the plpython regression test into test cases arranged by topic, insteadPeter Eisentraut2009-08-121-0/+153
of the previous monolithic setup-create-run sequence, that was apparently inherited from a previous test infrastructure, but makes working with the tests and adding new ones weird.