From: Peter Eisentraut Date: Wed, 14 Jan 2009 21:12:09 +0000 (+0000) Subject: Make the columns is_insertable_into and is_updatable behave uniformly X-Git-Tag: recoveryinfrav9~46 X-Git-Url: http://git.postgresql.org/gitweb/irc:/static/gitweb.js?a=commitdiff_plain;h=4b0c861a202e2e79d3c35e5cba4bbad75802132c;p=users%2Fsimon%2Fpostgres.git Make the columns is_insertable_into and is_updatable behave uniformly correctly. They are supposed to examine which kinds of rules are present, which they did in some of the info schema views but not in others. --- diff --git a/src/backend/catalog/information_schema.sql b/src/backend/catalog/information_schema.sql index c2eb4a0b4f..f905ab5354 100644 --- a/src/backend/catalog/information_schema.sql +++ b/src/backend/catalog/information_schema.sql @@ -655,6 +655,9 @@ CREATE VIEW columns AS CAST(null AS character_data) AS generation_expression, 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 = '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 FROM (pg_attribute a LEFT JOIN pg_attrdef ad ON attrelid = adrelid AND attnum = adnum), @@ -1882,7 +1885,10 @@ CREATE VIEW tables AS CAST(null AS sql_identifier) AS user_defined_type_name, 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, + CAST('NO' AS character_data) AS is_typed, CAST( CASE WHEN nc.oid = pg_my_temp_schema() THEN 'PRESERVE' -- FIXME