Hi all

I've recently noticed two oversights in the docs that I'd like to fix.

First, in sql-fetch, there's no hint that the cursor name can be the quoted value of a refcursor, eg:

    FETCH ALL FROM "<unnamed portal 1>";

This *is* shown in an example in plpgsql-cursors, but only in some sample code. If you set out with the question "how do I fetch the contents of a refcursor returned from a function" it's a lot harder to find the results than it could be.

I'd like to add a short discussion of refcursors and an example to sql-fetch, and refer to that from plpgsql-cursors to make it clearer how you work with plpgsql cursors from SQL.

Second, in functions-datetime, I wasn't able to find any mention of the behaviour of CASTing a DATE to a TIMESTAMP or to a TIMESTAMPTZ. I'd like to explicitly state that casting date to timestamp or timestamptz produces a date in local time, and show that if you want to cast a date to another time zone you can use:

    thedate::timestamp AT TIME ZONE 'UTC'

to produce a timestamptz containing that date at midnight UTC.


Criaig Ringer

Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:

Reply via email to