pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feedplperl.sgml touches
2+ messages / 2 participants
[nested] [flat]
* plperl.sgml touches
@ 2010-07-08 18:49 Erik Rijkers <er@xs4all.nl>
0 siblings, 1 reply; 2+ messages in thread
From: Erik Rijkers @ 2010-07-08 18:49 UTC (permalink / raw)
To: pgsql-docs
Some small changes for plperl.sgml:
- wrapped long code-lines, for pdf
- typo
Thanks
Erik Rijkers
Attachments:
plperl.sgml.diff (application/octet-stream, 2.2K) download
--- doc/src/sgml/plperl.sgml.orig 2010-07-08 20:06:56.000000000 +0200
+++ doc/src/sgml/plperl.sgml 2010-07-08 20:37:06.000000000 +0200
@@ -173,7 +173,7 @@
Similarly, values passed back to <productname>PostgreSQL</productname>
must be in the external text representation format. For example, the
<function>encode_bytea</function> function can be used to
- to escape binary data for a return value of type <type>bytea</>.
+ escape binary data for a return value of type <type>bytea</>.
</para>
<para>
@@ -515,7 +515,8 @@
<literal>spi_prepare</literal> accepts a query string with numbered argument placeholders ($1, $2, etc)
and a string list of argument types:
<programlisting>
-$plan = spi_prepare('SELECT * FROM test WHERE id > $1 AND name = $2', 'INTEGER', 'TEXT');
+$plan = spi_prepare('SELECT * FROM test WHERE id > $1 AND name = $2',
+ 'INTEGER', 'TEXT');
</programlisting>
Once a query plan is prepared by a call to <literal>spi_prepare</literal>, the plan can be used instead
of the string query, either in <literal>spi_exec_prepared</literal>, where the result is the same as returned
@@ -534,7 +535,8 @@
<para>
<programlisting>
CREATE OR REPLACE FUNCTION init() RETURNS VOID AS $$
- $_SHARED{my_plan} = spi_prepare( 'SELECT (now() + $1)::date AS now', 'INTERVAL');
+ $_SHARED{my_plan} = spi_prepare( 'SELECT (now() + $1)::date AS now',
+ 'INTERVAL');
$$ LANGUAGE plperl;
CREATE OR REPLACE FUNCTION add_time( INTERVAL ) RETURNS TEXT AS $$
@@ -571,10 +573,12 @@
<para>
<programlisting>
-CREATE TABLE hosts AS SELECT id, ('192.168.1.'||id)::inet AS address FROM generate_series(1,3) AS id;
+CREATE TABLE hosts AS SELECT id, ('192.168.1.'||id)::inet AS address
+ FROM generate_series(1,3) AS id;
CREATE OR REPLACE FUNCTION init_hosts_query() RETURNS VOID AS $$
- $_SHARED{plan} = spi_prepare('SELECT * FROM hosts WHERE address << $1', 'inet');
+ $_SHARED{plan} = spi_prepare('SELECT * FROM hosts
+ WHERE address << $1', 'inet');
$$ LANGUAGE plperl;
CREATE OR REPLACE FUNCTION query_hosts(inet) RETURNS SETOF hosts AS $$
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: plperl.sgml touches
@ 2010-07-08 21:35 Peter Eisentraut <peter_e@gmx.net>
parent: Erik Rijkers <er@xs4all.nl>
0 siblings, 0 replies; 2+ messages in thread
From: Peter Eisentraut @ 2010-07-08 21:35 UTC (permalink / raw)
To: Erik Rijkers <er@xs4all.nl>; +Cc: pgsql-docs
On tor, 2010-07-08 at 20:49 +0200, Erik Rijkers wrote:
> Some small changes for plperl.sgml:
> - wrapped long code-lines, for pdf
> - typo
committed
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2010-07-08 21:35 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-07-08 18:49 plperl.sgml touches Erik Rijkers <er@xs4all.nl>
2010-07-08 21:35 ` Peter Eisentraut <peter_e@gmx.net>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox