Lists: | pgsql-docspgsql-patches |
---|
From: | David Fetter <david(at)fetter(dot)org> |
---|---|
To: | PostgreSQL Docs <pgsql-docs(at)postgresql(dot)org>, PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org> |
Subject: | Doc patch: New PL/Perl Features |
Date: | 2005-07-12 19:21:29 |
Message-ID: | 20050712192129.GG12104@fetter.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-docs pgsql-patches |
Folks,
Please find enclosed document patches for PL/Perl features recently
introduced in CVS TIP. These include:
return_next
returning PostgreSQL arrays
spi_query/spi_fetchrow
use strict
Cheers,
D
--
David Fetter david(at)fetter(dot)org http://fetter.org/
phone: +1 510 893 6100 mobile: +1 415 235 3778
Remember to vote!
Attachment | Content-Type | Size |
---|---|---|
plperl_new_features.diff | text/plain | 7.3 KB |
From: | David Fetter <david(at)fetter(dot)org> |
---|---|
To: | PostgreSQL Docs <pgsql-docs(at)postgresql(dot)org>, PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org> |
Subject: | Re: [PATCHES] Doc patch: New PL/Perl Features |
Date: | 2005-07-12 20:01:56 |
Message-ID: | 20050712200156.GH12104@fetter.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-docs pgsql-patches |
On Tue, Jul 12, 2005 at 12:21:29PM -0700, David Fetter wrote:
> Folks,
>
> Please find enclosed document patches for PL/Perl features recently
> introduced in CVS TIP. These include:
>
> return_next
> returning PostgreSQL arrays
> spi_query/spi_fetchrow
> use strict
>
> Cheers,
> D
Oops. Persuant to corrections and clarifications by Andrew Dunstan,
please find enclosed a better patch.
Cheers,
D
--
David Fetter david(at)fetter(dot)org http://fetter.org/
phone: +1 510 893 6100 mobile: +1 415 235 3778
Remember to vote!
Attachment | Content-Type | Size |
---|---|---|
plperl_new_features.diff | text/plain | 7.5 KB |
From: | Neil Conway <neilc(at)samurai(dot)com> |
---|---|
To: | David Fetter <david(at)fetter(dot)org> |
Cc: | PostgreSQL Docs <pgsql-docs(at)postgresql(dot)org>, PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org> |
Subject: | Re: [PATCHES] Doc patch: New PL/Perl Features |
Date: | 2005-07-13 02:17:05 |
Message-ID: | 42D479A1.9020701@samurai.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-docs pgsql-patches |
David Fetter wrote:
> On Tue, Jul 12, 2005 at 12:21:29PM -0700, David Fetter wrote:
>
>>Folks,
>>
>>Please find enclosed document patches for PL/Perl features recently
>>introduced in CVS TIP. These include:
>>
>>return_next
>>returning PostgreSQL arrays
>>spi_query/spi_fetchrow
>>use strict
>>
>>Cheers,
>>D
>
>
> Oops. Persuant to corrections and clarifications by Andrew Dunstan,
> please find enclosed a better patch.
Applied with editorialization; see comments below. Thanks for the patch.
> + <itemizedlist>
> + <listitem>
> + <para>
> + Globally, by turning on plperl (one of the <xref
> + linkend="guc-custom-variable-classes"
> + endterm="custom_variable_classes"> you can use) and setting
> + plperl.use_strict to true in your postgresql.conf, or
> + </para>
Needs a <filename/> and a <literal/>. Also the <xref/> doesn't compile
using openjade 1.3.1
> <para>
> + Perl can return PostgreSQL arrays as references to Perl arrays.
> + Here is an example:
Needs <productname/> around "PostgreSQL" for consistency with the rest
of the SGML docs.
> + <programlisting>
> + CREATE OR REPLACE function returns_array()
> + RETURNS text[][]
> + LANGUAGE plperl
> + AS $$
> + return [['a"b','c,d'],['e\\f','g']];
> + $$;
> +
> + select returns_array();
CREATE FUNCTION ... AS $$ ... $$ LANGUAGE plperl; would be more
consistent with the other PL/Perl examples.
> ! CREATE OR REPLACE FUNCTION perl_set()
> ! RETURNS SETOF testrowperl
> ! LANGUAGE plperl AS $$
> ! return_next({f1 => 1, f2 => 'Hello', f3 => 'World' });
> ! return_next({ f1 => 2, f2 => 'Hello', f3 => 'PostgreSQL' });
> ! return_next({ f1 => 3, f2 => 'Hello', f3 => 'PL/Perl' });
> ! return undef;
> ! $$;
> ! </programlisting>
Should probably use ">" not ">".
> <term><literal><function>spi_exec_query</>(<replaceable>query</replaceable> [, <replaceable>max-rows</replaceable>])</literal></term>
> <term><literal><function>spi_exec_query</>(<replaceable>command</replaceable>)</literal></term>
> + <term><literal><function>spi_query</>(<replaceable>query</replaceable>)</literal></term>
> + <term><literal><function>spi_fetchrow</>(<replaceable>result of spi_query</replaceable>)</literal></term>
> + <term><literal>
> + </literal></term>
> <listitem>
> <para>
> Executes an SQL command. Here is an example of a query
This needs more work -- the difference in behavior between spi_query()
and spi_exec_query() is not described, so I didn't apply this hunk.
> *** 4103,4111 ****
> when using custom variables:
>
> <programlisting>
> ! custom_variable_classes = 'plr,pljava'
> plr.path = '/usr/lib/R'
> pljava.foo = 1
> plruby.bar = true # generates error, unknown class name
> </programlisting>
> </para>
> --- 4103,4112 ----
> when using custom variables:
>
> <programlisting>
> ! custom_variable_classes = 'plperl,plr,pljava'
> plr.path = '/usr/lib/R'
> pljava.foo = 1
> + plperl.use_strict = true # now without having to use pl/perlU! :)
> plruby.bar = true # generates error, unknown class name
> </programlisting>
> </para>
I didn't see why this was relevant, so I didn't apply it.
-Neil
From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | David Fetter <david(at)fetter(dot)org> |
Cc: | PostgreSQL Docs <pgsql-docs(at)postgresql(dot)org>, PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org> |
Subject: | Re: Doc patch: New PL/Perl Features |
Date: | 2005-07-13 04:22:42 |
Message-ID: | 200507130422.j6D4MhM14975@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-docs pgsql-patches |
Your patch has been added to the PostgreSQL unapplied patches list at:
http://momjian.postgresql.org/cgi-bin/pgpatches
It will be applied as soon as one of the PostgreSQL committers reviews
and approves it.
---------------------------------------------------------------------------
David Fetter wrote:
> Folks,
>
> Please find enclosed document patches for PL/Perl features recently
> introduced in CVS TIP. These include:
>
> return_next
> returning PostgreSQL arrays
> spi_query/spi_fetchrow
> use strict
>
> Cheers,
> D
> --
> David Fetter david(at)fetter(dot)org http://fetter.org/
> phone: +1 510 893 6100 mobile: +1 415 235 3778
>
> Remember to vote!
[ Attachment, skipping... ]
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | David Fetter <david(at)fetter(dot)org> |
Cc: | PostgreSQL Docs <pgsql-docs(at)postgresql(dot)org>, PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org> |
Subject: | Re: Doc patch: New PL/Perl Features |
Date: | 2005-07-13 04:23:27 |
Message-ID: | 200507130423.j6D4NRv15103@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-docs pgsql-patches |
Oops, already applied. (Seems my threading email is busted.)
---------------------------------------------------------------------------
David Fetter wrote:
> Folks,
>
> Please find enclosed document patches for PL/Perl features recently
> introduced in CVS TIP. These include:
>
> return_next
> returning PostgreSQL arrays
> spi_query/spi_fetchrow
> use strict
>
> Cheers,
> D
> --
> David Fetter david(at)fetter(dot)org http://fetter.org/
> phone: +1 510 893 6100 mobile: +1 415 235 3778
>
> Remember to vote!
[ Attachment, skipping... ]
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073