Forum OpenACS Q&A: Revamped PL/pgSQL Documentation Available

Just a note to everyone wanting to learn how to develop in PL/pgSQL (essential for OpenACS 4 porting and new OpenACS 4 modules).

Yesterday I finished the revamping of the PL/pgSQL documentation. I re-structured the docs, added many more examples, etc. It was committed to the PG CVS and will be released with 7.1. If you want to take a look at it now, head to http://www.brasileiro.net/postgres.

One interesting command that was added (AFAIK) in beta 5 or 6 (at least to the docs) is this one:


1.2.5.4. Obtaining other results status

 GET DIAGNOSTICS variable = item [ , ... ]


This command allows retrieval of system status indicators. Each item
is a keyword identifying a state value to be assigned to
the specified variable (which should be of the right datatype to
receive it). The currently available status items are
ROW_COUNT, the number of rows processed by the last SQL query sent
down to the SQL engine; and RESULT_OID, the Oid
of the last row inserted by the most recent SQL query. Note that
RESULT_OID is only useful after an INSERT query. 

I have beta3 installed (I _really_ should not be running this...) and it doesn't soom to work for me, so I guess it was added after that.

Collapse
Posted by Don Baccus on
I think you're right, it was added later.  For those who think
"DIAGNOSTICS" are a weird place to put things like "ROW_COUNT", you're
right.  However, it is the name of the variable specified by the SQL92
and SQL3 standards, so the PG folk decided to stick with it.