Re: Documentation for CommandComplete is incorrect for CREATE TABLE with server version 10.2

2018-04-28 Thread Alexander Kjäll
Thanks for the clarification.

Maybe CREATE TABLE should be added as it's own line, since it's a distinct
case from the others in that table?

best regards
Alexander Kjäll
Den lör 28 apr. 2018 kl 23:01 skrev Tom Lane :

> =?utf-8?q?PG_Doc_comments_form?=  writes:
> > The documentation says:
> > For a SELECT or CREATE TABLE AS command, the tag is SELECT rows where
rows
> > is the number of rows retrieved.

> Yeah ...

> > But what I get back from the server is this packet:
> >    43 00 00 00 11 43 52 45 41 54 45 20 54 41 42 4c  CCREATE TABL
> > 0010   45 00E.
> > The query I sent to the server was:
> > create table table1(i int)

> CREATE TABLE and CREATE TABLE AS are two different things.

> regression=# create table foo (x int);
> CREATE TABLE

> regression=# create table bar as select 1 as x;
> SELECT 1

>  regards, tom lane



Re: Documentation for CommandComplete is incorrect for CREATE TABLE with server version 10.2

2018-04-28 Thread Tom Lane
=?utf-8?q?PG_Doc_comments_form?=  writes:
> The documentation says:
> For a SELECT or CREATE TABLE AS command, the tag is SELECT rows where rows
> is the number of rows retrieved.

Yeah ...

> But what I get back from the server is this packet:
>    43 00 00 00 11 43 52 45 41 54 45 20 54 41 42 4c  CCREATE TABL
> 0010   45 00E.
> The query I sent to the server was:
> create table table1(i int)

CREATE TABLE and CREATE TABLE AS are two different things.

regression=# create table foo (x int);
CREATE TABLE

regression=# create table bar as select 1 as x;
SELECT 1

regards, tom lane



Re: Documentation for CommandComplete is incorrect for CREATE TABLE with server version 10.2

2018-04-28 Thread Alvaro Herrera
PG Doc comments form wrote:

> The documentation says:
> 
> For a SELECT or CREATE TABLE AS command, the tag is SELECT rows where rows
> is the number of rows retrieved.
> 
> But what I get back from the server is this packet:
> 
>    43 00 00 00 11 43 52 45 41 54 45 20 54 41 42 4c  CCREATE TABL
> 0010   45 00E.
> 
> The query I sent to the server was:
> 
> create table table1(i int)

Yeah, this is not a CREATE TABLE AS.  It's a plain CREATE TABLE.
Different thing.

alvherre=# create table dcm as select 'foo';
SELECT 1

-- 
Álvaro Herrerahttps://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



Documentation for CommandComplete is incorrect for CREATE TABLE with server version 10.2

2018-04-28 Thread PG Doc comments form
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/10/static/protocol-message-formats.html
Description:

On this page:
https://www.postgresql.org/docs/10/static/protocol-message-formats.html

The documentation says:

For a SELECT or CREATE TABLE AS command, the tag is SELECT rows where rows
is the number of rows retrieved.

But what I get back from the server is this packet:

   43 00 00 00 11 43 52 45 41 54 45 20 54 41 42 4c  CCREATE TABL
0010   45 00E.

The query I sent to the server was:

create table table1(i int)