postgresql/src/backend/utils
Peter Eisentraut 3ab8b7fa6f Fix/improve bytea and boolean support in PL/Python
Before, PL/Python converted data between SQL and Python by going
through a C string representation.  This broke for bytea in two ways:

- On input (function parameters), you would get a Python string that
  contains bytea's particular external representation with backslashes
  etc., instead of a sequence of bytes, which is what you would expect
  in a Python environment.  This problem is exacerbated by the new
  bytea output format.

- On output (function return value), null bytes in the Python string
  would cause truncation before the data gets stored into a bytea
  datum.

This is now fixed by converting directly between the PostgreSQL datum
and the Python representation.

The required generalized infrastructure also allows for other
improvements in passing:

- When returning a boolean value, the SQL datum is now true if and
  only if Python considers the value that was passed out of the
  PL/Python function to be true.  Previously, this determination was
  left to the boolean data type input function.  So, now returning
  'foo' results in true, because Python considers it true, rather than
  false because PostgreSQL considers it false.

- On input, we can convert the integer and float types directly to
  their Python equivalents without having to go through an
  intermediate string representation.

original patch by Caleb Welton, with updates by myself
2009-09-09 19:00:09 +00:00
..
adt Fix/improve bytea and boolean support in PL/Python 2009-09-09 19:00:09 +00:00
cache Remove some useless assignments of the result of fread(). Quiets warnings 2009-08-30 17:18:52 +00:00
error Add log_line_prefix placeholder %e to contain the current SQL state 2009-07-03 19:14:25 +00:00
fmgr Make LOAD of an already-loaded library into a no-op, instead of attempting 2009-09-03 22:11:07 +00:00
hash Update copyright for 2009. 2009-01-01 17:24:05 +00:00
init Remove flatfiles.c, which is now obsolete. 2009-09-01 02:54:52 +00:00
mb Update of install-sh, mkinstalldirs, and associated configury 2009-08-26 22:24:44 +00:00
misc Add a boolean GUC parameter "bonjour" to control whether a Bonjour-enabled 2009-09-08 17:08:36 +00:00
mmgr Speed up AllocSetFreeIndex, which is a significant cost in palloc and pfree, 2009-07-21 19:53:12 +00:00
resowner 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
sort Extend EXPLAIN to support output in XML or JSON format. 2009-08-10 05:46:50 +00:00
time 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
.cvsignore Cleanup to ensure good state of derived files in tarballs. 2000-06-09 02:38:36 +00:00
Gen_dummy_probes.sed Update copyright for 2009. 2009-01-01 17:24:05 +00:00
Gen_fmgrtab.pl Update copyright for 2009. 2009-01-01 17:24:05 +00:00
Gen_fmgrtab.sh Update copyright for 2009. 2009-01-01 17:24:05 +00:00
Makefile Add a few more DTrace probes to the backend. 2008-08-01 13:16:09 +00:00
probes.d Revert DTrace patch from Robert Lor 2009-04-02 20:59:10 +00:00