postgresql/src/pl/plpython
Tom Lane 769065c1b2 Prefer pg_any_to_server/pg_server_to_any over pg_do_encoding_conversion.
A large majority of the callers of pg_do_encoding_conversion were
specifying the database encoding as either source or target of the
conversion, meaning that we can use the less general functions
pg_any_to_server/pg_server_to_any instead.

The main advantage of using the latter functions is that they can make use
of a cached conversion-function lookup in the common case that the other
encoding is the current client_encoding.  It's notationally cleaner too in
most cases, not least because of the historical artifact that the latter
functions use "char *" rather than "unsigned char *" in their APIs.

Note that pg_any_to_server will apply an encoding verification step in
some cases where pg_do_encoding_conversion would have just done nothing.
This seems to me to be a good idea at most of these call sites, though
it partially negates the performance benefit.

Per discussion of bug #9210.
2014-02-23 16:59:05 -05:00
..
expected Add a regression test case for plpython function returning setof RECORD. 2013-12-11 17:22:55 -05:00
po Translation updates 2013-12-02 00:17:07 -05:00
sql Add a regression test case for plpython function returning setof RECORD. 2013-12-11 17:22:55 -05:00
.gitignore PL/Python: Improve Python 3 regression test setup 2012-09-16 22:26:33 -04:00
generate-spiexceptions.pl Update copyright for 2014 2014-01-07 16:05:30 -05:00
Makefile Cosmetic improvements in plpython's make rule for libpython import library. 2014-02-14 11:31:35 -05:00
nls.mk Translation updates 2013-09-02 02:43:18 -04:00
plpy_cursorobject.c Prevent leakage of SPI tuple tables during subtransaction abort. 2013-07-25 16:46:14 -04:00
plpy_cursorobject.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_elog.c Use improved vsnprintf calling logic in more places. 2013-10-24 21:43:57 -04:00
plpy_elog.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_exec.c Split tuple struct defs from htup.h to htup_details.h 2012-08-30 16:52:35 -04:00
plpy_exec.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_main.c Prevent privilege escalation in explicit calls to PL validators. 2014-02-17 09:33:31 -05:00
plpy_main.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_planobject.c PL/Python: Add argument names to function declarations 2011-12-29 22:55:49 +02:00
plpy_planobject.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_plpymodule.c Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_plpymodule.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_procedure.c Change the way we mark tuples as frozen. 2013-12-22 15:49:09 -05:00
plpy_procedure.h Fix plpython's handling of functions used as triggers on multiple tables. 2013-01-25 16:59:36 -05:00
plpy_resultobject.c PL/Python: Add result object str handler 2013-02-03 00:31:01 -05:00
plpy_resultobject.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_spi.c Prevent leakage of SPI tuple tables during subtransaction abort. 2013-07-25 16:46:14 -04:00
plpy_spi.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_subxactobject.c Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_subxactobject.h add #includes to plpy_subxactobject.h to make it compile standalone 2012-08-28 16:13:41 -04:00
plpy_typeio.c Change the way we mark tuples as frozen. 2013-12-22 15:49:09 -05:00
plpy_typeio.h Split tuple struct defs from htup.h to htup_details.h 2012-08-30 16:52:35 -04:00
plpy_util.c Prefer pg_any_to_server/pg_server_to_any over pg_do_encoding_conversion. 2014-02-23 16:59:05 -05:00
plpy_util.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpython.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
plpython2u--1.0.sql Put comments on the installable procedural languages. 2011-07-03 19:03:51 -04:00
plpython2u--unpackaged--1.0.sql Create extension infrastructure for the core procedural languages. 2011-03-04 21:51:14 -05:00
plpython2u.control Create extension infrastructure for the core procedural languages. 2011-03-04 21:51:14 -05:00
plpython3u--1.0.sql Put comments on the installable procedural languages. 2011-07-03 19:03:51 -04:00
plpython3u--unpackaged--1.0.sql Create extension infrastructure for the core procedural languages. 2011-03-04 21:51:14 -05:00
plpython3u.control Create extension infrastructure for the core procedural languages. 2011-03-04 21:51:14 -05:00
plpythonu--1.0.sql Put comments on the installable procedural languages. 2011-07-03 19:03:51 -04:00
plpythonu--unpackaged--1.0.sql Create extension infrastructure for the core procedural languages. 2011-03-04 21:51:14 -05:00
plpythonu.control Create extension infrastructure for the core procedural languages. 2011-03-04 21:51:14 -05:00