From: vodevsh@gmail.com
To: pgsql-docs@postgresql.org
Subject: suggestion to make an example easier reproducible
Date: Thu, 04 May 2017 11:55:33 +0000
Message-ID: <20170504115533.24360.68520@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-docs>
The following documentation comment has been logged on the website:
Page: https://www.postgresql.org/docs/9.6/static/plpgsql-implementation.html
Description:
Documentation is good. But if you change `INSERT INTO logtable VALUES
(logtxt, 'now');` to `RAISE INFO '%','now'::timestamptz;` in example, people
will probably try it out to see how caching works (no need to create table).
Also could explain why RETURNED value is reparsed and recalculated, while
RAISEd - not:
CREATE FUNCTION logfunc1() RETURNS timestamptz AS $$
BEGIN
RAISE INFO '%','now'::timestamptz;
RETURN 'now';
END;
$$ LANGUAGE plpgsql;
CREATE FUNCTION logfunc2() RETURNS timestamptz AS $$
DECLARE
curtime timestamp;
BEGIN
curtime := 'now';
RAISE INFO '%',curtime::timestamptz;
RETURN curtime;
END;
$$ LANGUAGE plpgsql;
t=# select logfunc1(),logfunc2();
INFO: 2017-05-04 11:49:34.828784+00
INFO: 2017-05-04 11:49:34.828784+00
logfunc1 | logfunc2
-------------------------------+-------------------------------
2017-05-04 11:49:34.828784+00 | 2017-05-04 11:49:34.828784+00
(1 row)
t=# select logfunc1(),logfunc2();
INFO: 2017-05-04 11:49:34.828784+00
INFO: 2017-05-04 11:49:39.661306+00
logfunc1 | logfunc2
-------------------------------+-------------------------------
2017-05-04 11:49:39.661306+00 | 2017-05-04 11:49:39.661306+00
(1 row)
Thank you
--
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: vodevsh@gmail.com
Subject: Re: suggestion to make an example easier reproducible
In-Reply-To: <20170504115533.24360.68520@wrigleys.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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