Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 4b7f50e

Browse files
committed
Some small changes for plperl.sgml:
- wrapped long code-lines, for pdf - typo Erik Rijkers
1 parent 0544c8c commit 4b7f50e

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

doc/src/sgml/plperl.sgml

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/plperl.sgml,v 2.85 2010/06/14 18:47:05 momjian Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/plperl.sgml,v 2.86 2010/07/08 21:35:33 petere Exp $ -->
22

33
<chapter id="plperl">
44
<title>PL/Perl - Perl Procedural Language</title>
@@ -173,7 +173,7 @@ $$ LANGUAGE plperl;
173173
Similarly, values passed back to <productname>PostgreSQL</productname>
174174
must be in the external text representation format. For example, the
175175
<function>encode_bytea</function> function can be used to
176-
to escape binary data for a return value of type <type>bytea</>.
176+
escape binary data for a return value of type <type>bytea</>.
177177
</para>
178178

179179
<para>
@@ -515,7 +515,8 @@ SELECT * from lotsa_md5(500);
515515
<literal>spi_prepare</literal> accepts a query string with numbered argument placeholders ($1, $2, etc)
516516
and a string list of argument types:
517517
<programlisting>
518-
$plan = spi_prepare('SELECT * FROM test WHERE id &gt; $1 AND name = $2', 'INTEGER', 'TEXT');
518+
$plan = spi_prepare('SELECT * FROM test WHERE id &gt; $1 AND name = $2',
519+
'INTEGER', 'TEXT');
519520
</programlisting>
520521
Once a query plan is prepared by a call to <literal>spi_prepare</literal>, the plan can be used instead
521522
of the string query, either in <literal>spi_exec_prepared</literal>, where the result is the same as returned
@@ -534,7 +535,8 @@ $plan = spi_prepare('SELECT * FROM test WHERE id &gt; $1 AND name = $2', 'INTEGE
534535
<para>
535536
<programlisting>
536537
CREATE OR REPLACE FUNCTION init() RETURNS VOID AS $$
537-
$_SHARED{my_plan} = spi_prepare( 'SELECT (now() + $1)::date AS now', 'INTERVAL');
538+
$_SHARED{my_plan} = spi_prepare('SELECT (now() + $1)::date AS now',
539+
'INTERVAL');
538540
$$ LANGUAGE plperl;
539541

540542
CREATE OR REPLACE FUNCTION add_time( INTERVAL ) RETURNS TEXT AS $$
@@ -571,10 +573,12 @@ SELECT done();
571573

572574
<para>
573575
<programlisting>
574-
CREATE TABLE hosts AS SELECT id, ('192.168.1.'||id)::inet AS address FROM generate_series(1,3) AS id;
576+
CREATE TABLE hosts AS SELECT id, ('192.168.1.'||id)::inet AS address
577+
FROM generate_series(1,3) AS id;
575578

576579
CREATE OR REPLACE FUNCTION init_hosts_query() RETURNS VOID AS $$
577-
$_SHARED{plan} = spi_prepare('SELECT * FROM hosts WHERE address &lt;&lt; $1', 'inet');
580+
$_SHARED{plan} = spi_prepare('SELECT * FROM hosts
581+
WHERE address &lt;&lt; $1', 'inet');
578582
$$ LANGUAGE plperl;
579583

580584
CREATE OR REPLACE FUNCTION query_hosts(inet) RETURNS SETOF hosts AS $$

0 commit comments

Comments
 (0)