Subject: Documentation on information_ schema columns that does not exist

From: Clément Prévost <[email-masked]>
Date: Sun, 31 May 2015 23:40:57 +0200

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

---

From: Tom Lane <[email-masked]>
Date: Sun, 31 May 2015 17:54:44 -0400

> * 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

-- 
Sent via pgsql-docs mailing list ([email-masked])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs

---

From: Tom Lane <[email-masked]>
Date: Sun, 31 May 2015 18:14:31 -0400

> 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

---

From: Clément Prévost <[email-masked]>
Date: Mon, 1 Jun 2015 01:25:13 +0200

Well spotted!

I attached 2 patches: 1 to fix erroneous documentation and the other to fix
information schema types.

regards, clément prévost

---

From: Clément Prévost <[email-masked]>
Date: Mon, 1 Jun 2015 02:27:16 +0200

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 <[email-masked]> wrote:

> Well spotted!
>
> I attached 2 patches: 1 to fix erroneous documentation and the other to
> fix information schema types.
>
> regards, clément prévost
>

---

From: Peter Eisentraut <[email-masked]>
Date: Wed, 3 Aug 2016 14:59:58 -0400

> fix information schema types.

I have fixed these two.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

---

From: Peter Eisentraut <[email-masked]>
Date: Wed, 3 Aug 2016 15:05:47 -0400

On 5/31/15 8:27 PM, Clément Prévost wrote:
> 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.

---

From: Tom Lane <[email-masked]>
Date: Wed, 03 Aug 2016 15:27:27 -0400

> 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

---

From: Peter Eisentraut <[email-masked]>
Date: Sun, 7 Aug 2016 21:57:35 -0400

On 8/3/16 3:27 PM, Tom Lane wrote:
>> On 5/31/15 8:27 PM, ClÃ©ment PrÃ©vost wrote:

Fixed by changing the column name.