Thread: Documentation on information_ schema columns that does not exist
Hi,
I found out that the following columns are documented (9.1->9.4) but not present in the information_schema table of my 9.4 instance (ubuntu):
* information_schema.foreign_table_options.foreign_server_catalog
* information_schema.foreign_table_options.foreign_server_name
The source code (/src/backend/catalog/information_schema.sql) seems to confirm that those columns shouldn't exist.
I'll be happy to help with a patch if it's indeed a documentation typo.
regards, clément prévost
=?UTF-8?B?Q2zDqW1lbnQgUHLDqXZvc3Q=?= <prevostclement@gmail.com> writes: > I found out that the following columns are documented (9.1->9.4) but not > present in the information_schema table of my 9.4 instance (ubuntu): > * information_schema.foreign_table_options.foreign_server_catalog > * information_schema.foreign_table_options.foreign_server_name Yeah, that does seem like a copy-and-pasteo; there should only be 5 columns in the view according to the SQL standard and our code. Another problem in the same area is that the column types of foreign_table_schema and foreign_table_name seem to be "name": # \d *.foreign_table_options View "information_schema.foreign_table_options" Column | Type | Modifiers -----------------------+-----------------------------------+----------- foreign_table_catalog | information_schema.sql_identifier | foreign_table_schema | name | foreign_table_name | name | option_name | information_schema.sql_identifier | option_value | information_schema.character_data | The documentation claims these should be sql_identifier, and that's what I'd expect in a SQL-standard view ... regards, tom lane
I wrote: > Another problem in the same area is that the column types of > foreign_table_schema and foreign_table_name seem to be "name": Further pursuant to that, these are the information_schema columns that don't seem to have been cast to the spec-required type: column_options | column_name | name column_options | table_name | name column_options | table_schema | name foreign_table_options | foreign_table_name | name foreign_table_options | foreign_table_schema | name foreign_tables | foreign_table_name | name foreign_tables | foreign_table_schema | name regards, tom lane
Well spotted!
I attached 2 patches: 1 to fix erroneous documentation and the other to fix information schema types.
regards, clément prévost
On 1 June 2015 at 00:14, Tom Lane <tgl@sss.pgh.pa.us> wrote:
I wrote:
> Another problem in the same area is that the column types of
> foreign_table_schema and foreign_table_name seem to be "name":
Further pursuant to that, these are the information_schema columns
that don't seem to have been cast to the spec-required type:
column_options | column_name | name
column_options | table_name | name
column_options | table_schema | name
foreign_table_options | foreign_table_name | name
foreign_table_options | foreign_table_schema | name
foreign_tables | foreign_table_name | name
foreign_tables | foreign_table_schema | name
regards, tom lane
Attachment
Here is another patch to fix the name of the column information_schema.routines.result_cast_char_set_name that was mistakenly named result_cast_character_set_name.
regards, clément prévost
On 1 June 2015 at 01:25, Clément Prévost <prevostclement@gmail.com> wrote:
Well spotted!I attached 2 patches: 1 to fix erroneous documentation and the other to fix information schema types.regards, clément prévostOn 1 June 2015 at 00:14, Tom Lane <tgl@sss.pgh.pa.us> wrote:I wrote:
> Another problem in the same area is that the column types of
> foreign_table_schema and foreign_table_name seem to be "name":
Further pursuant to that, these are the information_schema columns
that don't seem to have been cast to the spec-required type:
column_options | column_name | name
column_options | table_name | name
column_options | table_schema | name
foreign_table_options | foreign_table_name | name
foreign_table_options | foreign_table_schema | name
foreign_tables | foreign_table_name | name
foreign_tables | foreign_table_schema | name
regards, tom lane
Attachment
On 5/31/15 7:25 PM, Clément Prévost wrote: > I attached 2 patches: 1 to fix erroneous documentation and the other to > fix information schema types. I have fixed these two. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
On 5/31/15 8:27 PM, Clément Prévost wrote: > Here is another patch to fix the name of the column > information_schema.routines.result_cast_char_set_name that was > mistakenly named result_cast_character_set_name. This one is actually named result_cast_character_set_name in the standard, although that might be a mistake. Anyway, our documentation doesn't match our implementation, so one of them has to change. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes: > On 5/31/15 8:27 PM, Clément Prévost wrote: >> Here is another patch to fix the name of the column >> information_schema.routines.result_cast_char_set_name that was >> mistakenly named result_cast_character_set_name. > This one is actually named result_cast_character_set_name in the > standard, although that might be a mistake. Anyway, our documentation > doesn't match our implementation, so one of them has to change. Hm, yeah, I think I vote with the "it's a mistake" camp. The adjacent columns are named "result_cast_char_set_whatever", and there are occurrences of result_cast_char_set_name elsewhere, for example in the method_specifications view. regards, tom lane
On 8/3/16 3:27 PM, Tom Lane wrote: > Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes: >> On 5/31/15 8:27 PM, Clément Prévost wrote: >>> Here is another patch to fix the name of the column >>> information_schema.routines.result_cast_char_set_name that was >>> mistakenly named result_cast_character_set_name. > >> This one is actually named result_cast_character_set_name in the >> standard, although that might be a mistake. Anyway, our documentation >> doesn't match our implementation, so one of them has to change. > > Hm, yeah, I think I vote with the "it's a mistake" camp. The adjacent > columns are named "result_cast_char_set_whatever", and there are > occurrences of result_cast_char_set_name elsewhere, for example > in the method_specifications view. Fixed by changing the column name. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services