Summary of DDL/DML statement return/output values?

From: Steve Estes <denzera(at)gmail(dot)com>
To: pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Summary of DDL/DML statement return/output values?
Date: 2020-06-22 16:48:55
Message-ID: CAJjrZPBH8h2nx41zfdm2_BP_f=8G==OR6or=Jgo9+FAAtjc6gw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

Hi docs gang,

First time poster here, big fan of all the work you do.

When interacting with the server through all the various types of DML and
DDL statements, the return message that the server sends back to the client
varies in content and format. For example, a response to a CREATE TABLE is
just "CREATE TABLE" (so, no change in tense e.g. 'CREATED', or a table name
acknowledgement or something), whereas a COPY command yields "COPY
<rowcount>", and the output from an INSERT is "INSERT <oids> <rowcount>".
CREATE TABLE AS SELECT (...) yields a reply of "SELECT <rowcount>", very
different from other variations of the CREATE TABLE statement. The
variation in format is of course necessary, since the various SQL
statements do very different things.

However, for some statements PG's output format is documented (e.g. INSERT
<https://www.postgresql.org/docs/12/sql-insert.html>, EXPLAIN
<https://www.postgresql.org/docs/12/sql-explain.html>), and in others it is
not (e.g. SET <https://www.postgresql.org/docs/12/sql-set.html>, CREATE
TABLE <https://www.postgresql.org/docs/12/sql-createtable.html>, ALTER TABLE
<https://www.postgresql.org/docs/12/sql-altertable.html>, etc). The
output-control RETURNING clause gets its own page
<https://www.postgresql.org/docs/12/dml-returning.html>, but I'm unaware of
any other meta-summary of output values.

*Is there a summary of what PG returns in response to each of the various
statements that it supports? If not, should there be?*

I'm asking because I'm considering proposing a feature request to the
hackers list that would alter response output under certain circumstances,
and was looking to educate myself about the full scope of current server
outputs. So I was a little surprised when I couldn't readily find that
information, given the thoroughness of documentation in every other respect.

Thanks for your help,
Steve Estes

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Jeff Davis 2020-06-22 17:30:43 Re: Default setting for enable_hashagg_disk
Previous Message Robert Haas 2020-06-22 15:17:22 Re: Default setting for enable_hashagg_disk