public inbox for [email protected]
help / color / mirror / Atom feedFrom: Clément Prévost <[email protected]>
To: Tom Lane <[email protected]>
Cc: Peter Eisentraut <[email protected]>
Cc: [email protected]
Subject: Re: Documentation on information_ schema columns that does not exist
Date: Mon, 1 Jun 2015 01:25:13 +0200
Message-ID: <CABaKae8UVSGwyQ-QFKxsk9obqyBpYOsCfgO_jNP_Y8iTJOuJxw@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CABaKae8+p6=zhCM=Qrq_GMN88pFqjb5EgHpy9bjGaKZfvJmzZA@mail.gmail.com>
<[email protected]>
<[email protected]>
List-Unsubscribe: <mailto:[email protected]?body=unsub%20pgsql-docs>
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 <[email protected]> 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
>
--
Sent via pgsql-docs mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs
Attachments:
[application/octet-stream] conform-information-schema-foreign-table-column-type-to-spec.patch (1.3K, 3-conform-information-schema-foreign-table-column-type-to-spec.patch)
download | inline diff:
diff --git a/src/backend/catalog/information_schema.sql b/src/backend/catalog/information_schema.sql
index 6e1b241..5efed4f 100644
--- a/src/backend/catalog/information_schema.sql
+++ b/src/backend/catalog/information_schema.sql
@@ -2713,9 +2713,9 @@ GRANT SELECT ON element_types TO PUBLIC;
/* Base view for foreign table columns */
CREATE VIEW _pg_foreign_table_columns AS
- SELECT n.nspname,
- c.relname,
- a.attname,
+ SELECT CAST(n.nspname AS sql_identifier) AS nspname,
+ CAST(c.relname AS sql_identifier) AS relname,
+ CAST(a.attname AS sql_identifier) AS attname,
a.attfdwoptions
FROM pg_foreign_table t, pg_authid u, pg_namespace n, pg_class c,
pg_attribute a
@@ -2841,8 +2841,8 @@ GRANT SELECT ON foreign_servers TO PUBLIC;
CREATE VIEW _pg_foreign_tables AS
SELECT
CAST(current_database() AS sql_identifier) AS foreign_table_catalog,
- n.nspname AS foreign_table_schema,
- c.relname AS foreign_table_name,
+ CAST(n.nspname AS sql_identifier) AS foreign_table_schema,
+ CAST(c.relname AS sql_identifier) AS foreign_table_name,
t.ftoptions AS ftoptions,
CAST(current_database() AS sql_identifier) AS foreign_server_catalog,
CAST(srvname AS sql_identifier) AS foreign_server_name,
[application/octet-stream] remove-invalid-information-schema-doc.patch (866B, 4-remove-invalid-information-schema-doc.patch)
download | inline diff:
diff --git a/doc/src/sgml/information_schema.sgml b/doc/src/sgml/information_schema.sgml
index ca1f20b..c6e6c9d 100644
--- a/doc/src/sgml/information_schema.sgml
+++ b/doc/src/sgml/information_schema.sgml
@@ -2898,18 +2898,6 @@ ORDER BY c.ordinal_position;
</row>
<row>
- <entry><literal>foreign_server_catalog</literal></entry>
- <entry><type>sql_identifier</type></entry>
- <entry>Name of the database that the foreign server is defined in (always the current database)</entry>
- </row>
-
- <row>
- <entry><literal>foreign_server_name</literal></entry>
- <entry><type>sql_identifier</type></entry>
- <entry>Name of the foreign server</entry>
- </row>
-
- <row>
<entry><literal>option_name</literal></entry>
<entry><type>sql_identifier</type></entry>
<entry>Name of an option</entry>
view thread (9+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Documentation on information_ schema columns that does not exist
In-Reply-To: <CABaKae8UVSGwyQ-QFKxsk9obqyBpYOsCfgO_jNP_Y8iTJOuJxw@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox