Guest User

materialized_views view definition

a guest
May 27th, 2015
1,207
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT (current_database())::information_schema.sql_identifier AS table_catalog,
  2.      (nc.nspname)::information_schema.sql_identifier AS table_schema,
  3.      (c.relname)::information_schema.sql_identifier AS table_name,
  4.      (
  5.          CASE
  6.              WHEN pg_has_role(c.relowner, 'USAGE'::text) THEN pg_get_viewdef(c.oid)
  7.              ELSE NULL::text
  8.          END)::information_schema.character_data AS view_definition,
  9.      (
  10.          CASE
  11.              WHEN ('check_option=cascaded'::text = ANY (c.reloptions)) THEN 'CASCADED'::text
  12.              WHEN ('check_option=local'::text = ANY (c.reloptions)) THEN 'LOCAL'::text
  13.              ELSE 'NONE'::text
  14.          END)::information_schema.character_data AS check_option,
  15.      (
  16.          CASE
  17.              WHEN ((pg_relation_is_updatable((c.oid)::regclass, false) & 20) = 20) THEN 'YES'::text
  18.              ELSE 'NO'::text
  19.          END)::information_schema.yes_or_no AS is_updatable,
  20.      (
  21.          CASE
  22.              WHEN ((pg_relation_is_updatable((c.oid)::regclass, false) & 8) = 8) THEN 'YES'::text
  23.              ELSE 'NO'::text
  24.          END)::information_schema.yes_or_no AS is_insertable_into,
  25.      (
  26.          CASE
  27.              WHEN (EXISTS ( SELECT 1
  28.                 FROM pg_trigger
  29.                WHERE ((pg_trigger.tgrelid = c.oid) AND (((pg_trigger.tgtype)::integer & 81) = 81)))) THEN 'YES'::text
  30.              ELSE 'NO'::text
  31.          END)::information_schema.yes_or_no AS is_trigger_updatable,
  32.      (
  33.          CASE
  34.              WHEN (EXISTS ( SELECT 1
  35.                 FROM pg_trigger
  36.                WHERE ((pg_trigger.tgrelid = c.oid) AND (((pg_trigger.tgtype)::integer & 73) = 73)))) THEN 'YES'::text
  37.              ELSE 'NO'::text
  38.          END)::information_schema.yes_or_no AS is_trigger_deletable,
  39.      (
  40.          CASE
  41.              WHEN (EXISTS ( SELECT 1
  42.                 FROM pg_trigger
  43.                WHERE ((pg_trigger.tgrelid = c.oid) AND (((pg_trigger.tgtype)::integer & 69) = 69)))) THEN 'YES'::text
  44.              ELSE 'NO'::text
  45.          END)::information_schema.yes_or_no AS is_trigger_insertable_into
  46.     FROM pg_namespace nc,
  47.      pg_class c
  48.    WHERE ((((c.relnamespace = nc.oid) AND (c.relkind = 'm'::"char")) AND (NOT pg_is_other_temp_schema(nc.oid))) AND ((pg_has_role(c.relowner, 'USAGE'::
  49. text) OR has_table_privilege(c.oid, 'SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER'::text)) OR has_any_column_privilege(c.oid, 'SELECT,
  50. INSERT, UPDATE, REFERENCES'::text)));
RAW Paste Data