postgresql/src
Bruce Momjian b135508c98 Following up a previous thought I had, yesterday I realised how to
return arays nicely without having to make the plperl programmer aware
of anything. The attached patch allows plperl to return an arrayref
where the function returns an array type. It silently calls a perl
function to stringify the array before passing it to the pg array
parser. Non-array returns are handled as before (i.e. passed through
this process) so it is backwards compatible. I will presently submit
regression tests and docs.

example:

andrew=# create or replace function blah() returns text[][] language
plperl as $$ return [['a"b','c,d'],['e\\f','g']]; $$;
CREATE FUNCTION
andrew=# select blah();
            blah
-----------------------------
 {{"a\"b","c,d"},{"e\\f",g}}


This would complete half of the TODO item:

  . Pass arrays natively instead of as text between plperl and postgres

(The other half is translating pg array arguments to perl arrays - that
will have to wait for 8.1).

Some of this patch is adapted from a previously submitted patch from
Sergej Sergeev. Both he and Abhijit Menon-Sen have looked it over
briefly and tentatively said it looks ok.

Andrew Dunstan
2005-07-10 15:32:47 +00:00
..
backend I made the patch that implements regexp_replace again. 2005-07-10 04:54:33 +00:00
bin Add --encoding to pg_dump. 2005-07-10 15:08:52 +00:00
include I made the patch that implements regexp_replace again. 2005-07-10 04:54:33 +00:00
interfaces Make libpq_gettext save and restore errno in a Windows-compatible way. 2005-07-08 15:24:41 +00:00
makefiles Add a --dbname option to the pg_regress script, and use pl_regression 2005-05-17 18:26:23 +00:00
pl Following up a previous thought I had, yesterday I realised how to 2005-07-10 15:32:47 +00:00
port Add parentheses to macros when args are used in computations. Without 2005-05-25 21:40:43 +00:00
template Support Sun's compiler on SunOS4 (a/k/a Solaris 9). Per ayan@ayan.net 2004-12-29 23:47:40 +00:00
test I made the patch that implements regexp_replace again. 2005-07-10 04:54:33 +00:00
timezone Complete zic patch backout by removing NO_PGPORT workaround. 2005-07-06 21:40:09 +00:00
tools testing activitymail 2005-07-08 15:13:09 +00:00
tutorial Adjust src/tutorial Makefile so that it can use pgxs. This allows the 2005-01-13 18:23:22 +00:00
utils PostgreSQL extension makefile framework ("pgxs"), by Fabien Coelho, with 2004-07-30 12:26:40 +00:00
bcc32.mak Add -N make flag to bcc builds from /src dir. 2005-05-13 18:12:35 +00:00
DEVELOPERS just testing a script... 1999-07-30 03:45:57 +00:00
Makefile Adjust src/tutorial Makefile so that it can use pgxs. This allows the 2005-01-13 18:23:22 +00:00
Makefile.global.in Reverse out because the lack of using pgport in timezone/ is causing 2005-07-06 21:04:14 +00:00
Makefile.shlib Reverse this patch: 2005-07-04 04:17:00 +00:00
nls-global.mk More locale fixes for pg_ctl. 2004-06-01 03:32:42 +00:00
win32.mak Attached is a makefile I hacked up to build pg_config under MSVC - the 2005-06-14 17:50:38 +00:00