Re: i think there's a typo

2018-02-15 Thread Michael Paquier
On Thu, Feb 15, 2018 at 11:06:27PM +, PG Doc comments form wrote:
> SELECT usename FROM pg_user;
> 
> should be
> SELECT pg_user.usename FROM pg_user;

This is perfectly valid SQL.  The column selected is assumed to be from
pg_user.
--
Michael


signature.asc
Description: PGP signature


i think there's a typo

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

Page: https://www.postgresql.org/docs/8.0/static/user-manag.html
Description:

SELECT usename FROM pg_user;

should be
SELECT pg_user.usename FROM pg_user;


Re: The example for creating a check constraint is missing a comma

2018-02-15 Thread Neil Anderson

On 2018-02-15 1:47 PM, Tom Lane wrote:

=?utf-8?q?PG_Doc_comments_form?=  writes:

See the example from the documentation for CREATE TABLE below. There should
be a comma before the CONSTRAINT keyword.



CREATE TABLE distributors (
 did integer,
 namevarchar(40)
 CONSTRAINT con1 CHECK (did > 100 AND name <> '')
);


Hmm ... that example is legal syntax as-is, but considering that the
explanation for it says specifically that it's table-constraint syntax
not column-constraint syntax, I think you're right.

regards, tom lane




Oh yeah! You're right, strictly speaking it does work. I guess I read it 
as a table constraint because it's on the next line.



--
Neil Anderson
n...@postgrescompare.com
http://www.postgrescompare.com
<>

Re: The example for creating a check constraint is missing a comma

2018-02-15 Thread Tom Lane
=?utf-8?q?PG_Doc_comments_form?=  writes:
> See the example from the documentation for CREATE TABLE below. There should
> be a comma before the CONSTRAINT keyword. 

> CREATE TABLE distributors (
> did integer,
> namevarchar(40)
> CONSTRAINT con1 CHECK (did > 100 AND name <> '')
> );

Hmm ... that example is legal syntax as-is, but considering that the
explanation for it says specifically that it's table-constraint syntax
not column-constraint syntax, I think you're right.

regards, tom lane



The example for creating a check constraint is missing a comma

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

Page: https://www.postgresql.org/docs/10/static/sql-createtable.html
Description:

See the example from the documentation for CREATE TABLE below. There should
be a comma before the CONSTRAINT keyword. 

CREATE TABLE distributors (
did integer,
namevarchar(40)
CONSTRAINT con1 CHECK (did > 100 AND name <> '')
);


error fields

2018-02-15 Thread Bart Lengkeek
Hello doc keepers,


There is a minor incorrect statement in the libpq docs at following page.
https://www.postgresql.org/docs/devel/static/libpq-exec.html

Where it mentions PG_DIAG_SQLSTATE, in the documentation of the
PQresultErrorField, it says ".. is always present". But as I found out, and
verified after checking the source ( see comment at
https://doxygen.postgresql.org/fe-exec_8c_source.html#l00849 ), that isn't
true for libpq internal notices, which for example occur in a column out of
range situation.


Regards,

Bart Lengkeek