Thread: COPY statement: no list of the allowed values for "format_name"
The following documentation comment has been logged on the website: Page: https://www.postgresql.org/docs/11/sql-copy.html Description: Look at the account of the COPY statement, here: https://www.postgresql.org/docs/11/sql-copy.html and see this: « [ [ WITH ] ( option [, ...] ) ] » It goes on to say this: « where option can be one of: FORMAT format_name » But there's no list of the allowed values for "format_name". The same holds for other options like, for example, "encoding_name". I tried to provoke the list by using "with (format 'dog')". I got the 22023 error: « COPY format "dog" not recognized » But there was no list of the allowed values.
On Thu, Oct 29, 2020 at 3:24 PM PG Doc comments form <noreply@postgresql.org> wrote:
The following documentation comment has been logged on the website:
Page: https://www.postgresql.org/docs/11/sql-copy.html
Description:
Look at the account of the COPY statement, here:
https://www.postgresql.org/docs/11/sql-copy.html
But there was no list of the allowed values.
Keep reading...
"""
FORMAT
Selects the data format to be read or written: text, csv (Comma Separated Values), or binary. The default is text."""
I suppose including the syntax term "format_type" might help, but the all-caps FORMAT is definitive.
David J.
PG Doc comments form wrote:
Look at the account of the COPY statement, here:
https://www.postgresql.org/docs/11/sql-copy.html
and see this:
"""
FORMAT
Selects the data format to be read or written: text, csv (Comma Separated Values), or binary. The default is text.
"""
I suppose including the syntax term "format_type" might help, but the all-caps FORMAT is definitive.
____________________________________________________________
Thanks for the quick reply, David. I do think that it’s reasonable to expect to search in the page rather than to have to read every word from top to bottom in the class of use cases that my example indicates. FORMAT is the syntax keyword; and format_name denotes the value. I think that this present sentence:
https://www.postgresql.org/docs/11/sql-copy.html
and see this:
«
[ [ WITH ] ( option [, ...] ) ]
»
It goes on to say this:
«
where option can be one of:
FORMAT format_name
»
But there's no list of the allowed values for "format_name". The same holds for other options like, for example, "encoding_name”.
[ [ WITH ] ( option [, ...] ) ]
»
It goes on to say this:
«
where option can be one of:
FORMAT format_name
»
But there's no list of the allowed values for "format_name". The same holds for other options like, for example, "encoding_name”.
"""
FORMAT
Selects the data format to be read or written: text, csv (Comma Separated Values), or binary. The default is text.
"""
I suppose including the syntax term "format_type" might help, but the all-caps FORMAT is definitive.
____________________________________________________________
Thanks for the quick reply, David. I do think that it’s reasonable to expect to search in the page rather than to have to read every word from top to bottom in the class of use cases that my example indicates. FORMAT is the syntax keyword; and format_name denotes the value. I think that this present sentence:
«
Selects the data format to be read or written: text, csv (Comma Separated Values), or binary. The default is text.
»
would be improved if it were spelled more explicitly:
«
Selects the data format to be read or written. The allowed values for format_name are text, csv (Comma Separated Values), or binary. The default is text.
»
Please consider making this change (and the convention that it implies for comparable cases).
On Thu, Oct 29, 2020 at 5:13 PM Bryn Llewellyn <bryn@yugabyte.com> wrote:
«Selects the data format to be read or written: text, csv (Comma Separated Values), or binary. The default is text.»would be improved if it were spelled more explicitly:
«Selects the data format to be read or written. The allowed values for format_name are text, csv (Comma Separated Values), or binary. The default is text.»
Please consider making this change (and the convention that it implies for comparable cases).
While I agree it isn't something I'm going to lead the charge on. As you are expressing strong feelings maybe you'd like to write up a patch. Fixing only COPY would suffice even though I suspect that there are other areas that need consideration.
David J.