mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-30 14:01:27 +02:00
This patch clarifies the usage of references in PL/Perl :)
David Fetter
This commit is contained in:
parent
a1ce88a59c
commit
bdb8b394c4
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$PostgreSQL: pgsql/doc/src/sgml/plperl.sgml,v 2.28 2004/09/20 22:48:25 tgl Exp $
|
$PostgreSQL: pgsql/doc/src/sgml/plperl.sgml,v 2.29 2004/10/15 16:51:48 momjian Exp $
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<chapter id="plperl">
|
<chapter id="plperl">
|
||||||
@ -260,7 +260,9 @@ composite types.
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Here is an example of a PL/Perl function returning a rowset of a row type:
|
Here is an example of a PL/Perl function returning a rowset of a
|
||||||
|
row type. Note that a composite type is always represented as a
|
||||||
|
hash reference.
|
||||||
<programlisting>
|
<programlisting>
|
||||||
CREATE TABLE test (
|
CREATE TABLE test (
|
||||||
i int,
|
i int,
|
||||||
@ -305,7 +307,10 @@ $$ LANGUAGE plperl;
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Here is an example of a PL/Perl function returning a rowset of a composite type.
|
Here is an example of a PL/Perl function returning a rowset of a
|
||||||
|
composite type. As a rowset is always a reference to an array
|
||||||
|
and a composite type is always a reference to a hash, a rowset of a
|
||||||
|
composite type is a reference to an array of hash references.
|
||||||
<programlisting>
|
<programlisting>
|
||||||
CREATE TYPE testsetperl AS (f1 integer, f2 text, f3 text);
|
CREATE TYPE testsetperl AS (f1 integer, f2 text, f3 text);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user