-<!-- $PostgreSQL: pgsql/doc/src/sgml/information_schema.sgml,v 1.40 2009/07/07 18:23:13 petere Exp $ -->
+<!-- $PostgreSQL: pgsql/doc/src/sgml/information_schema.sgml,v 1.41 2009/07/13 20:25:57 petere Exp $ -->
<chapter id="information-schema">
<title>The Information Schema</title>
</para>
</listitem>
</varlistentry>
- </variablelist>
- Every column in the information schema has one of these four types.
- </para>
+ <varlistentry>
+ <term><type>yes_or_no</type></term>
+ <listitem>
+ <para>
+ A character string domain that contains
+ either <literal>YES</literal> or <literal>NO</literal>. This
+ is used to represent Boolean (true/false) data in the
+ information schema. (The information schema was invented
+ before the type <type>boolean</type> was added to the SQL
+ standard, so this convention is necessary to keep the
+ information schema backward compatible.)
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
- <para>
- Boolean (true/false) data is represented in the information schema
- by a column of type <type>character_data</type> that contains
- either <literal>YES</literal> or <literal>NO</literal>. (The
- information schema was invented before the type
- <type>boolean</type> was added to the SQL standard, so this
- convention is necessary to keep the information schema backward
- compatible.)
+ Every column in the information schema has one of these five types.
</para>
</sect1>
<row>
<entry><literal>is_grantable</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry>Always <literal>YES</literal></entry>
</row>
</tbody>
<row>
<entry><literal>is_grantable</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry>
<literal>YES</literal> if the grantee has the admin option on
the role, <literal>NO</literal> if not
<row>
<entry><literal>is_nullable</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry>
<literal>YES</literal> if the attribute is possibly nullable,
<literal>NO</literal> if it is known not nullable.
<row>
<entry><literal>is_derived_reference_attribute</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
</row>
</tbody>
<row>
<entry><literal>is_grantable</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
</row>
</tbody>
<row>
<entry><literal>is_nullable</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry>
<literal>YES</literal> if the column is possibly nullable,
<literal>NO</literal> if it is known not nullable. A not-null
<row>
<entry><literal>is_self_referencing</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
</row>
<row>
<entry><literal>is_identity</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
</row>
<row>
<entry><literal>identity_cycle</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
</row>
<row>
<entry><literal>is_updatable</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry>
<literal>YES</literal> if the column is updatable,
<literal>NO</literal> if not (Columns in base tables are always
<row>
<entry><literal>is_deferrable</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry><literal>YES</literal> if the constraint is deferrable, <literal>NO</literal> if not</entry>
</row>
<row>
<entry><literal>initially_deferred</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry><literal>YES</literal> if the constraint is deferrable and initially deferred, <literal>NO</literal> if not</entry>
</row>
</tbody>
<row>
<entry><literal>is_result</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
</row>
<row>
<entry><literal>as_locator</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
</row>
<row>
<entry><literal>is_grantable</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
</row>
</tbody>
<row>
<entry><literal>is_grantable</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
</row>
</tbody>
<row>
<entry><literal>is_grantable</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
</row>
<row>
<entry><literal>with_hierarchy</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
</row>
</tbody>
<row>
<entry><literal>is_grantable</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
</row>
</tbody>
<row>
<entry><literal>is_grantable</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
</row>
</tbody>
<row>
<entry><literal>is_deterministic</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry>
If the function is declared immutable (called deterministic in
the SQL standard), then <literal>YES</literal>, else
<row>
<entry><literal>is_null_call</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry>
If the function automatically returns null if any of its
arguments are null, then <literal>YES</literal>, else
<row>
<entry><literal>schema_level_routine</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry>
Always <literal>YES</literal> (The opposite would be a method
of a user-defined type, which is a feature not available in
<row>
<entry><literal>is_user_defined_cast</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
</row>
<row>
<entry><literal>is_implicitly_invocable</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
</row>
<row>
<entry><literal>as_locator</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
</row>
<row>
<entry><literal>new_savepoint_level</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
</row>
<row>
<entry><literal>is_udt_dependent</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
</row>
<row>
<entry><literal>result_cast_as_locator</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
</row>
<row>
<entry><literal>cycle_option</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry>Not yet implemented</entry>
</row>
</tbody>
<row>
<entry><literal>is_supported</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry>
<literal>YES</literal> if the feature is fully supported by the
current version of <productname>PostgreSQL</>, <literal>NO</literal> if not
<row>
<entry><literal>is_supported</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry>
<literal>YES</literal> if the package is fully supported by the
current version of <productname>PostgreSQL</>, <literal>NO</literal> if not
<row>
<entry><literal>is_supported</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry>
<literal>YES</literal> if the part is fully supported by the
current version of <productname>PostgreSQL</>,
<row>
<entry><literal>is_deferrable</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry><literal>YES</literal> if the constraint is deferrable, <literal>NO</literal> if not</entry>
</row>
<row>
<entry><literal>initially_deferred</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry><literal>YES</literal> if the constraint is deferrable and initially deferred, <literal>NO</literal> if not</entry>
</row>
</tbody>
<row>
<entry><literal>is_grantable</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
</row>
<row>
<entry><literal>with_hierarchy</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
</row>
</tbody>
<row>
<entry><literal>is_insertable_into</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry>
<literal>YES</literal> if the table is insertable into,
<literal>NO</literal> if not (Base tables are always insertable
<row>
<entry><literal>is_typed</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
</row>
<row>
<entry><literal>is_grantable</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
</row>
</tbody>
<row>
<entry><literal>is_updatable</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry>
<literal>YES</literal> if the view is updatable (allows
<command>UPDATE</command> and <command>DELETE</command>),
<row>
<entry><literal>is_insertable_into</literal></entry>
- <entry><type>character_data</type></entry>
+ <entry><type>yes_or_no</type></entry>
<entry>
<literal>YES</literal> if the view is insertable into (allows
<command>INSERT</command>), <literal>NO</literal> if not
</entry>
</row>
+
+ <row>
+ <entry><literal>is_trigger_updatable</literal></entry>
+ <entry><type>yes_or_no</type></entry>
+ <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
+ </row>
+
+ <row>
+ <entry><literal>is_trigger_deletable</literal></entry>
+ <entry><type>yes_or_no</type></entry>
+ <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
+ </row>
+
+ <row>
+ <entry><literal>is_trigger_insertable_into</literal></entry>
+ <entry><type>yes_or_no</type></entry>
+ <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
+ </row>
</tbody>
</tgroup>
</table>
/*
* SQL Information Schema
- * as defined in ISO/IEC 9075-11:2003
+ * as defined in ISO/IEC 9075-11:2008
*
* Copyright (c) 2003-2009, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/backend/catalog/information_schema.sql,v 1.56 2009/07/07 19:28:00 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/catalog/information_schema.sql,v 1.57 2009/07/13 20:25:57 petere Exp $
*/
/*
CREATE DOMAIN time_stamp AS timestamp(2) with time zone
DEFAULT current_timestamp(2);
+/*
+ * 5.7
+ * YES_OR_NO domain
+ */
+
+CREATE DOMAIN yes_or_no AS character varying(3)
+ CONSTRAINT yes_or_no_check CHECK (value IN ('YES', 'NO'));
--- 5.7 ADMINISTRABLE_ROLE_AUTHORIZATIONS view appears later.
+
+-- 5.8 ADMINISTRABLE_ROLE_AUTHORIZATIONS view appears later.
/*
- * 5.8
+ * 5.9
* APPLICABLE_ROLES view
*/
CREATE VIEW applicable_roles AS
SELECT CAST(a.rolname AS sql_identifier) AS grantee,
CAST(b.rolname AS sql_identifier) AS role_name,
- CAST(CASE WHEN m.admin_option THEN 'YES' ELSE 'NO' END AS character_data) AS is_grantable
+ CAST(CASE WHEN m.admin_option THEN 'YES' ELSE 'NO' END AS yes_or_no) AS is_grantable
FROM pg_auth_members m
JOIN pg_authid a ON (m.member = a.oid)
JOIN pg_authid b ON (m.roleid = b.oid)
/*
- * 5.7
+ * 5.8
* ADMINISTRABLE_ROLE_AUTHORIZATIONS view
*/
/*
- * 5.9
+ * 5.10
* ASSERTIONS view
*/
/*
- * 5.10
+ * 5.11
* ATTRIBUTES view
*/
CAST(a.attnum AS cardinal_number) AS ordinal_position,
CAST(pg_get_expr(ad.adbin, ad.adrelid) AS character_data) AS attribute_default,
CAST(CASE WHEN a.attnotnull OR (t.typtype = 'd' AND t.typnotnull) THEN 'NO' ELSE 'YES' END
- AS character_data)
+ AS yes_or_no)
AS is_nullable,
CAST(
CAST(null AS cardinal_number) AS maximum_cardinality,
CAST(a.attnum AS sql_identifier) AS dtd_identifier,
- CAST('NO' AS character_data) AS is_derived_reference_attribute
+ CAST('NO' AS yes_or_no) AS is_derived_reference_attribute
FROM (pg_attribute a LEFT JOIN pg_attrdef ad ON attrelid = adrelid AND attnum = adnum),
pg_class c, pg_namespace nc,
/*
- * 5.11
+ * 5.12
* CHARACTER_SETS view
*/
/*
- * 5.12
+ * 5.13
* CHECK_CONSTRAINT_ROUTINE_USAGE view
*/
/*
- * 5.13
+ * 5.14
* CHECK_CONSTRAINTS view
*/
/*
- * 5.14
+ * 5.15
* COLLATIONS view
*/
-- feature not supported
/*
- * 5.15
+ * 5.16
* COLLATION_CHARACTER_SET_APPLICABILITY view
*/
/*
- * 5.16
+ * 5.17
* COLUMN_COLUMN_USAGE view
*/
/*
- * 5.17
+ * 5.18
* COLUMN_DOMAIN_USAGE view
*/
/*
- * 5.18
+ * 5.19
* COLUMN_PRIVILEGES
*/
makeaclitem(grantee.oid, u_grantor.oid, pr.type, true))
OR aclcontains(a.attacl,
makeaclitem(grantee.oid, u_grantor.oid, pr.type, true))
- THEN 'YES' ELSE 'NO' END AS character_data) AS is_grantable
+ THEN 'YES' ELSE 'NO' END AS yes_or_no) AS is_grantable
FROM pg_attribute a,
pg_class c,
/*
- * 5.19
+ * 5.20
* COLUMN_UDT_USAGE view
*/
/*
- * 5.20
+ * 5.21
* COLUMNS view
*/
CAST(a.attnum AS cardinal_number) AS ordinal_position,
CAST(pg_get_expr(ad.adbin, ad.adrelid) AS character_data) AS column_default,
CAST(CASE WHEN a.attnotnull OR (t.typtype = 'd' AND t.typnotnull) THEN 'NO' ELSE 'YES' END
- AS character_data)
+ AS yes_or_no)
AS is_nullable,
CAST(
CAST(null AS cardinal_number) AS maximum_cardinality,
CAST(a.attnum AS sql_identifier) AS dtd_identifier,
- CAST('NO' AS character_data) AS is_self_referencing,
+ CAST('NO' AS yes_or_no) AS is_self_referencing,
- CAST('NO' AS character_data) AS is_identity,
+ CAST('NO' AS yes_or_no) AS is_identity,
CAST(null AS character_data) AS identity_generation,
CAST(null AS character_data) AS identity_start,
CAST(null AS character_data) AS identity_increment,
CAST(null AS character_data) AS identity_maximum,
CAST(null AS character_data) AS identity_minimum,
- CAST(null AS character_data) AS identity_cycle,
+ CAST(null AS yes_or_no) AS identity_cycle,
CAST('NEVER' AS character_data) AS is_generated,
CAST(null AS character_data) AS generation_expression,
OR (c.relkind = 'v'
AND EXISTS (SELECT 1 FROM pg_rewrite WHERE ev_class = c.oid AND ev_type = '2' AND is_instead)
AND EXISTS (SELECT 1 FROM pg_rewrite WHERE ev_class = c.oid AND ev_type = '4' AND is_instead))
- THEN 'YES' ELSE 'NO' END AS character_data) AS is_updatable
+ THEN 'YES' ELSE 'NO' END AS yes_or_no) AS is_updatable
FROM (pg_attribute a LEFT JOIN pg_attrdef ad ON attrelid = adrelid AND attnum = adnum),
pg_class c, pg_namespace nc,
/*
- * 5.21
+ * 5.22
* CONSTRAINT_COLUMN_USAGE view
*/
/*
- * 5.22
+ * 5.23
* CONSTRAINT_TABLE_USAGE view
*/
GRANT SELECT ON constraint_table_usage TO PUBLIC;
--- 5.23 DATA_TYPE_PRIVILEGES view appears later.
+-- 5.24 DATA_TYPE_PRIVILEGES view appears later.
/*
- * 5.24
+ * 5.25
* DIRECT_SUPERTABLES view
*/
/*
- * 5.25
+ * 5.26
* DIRECT_SUPERTYPES view
*/
/*
- * 5.26
+ * 5.27
* DOMAIN_CONSTRAINTS view
*/
CAST(n.nspname AS sql_identifier) AS domain_schema,
CAST(t.typname AS sql_identifier) AS domain_name,
CAST(CASE WHEN condeferrable THEN 'YES' ELSE 'NO' END
- AS character_data) AS is_deferrable,
+ AS yes_or_no) AS is_deferrable,
CAST(CASE WHEN condeferred THEN 'YES' ELSE 'NO' END
- AS character_data) AS initially_deferred
+ AS yes_or_no) AS initially_deferred
FROM pg_namespace rs, pg_namespace n, pg_constraint con, pg_type t
WHERE rs.oid = con.connamespace
AND n.oid = t.typnamespace
/*
- * 5.27
+ * 5.28
* DOMAINS view
*/
GRANT SELECT ON domains TO PUBLIC;
--- 5.28 ELEMENT_TYPES view appears later.
+-- 5.29 ELEMENT_TYPES view appears later.
/*
- * 5.29
+ * 5.30
* ENABLED_ROLES view
*/
/*
- * 5.30
+ * 5.31
* FIELDS view
*/
/*
- * 5.31
+ * 5.32
* KEY_COLUMN_USAGE view
*/
/*
- * 5.32
+ * 5.33
* METHOD_SPECIFICATION_PARAMETERS view
*/
/*
- * 5.33
+ * 5.34
* METHOD_SPECIFICATIONS view
*/
/*
- * 5.34
+ * 5.35
* PARAMETERS view
*/
WHEN proargmodes[(ss.x).n] = 'v' THEN 'IN'
WHEN proargmodes[(ss.x).n] = 't' THEN 'OUT'
END AS character_data) AS parameter_mode,
- CAST('NO' AS character_data) AS is_result,
- CAST('NO' AS character_data) AS as_locator,
+ CAST('NO' AS yes_or_no) AS is_result,
+ CAST('NO' AS yes_or_no) AS as_locator,
CAST(NULLIF(proargnames[(ss.x).n], '') AS sql_identifier) AS parameter_name,
CAST(
CASE WHEN t.typelem <> 0 AND t.typlen = -1 THEN 'ARRAY'
/*
- * 5.35
+ * 5.36
* REFERENCED_TYPES view
*/
/*
- * 5.36
+ * 5.37
* REFERENTIAL_CONSTRAINTS view
*/
/*
- * 5.37
+ * 5.38
* ROLE_COLUMN_GRANTS view
*/
makeaclitem(g_grantee.oid, u_grantor.oid, pr.type, true))
OR aclcontains(a.attacl,
makeaclitem(g_grantee.oid, u_grantor.oid, pr.type, true))
- THEN 'YES' ELSE 'NO' END AS character_data) AS is_grantable
+ THEN 'YES' ELSE 'NO' END AS yes_or_no) AS is_grantable
FROM pg_attribute a,
pg_class c,
/*
- * 5.38
+ * 5.39
* ROLE_ROUTINE_GRANTS view
*/
pg_has_role(g_grantee.oid, p.proowner, 'USAGE')
OR aclcontains(p.proacl,
makeaclitem(g_grantee.oid, u_grantor.oid, 'EXECUTE', true))
- THEN 'YES' ELSE 'NO' END AS character_data) AS is_grantable
+ THEN 'YES' ELSE 'NO' END AS yes_or_no) AS is_grantable
FROM pg_proc p,
pg_namespace n,
/*
- * 5.39
+ * 5.40
* ROLE_TABLE_GRANTS view
*/
pg_has_role(g_grantee.oid, c.relowner, 'USAGE')
OR aclcontains(c.relacl,
makeaclitem(g_grantee.oid, u_grantor.oid, pr.type, true))
- THEN 'YES' ELSE 'NO' END AS character_data) AS is_grantable,
- CAST('NO' AS character_data) AS with_hierarchy
+ THEN 'YES' ELSE 'NO' END AS yes_or_no) AS is_grantable,
+ CAST('NO' AS yes_or_no) AS with_hierarchy
FROM pg_class c,
pg_namespace nc,
/*
- * 5.40
+ * 5.41
* ROLE_TABLE_METHOD_GRANTS view
*/
/*
- * 5.41
+ * 5.42
* ROLE_USAGE_GRANTS view
*/
pg_has_role(g_grantee.oid, fdw.fdwowner, 'USAGE')
OR aclcontains(fdw.fdwacl,
makeaclitem(g_grantee.oid, u_grantor.oid, 'USAGE', true))
- THEN 'YES' ELSE 'NO' END AS character_data) AS is_grantable
+ THEN 'YES' ELSE 'NO' END AS yes_or_no) AS is_grantable
FROM pg_foreign_data_wrapper fdw,
pg_authid u_grantor,
pg_has_role(g_grantee.oid, srv.srvowner, 'USAGE')
OR aclcontains(srv.srvacl,
makeaclitem(g_grantee.oid, u_grantor.oid, 'USAGE', true))
- THEN 'YES' ELSE 'NO' END AS character_data) AS is_grantable
+ THEN 'YES' ELSE 'NO' END AS yes_or_no) AS is_grantable
FROM pg_foreign_server srv,
pg_authid u_grantor,
/*
- * 5.42
+ * 5.43
* ROLE_UDT_GRANTS view
*/
/*
- * 5.43
+ * 5.44
* ROUTINE_COLUMN_USAGE view
*/
/*
- * 5.44
+ * 5.45
* ROUTINE_PRIVILEGES view
*/
pg_has_role(grantee.oid, p.proowner, 'USAGE')
OR aclcontains(p.proacl,
makeaclitem(grantee.oid, u_grantor.oid, 'EXECUTE', true))
- THEN 'YES' ELSE 'NO' END AS character_data) AS is_grantable
+ THEN 'YES' ELSE 'NO' END AS yes_or_no) AS is_grantable
FROM pg_proc p,
pg_namespace n,
/*
- * 5.45
+ * 5.46
* ROUTINE_ROUTINE_USAGE view
*/
/*
- * 5.46
+ * 5.47
* ROUTINE_SEQUENCE_USAGE view
*/
/*
- * 5.47
+ * 5.48
* ROUTINE_TABLE_USAGE view
*/
/*
- * 5.48
+ * 5.49
* ROUTINES view
*/
CAST(upper(l.lanname) AS character_data) AS external_language,
CAST('GENERAL' AS character_data) AS parameter_style,
- CAST(CASE WHEN p.provolatile = 'i' THEN 'YES' ELSE 'NO' END AS character_data) AS is_deterministic,
+ CAST(CASE WHEN p.provolatile = 'i' THEN 'YES' ELSE 'NO' END AS yes_or_no) AS is_deterministic,
CAST('MODIFIES' AS character_data) AS sql_data_access,
- CAST(CASE WHEN p.proisstrict THEN 'YES' ELSE 'NO' END AS character_data) AS is_null_call,
+ CAST(CASE WHEN p.proisstrict THEN 'YES' ELSE 'NO' END AS yes_or_no) AS is_null_call,
CAST(null AS character_data) AS sql_path,
- CAST('YES' AS character_data) AS schema_level_routine,
+ CAST('YES' AS yes_or_no) AS schema_level_routine,
CAST(0 AS cardinal_number) AS max_dynamic_result_sets,
- CAST(null AS character_data) AS is_user_defined_cast,
- CAST(null AS character_data) AS is_implicitly_invocable,
+ CAST(null AS yes_or_no) AS is_user_defined_cast,
+ CAST(null AS yes_or_no) AS is_implicitly_invocable,
CAST(CASE WHEN p.prosecdef THEN 'DEFINER' ELSE 'INVOKER' END AS character_data) AS security_type,
CAST(null AS sql_identifier) AS to_sql_specific_catalog,
CAST(null AS sql_identifier) AS to_sql_specific_schema,
CAST(null AS sql_identifier) AS to_sql_specific_name,
- CAST('NO' AS character_data) AS as_locator,
+ CAST('NO' AS yes_or_no) AS as_locator,
CAST(null AS time_stamp) AS created,
CAST(null AS time_stamp) AS last_altered,
- CAST(null AS character_data) AS new_savepoint_level,
- CAST('YES' AS character_data) AS is_udt_dependent, -- FIXME?
+ CAST(null AS yes_or_no) AS new_savepoint_level,
+ CAST('YES' AS yes_or_no) AS is_udt_dependent, -- FIXME?
CAST(null AS character_data) AS result_cast_from_data_type,
- CAST(null AS character_data) AS result_cast_as_locator,
+ CAST(null AS yes_or_no) AS result_cast_as_locator,
CAST(null AS cardinal_number) AS result_cast_char_max_length,
CAST(null AS cardinal_number) AS result_cast_char_octet_length,
CAST(null AS sql_identifier) AS result_cast_char_set_catalog,
/*
- * 5.49
+ * 5.50
* SCHEMATA view
*/
/*
- * 5.50
+ * 5.51
* SEQUENCES view
*/
CAST(null AS cardinal_number) AS maximum_value, -- FIXME
CAST(null AS cardinal_number) AS minimum_value, -- FIXME
CAST(null AS cardinal_number) AS increment, -- FIXME
- CAST(null AS character_data) AS cycle_option -- FIXME
+ CAST(null AS yes_or_no) AS cycle_option -- FIXME
FROM pg_namespace nc, pg_class c
WHERE c.relnamespace = nc.oid
AND c.relkind = 'S'
/*
- * 5.51
+ * 5.52
* SQL_FEATURES table
*/
feature_name character_data,
sub_feature_id character_data,
sub_feature_name character_data,
- is_supported character_data,
+ is_supported yes_or_no,
is_verified_by character_data,
comments character_data
) WITHOUT OIDS;
/*
- * 5.52
+ * 5.53
* SQL_IMPLEMENTATION_INFO table
*/
--- Note: Implementation information items are defined in ISO/IEC 9075-3:2003,
--- clause 7.1.
+-- Note: Implementation information items are defined in ISO/IEC 9075-3:2008,
+-- clause 9.1.
CREATE TABLE sql_implementation_info (
implementation_info_id character_data,
/*
- * 5.53
* SQL_LANGUAGES table
+ * apparently removed in SQL:2008
*/
CREATE TABLE sql_languages (
CREATE TABLE sql_packages (
feature_id character_data,
feature_name character_data,
- is_supported character_data,
+ is_supported yes_or_no,
is_verified_by character_data,
comments character_data
) WITHOUT OIDS;
CREATE TABLE sql_parts (
feature_id character_data,
feature_name character_data,
- is_supported character_data,
+ is_supported yes_or_no,
is_verified_by character_data,
comments character_data
) WITHOUT OIDS;
* SQL_SIZING table
*/
--- Note: Sizing items are defined in ISO/IEC 9075-3:2003, clause 7.2.
+-- Note: Sizing items are defined in ISO/IEC 9075-3:2008, clause 9.2.
CREATE TABLE sql_sizing (
sizing_id cardinal_number,
WHEN 'p' THEN 'PRIMARY KEY'
WHEN 'u' THEN 'UNIQUE' END
AS character_data) AS constraint_type,
- CAST(CASE WHEN c.condeferrable THEN 'YES' ELSE 'NO' END AS character_data)
+ CAST(CASE WHEN c.condeferrable THEN 'YES' ELSE 'NO' END AS yes_or_no)
AS is_deferrable,
- CAST(CASE WHEN c.condeferred THEN 'YES' ELSE 'NO' END AS character_data)
+ CAST(CASE WHEN c.condeferred THEN 'YES' ELSE 'NO' END AS yes_or_no)
AS initially_deferred
FROM pg_namespace nc,
CAST(nr.nspname AS sql_identifier) AS table_schema,
CAST(r.relname AS sql_identifier) AS table_name,
CAST('CHECK' AS character_data) AS constraint_type,
- CAST('NO' AS character_data) AS is_deferrable,
- CAST('NO' AS character_data) AS initially_deferred
+ CAST('NO' AS yes_or_no) AS is_deferrable,
+ CAST('NO' AS yes_or_no) AS initially_deferred
FROM pg_namespace nr,
pg_class r,
pg_has_role(grantee.oid, c.relowner, 'USAGE')
OR aclcontains(c.relacl,
makeaclitem(grantee.oid, u_grantor.oid, pr.type, true))
- THEN 'YES' ELSE 'NO' END AS character_data) AS is_grantable,
- CAST('NO' AS character_data) AS with_hierarchy
+ THEN 'YES' ELSE 'NO' END AS yes_or_no) AS is_grantable,
+ CAST('NO' AS yes_or_no) AS with_hierarchy
FROM pg_class c,
pg_namespace nc,
CAST(CASE WHEN c.relkind = 'r'
OR (c.relkind = 'v'
AND EXISTS (SELECT 1 FROM pg_rewrite WHERE ev_class = c.oid AND ev_type = '3' AND is_instead))
- THEN 'YES' ELSE 'NO' END AS character_data) AS is_insertable_into,
+ THEN 'YES' ELSE 'NO' END AS yes_or_no) AS is_insertable_into,
- CAST('NO' AS character_data) AS is_typed,
+ CAST('NO' AS yes_or_no) AS is_typed,
CAST(
CASE WHEN nc.oid = pg_my_temp_schema() THEN 'PRESERVE' -- FIXME
ELSE null END
CAST(t.typname AS sql_identifier) AS object_name,
CAST('DOMAIN' AS character_data) AS object_type,
CAST('USAGE' AS character_data) AS privilege_type,
- CAST('NO' AS character_data) AS is_grantable
+ CAST('NO' AS yes_or_no) AS is_grantable
FROM pg_authid u,
pg_namespace n,
pg_has_role(grantee.oid, fdw.fdwowner, 'USAGE')
OR aclcontains(fdw.fdwacl,
makeaclitem(grantee.oid, u_grantor.oid, 'USAGE', true))
- THEN 'YES' ELSE 'NO' END AS character_data) AS is_grantable
+ THEN 'YES' ELSE 'NO' END AS yes_or_no) AS is_grantable
FROM pg_foreign_data_wrapper fdw,
pg_authid u_grantor,
pg_has_role(grantee.oid, srv.srvowner, 'USAGE')
OR aclcontains(srv.srvacl,
makeaclitem(grantee.oid, u_grantor.oid, 'USAGE', true))
- THEN 'YES' ELSE 'NO' END AS character_data) AS is_grantable
+ THEN 'YES' ELSE 'NO' END AS yes_or_no) AS is_grantable
FROM pg_foreign_server srv,
pg_authid u_grantor,
CASE WHEN EXISTS (SELECT 1 FROM pg_rewrite WHERE ev_class = c.oid AND ev_type = '2' AND is_instead)
AND EXISTS (SELECT 1 FROM pg_rewrite WHERE ev_class = c.oid AND ev_type = '4' AND is_instead)
THEN 'YES' ELSE 'NO' END
- AS character_data) AS is_updatable,
+ AS yes_or_no) AS is_updatable,
CAST(
CASE WHEN EXISTS (SELECT 1 FROM pg_rewrite WHERE ev_class = c.oid AND ev_type = '3' AND is_instead)
THEN 'YES' ELSE 'NO' END
- AS character_data) AS is_insertable_into
+ AS yes_or_no) AS is_insertable_into,
+
+ CAST('NO' AS yes_or_no) AS is_trigger_updatable,
+ CAST('NO' AS yes_or_no) AS is_trigger_deletable,
+ CAST('NO' AS yes_or_no) AS is_trigger_insertable_into
FROM pg_namespace nc, pg_class c
-- The following views have dependencies that force them to appear out of order.
/*
- * 5.23
+ * 5.24
* DATA_TYPE_PRIVILEGES view
*/
/*
- * 5.28
+ * 5.29
* ELEMENT_TYPES view
*/