diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml
new file mode 100644
index d6baf84..07f67ff
*** a/doc/src/sgml/catalogs.sgml
--- b/doc/src/sgml/catalogs.sgml
***************
*** 2193,2198 ****
--- 2193,2297 ----
    </para>
   </sect1>
  
+  <sect1 id="catalog-pg-comments">
+   <title><structname>pg_comments</structname></title>
+ 
+   <indexterm zone="catalog-pg-comments">
+    <primary>pg_comments</primary>
+   </indexterm>
+ 
+   <para>
+    The <structname>pg_comments</structname> view displays the comments
+    associated with all database objects; only objects which have a comment
+    are displayed. Object comments are manipulated
+    using the <command>COMMENT ON</command> command.
+   </para>
+ 
+   <table>
+    <title><structname>pg_comments</> Columns</title>
+ 
+    <tgroup cols="4">
+     <thead>
+      <row>
+       <entry>Name</entry>
+       <entry>Type</entry>
+       <entry>References</entry>
+       <entry>Description</entry>
+      </row>
+     </thead>
+ 
+     <tbody>
+      <row>
+       <entry><structfield>objoid</structfield></entry>
+       <entry><type>oid</type></entry>
+       <entry><literal><link linkend="catalog-pg-description"><structname>pg_description</structname></link>.objoid</literal> or <literal><link linkend="catalog-pg-shdescription"><structname>pg_shdescription</structname></link>.objoid</literal></entry>
+       <entry>The OID of the object to which the comment pertains</entry>
+      </row>
+ 
+      <row>
+       <entry><structfield>classoid</structfield></entry>
+       <entry><type>oid</type></entry>
+       <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
+       <entry>
+        The OID of the system catalog this object appears in
+       </entry>
+      </row>
+ 
+      <row>
+       <entry><structfield>objsubid</structfield></entry>
+       <entry><type>int4</type></entry>
+       <entry><literal><link linkend="catalog-pg-description"><structname>pg_class</structname></link>.objsubid</literal></entry>
+       <entry>
+        For a comment on a table column, this is the column number
+        (the objoid and classoid refer to the table itself). For all other
+        object types, this column is zero.
+       </entry>
+      </row>
+ 
+      <row>
+       <entry><structfield>objtype</structfield></entry>
+       <entry><type>text</type></entry>
+       <entry></entry>
+       <entry>
+        The type of object to which the comment pertains
+       </entry>
+      </row>
+ 
+      <row>
+       <entry><structfield>objnamespace</structfield></entry>
+       <entry><type>oid</type></entry>
+       <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
+       <entry>
+        The OID of the namespace that contains this object, if applicable,
+        otherwise NULL
+       </entry>
+      </row>
+ 
+      <row>
+       <entry><structfield>objname</structfield></entry>
+       <entry><type>text</type></entry>
+       <entry></entry>
+       <entry>
+        The name of the object
+       </entry>
+      </row>
+ 
+      <row>
+       <entry><structfield>description</structfield></entry>
+       <entry><type>text</type></entry>
+       <entry><literal><link linkend="catalog-pg-description"><structname>pg_description</structname></link>.description</literal> or <literal><link linkend="catalog-pg-shdescription"><structname>pg_shdescription</structname></link>.description</literal></entry>
+       <entry>
+        The comment attached to the object
+       </entry>
+      </row>
+ 
+     </tbody>
+    </tgroup>
+   </table>
+ 
+  </sect1>
+ 
+ 
   <sect1 id="catalog-pg-conversion">
    <title><structname>pg_conversion</structname></title>
  
diff --git a/src/backend/catalog/system_views.sql b/src/backend/catalog/system_views.sql
new file mode 100644
index 2253ca8..dd0ce60
*** a/src/backend/catalog/system_views.sql
--- b/src/backend/catalog/system_views.sql
***************
*** 6,11 ****
--- 6,425 ----
   * src/backend/catalog/system_views.sql
   */
  
+ CREATE VIEW pg_comments AS
+     SELECT
+         d.objoid, d.classoid, d.objsubid,
+         CASE WHEN rel.relkind = 'r' THEN 'table'::text
+                  WHEN rel.relkind = 'v' THEN 'view'::text
+                  WHEN rel.relkind = 'i' THEN 'index'::text
+                  WHEN rel.relkind = 'S' THEN 'sequence'::text
+                  WHEN rel.relkind = 'f' THEN 'foreign table'::text END AS objtype,
+         rel.relnamespace AS objnamespace,
+         CASE WHEN pg_table_is_visible(rel.oid)
+                  THEN quote_ident(rel.relname)
+                  ELSE quote_ident(nsp.nspname) || '.' || quote_ident(rel.relname)
+                  END AS objname,
+         d.description
+ FROM
+         pg_description d
+         JOIN pg_class rel ON d.classoid = rel.tableoid AND d.objoid = rel.oid
+         JOIN pg_namespace nsp ON rel.relnamespace = nsp.oid
+ WHERE
+         d.objsubid = 0
+ UNION ALL
+ SELECT
+         d.objoid, d.classoid, d.objsubid,
+         'column'::text AS objtype,
+         rel.relnamespace AS objnamespace,
+         CASE WHEN pg_table_is_visible(rel.oid)
+                  THEN quote_ident(rel.relname)
+                  ELSE quote_ident(nsp.nspname) || '.' || quote_ident(rel.relname)
+                  END || '.' || att.attname AS objname,
+         d.description
+ FROM
+         pg_description d
+         JOIN pg_class rel ON d.classoid = rel.tableoid AND d.objoid = rel.oid
+         JOIN pg_attribute att
+                 ON rel.oid = att.attrelid AND d.objsubid = att.attnum
+         JOIN pg_namespace nsp ON rel.relnamespace = nsp.oid
+ WHERE
+         d.objsubid != 0
+ UNION ALL
+ SELECT
+         d.objoid, d.classoid, d.objsubid,
+         CASE WHEN pro.proisagg = true THEN 'aggregate'::text
+                  WHEN pro.proisagg = false THEN 'function'::text
+                  END AS objtype,
+         pro.pronamespace AS objnamespace,
+         CASE WHEN pg_function_is_visible(pro.oid)
+                  THEN quote_ident(pro.proname)
+                  ELSE quote_ident(nsp.nspname) || '.' || quote_ident(pro.proname)
+                  END || '('
+                  || pg_catalog.pg_get_function_arguments(pro.oid) || ')' AS objname,
+         d.description
+ FROM
+         pg_description d
+         JOIN pg_proc pro ON d.classoid = pro.tableoid AND d.objoid = pro.oid
+         JOIN pg_namespace nsp ON pro.pronamespace = nsp.oid
+ WHERE
+         d.objsubid = 0
+ UNION ALL
+ SELECT
+         d.objoid, d.classoid, d.objsubid,
+         'cast'::text AS objtype,
+         NULL::oid AS objnamespace,
+         '(' || format_type(cst.castsource, NULL)
+                 || ' AS ' || format_type(cst.casttarget, NULL) || ')' AS objname,
+         d.description
+ FROM
+         pg_description d
+         JOIN pg_cast cst ON d.classoid = cst.tableoid AND d.objoid = cst.oid
+ WHERE
+         d.objsubid = 0
+ UNION ALL
+ SELECT
+         d.objoid, d.classoid, d.objsubid,
+         'collation'::text AS objtype,
+         col.collnamespace AS objnamespace,
+         col.collname AS objname,
+         d.description
+ FROM
+         pg_description d
+         JOIN pg_collation col ON d.classoid = col.tableoid AND d.objoid = col.oid
+         JOIN pg_namespace nsp ON col.collnamespace = nsp.oid
+ WHERE
+         d.objsubid = 0
+ UNION ALL
+ SELECT
+         d.objoid, d.classoid, d.objsubid,
+         'constraint'::text AS objtype,
+         rel.relnamespace AS objnamespace,
+         con.conname || ' ON ' ||
+         CASE WHEN pg_table_is_visible(rel.oid)
+                  THEN quote_ident(rel.relname)
+                  ELSE quote_ident(nsp.nspname) || '.' || quote_ident(rel.relname)
+                  END AS objname,
+         d.description
+ FROM
+         pg_description d
+         JOIN pg_constraint con ON d.classoid = con.tableoid AND d.objoid = con.oid
+         JOIN pg_class rel ON con.conrelid = rel.oid
+         JOIN pg_namespace nsp ON rel.relnamespace = nsp.oid
+ WHERE
+         d.objsubid = 0
+ UNION ALL
+ SELECT
+         d.objoid, d.classoid, d.objsubid,
+         'conversion'::text AS objtype,
+         con.connamespace AS objnamespace,
+         CASE WHEN pg_conversion_is_visible(con.oid)
+                  THEN quote_ident(con.conname)
+                  ELSE quote_ident(nsp.nspname) || '.' || quote_ident(con.conname)
+                  END AS objname,
+         d.description
+ FROM
+         pg_description d
+         JOIN pg_conversion con ON d.classoid = con.tableoid AND d.objoid = con.oid
+         JOIN pg_namespace nsp ON con.connamespace = nsp.oid
+ WHERE
+         d.objsubid = 0
+ UNION ALL
+ SELECT
+         d.objoid, d.classoid, d.objsubid,
+         CASE WHEN typ.typtype = 'd' THEN 'domain'::text
+                  ELSE 'type'::text END AS objtype,
+         typ.typnamespace AS objnamespace,
+         CASE WHEN pg_type_is_visible(typ.oid)
+                  THEN quote_ident(typ.typname)
+                  ELSE quote_ident(nsp.nspname) || '.' || quote_ident(typ.typname)
+                  END AS objname,
+         d.description
+ FROM
+         pg_description d
+         JOIN pg_type typ ON d.classoid = typ.tableoid AND d.objoid = typ.oid
+         JOIN pg_namespace nsp ON typ.typnamespace = nsp.oid
+ WHERE
+         d.objsubid = 0
+ UNION ALL
+ SELECT
+         d.objoid, d.classoid, d.objsubid,
+         'extension'::text AS objtype,
+         ext.extnamespace AS objnamespace,
+         ext.extname AS objname,
+         d.description
+ FROM
+         pg_description d
+         JOIN pg_extension ext ON d.classoid = ext.tableoid AND d.objoid = ext.oid
+         JOIN pg_namespace nsp ON ext.extnamespace = nsp.oid
+ WHERE
+         d.objsubid = 0
+ UNION ALL
+ SELECT
+         d.objoid, d.classoid, d.objsubid,
+         'large object'::text AS objtype,
+         NULL::oid AS objnamespace,
+         d.objoid::text AS objname,
+         d.description
+ FROM
+         pg_description d
+         JOIN pg_largeobject_metadata lom ON d.objoid = lom.oid
+ WHERE
+         d.classoid = (SELECT oid FROM pg_class WHERE relname = 'pg_largeobject')
+         AND d.objsubid = 0
+ UNION ALL
+ SELECT
+         d.objoid, d.classoid, d.objsubid,
+         'operator'::text AS objtype,
+         opr.oprnamespace AS objnamespace,
+         CASE WHEN pg_operator_is_visible(opr.oid)
+                  THEN opr.oprname
+                  ELSE quote_ident(nsp.nspname) || '.' || opr.oprname
+                  END
+                 || '('
+                 || CASE WHEN opr.oprkind = 'r' THEN 'NONE'
+                                 ELSE format_type(opr.oprleft, NULL) END
+                 || ','
+                 || CASE WHEN opr.oprkind = 'l' THEN 'NONE'
+                                 ELSE format_type(opr.oprright, NULL) END
+                 || ')' AS objname,
+         d.description
+ FROM
+         pg_description d
+         JOIN pg_operator opr ON d.classoid = opr.tableoid AND d.objoid = opr.oid
+         JOIN pg_namespace nsp ON opr.oprnamespace = nsp.oid
+ WHERE
+         d.objsubid = 0
+ UNION ALL
+ SELECT
+         d.objoid, d.classoid, d.objsubid,
+         'operator class'::text AS objtype,
+         opc.opcnamespace AS objnamespace,
+         CASE WHEN pg_opclass_is_visible(opc.oid)
+                  THEN quote_ident(opc.opcname)
+                  ELSE quote_ident(nsp.nspname) || '.' || quote_ident(opc.opcname)
+                  END || ' USING ' || am.amname AS objname,
+         d.description
+ FROM
+         pg_description d
+         JOIN pg_opclass opc ON d.classoid = opc.tableoid AND d.objoid = opc.oid
+         JOIN pg_am am ON opc.opcmethod = am.oid
+         JOIN pg_namespace nsp ON opc.opcnamespace = nsp.oid
+ WHERE
+         d.objsubid = 0
+ UNION ALL
+ SELECT
+         d.objoid, d.classoid, d.objsubid,
+         'operator family'::text AS objtype,
+         opf.opfnamespace AS objnamespace,
+         CASE WHEN pg_opfamily_is_visible(opf.oid)
+                  THEN quote_ident(opf.opfname)
+                  ELSE quote_ident(nsp.nspname) || '.' || quote_ident(opf.opfname)
+                  END || ' USING ' || am.amname AS objname,
+         d.description
+ FROM
+         pg_description d
+         JOIN pg_opfamily opf ON d.classoid = opf.tableoid AND d.objoid = opf.oid
+         JOIN pg_am am ON opf.opfmethod = am.oid
+         JOIN pg_namespace nsp ON opf.opfnamespace = nsp.oid
+ WHERE
+         d.objsubid = 0
+ UNION ALL
+ SELECT
+         d.objoid, d.classoid, d.objsubid,
+         'language'::text AS objtype,
+         NULL::oid AS objnamespace,
+         quote_ident(lan.lanname) AS objname,
+         d.description
+ FROM
+         pg_description d
+         JOIN pg_language lan ON d.classoid = lan.tableoid AND d.objoid = lan.oid
+ WHERE
+         d.objsubid = 0
+ UNION ALL
+ SELECT
+         d.objoid, d.classoid, d.objsubid,
+         'rule'::text AS objtype,
+         rel.relnamespace AS objnamespace,
+         quote_ident(rew.rulename) || ' ON ' ||
+         CASE WHEN pg_table_is_visible(rel.oid)
+                  THEN quote_ident(rel.relname)
+                  ELSE quote_ident(nsp.nspname) || '.' || quote_ident(rel.relname)
+                  END AS objname,
+         d.description
+ FROM
+         pg_description d
+         JOIN pg_rewrite rew ON d.classoid = rew.tableoid AND d.objoid = rew.oid
+         JOIN pg_class rel ON rew.ev_class = rel.oid
+         JOIN pg_namespace nsp ON rel.relnamespace = nsp.oid
+ WHERE
+         d.objsubid = 0
+ UNION ALL
+ SELECT
+         d.objoid, d.classoid, d.objsubid,
+         'schema'::text AS objtype,
+         nsp.oid AS objnamespace,
+         quote_ident(nsp.nspname) AS objname,
+         d.description
+ FROM
+         pg_description d
+         JOIN pg_namespace nsp ON d.classoid = nsp.tableoid AND d.objoid = nsp.oid
+ WHERE
+         d.objsubid = 0
+ UNION ALL
+ SELECT
+         d.objoid, d.classoid, d.objsubid,
+         'text search configuration'::text AS objtype,
+         cfg.cfgnamespace AS objnamespace,
+         CASE WHEN pg_ts_config_is_visible(cfg.oid)
+                  THEN quote_ident(cfg.cfgname)
+                  ELSE quote_ident(nsp.nspname) || '.' || quote_ident(cfg.cfgname)
+                  END AS objname,
+         d.description
+ FROM
+         pg_description d
+         JOIN pg_ts_config cfg ON d.classoid = cfg.tableoid AND d.objoid = cfg.oid
+         JOIN pg_namespace nsp ON cfg.cfgnamespace = nsp.oid
+ WHERE
+         d.objsubid = 0
+ UNION ALL
+ SELECT
+         d.objoid, d.classoid, d.objsubid,
+         'text search dictionary'::text AS objtype,
+         dict.dictnamespace AS objnamespace,
+         CASE WHEN pg_ts_dict_is_visible(dict.oid)
+                  THEN quote_ident(dict.dictname)
+                  ELSE quote_ident(nsp.nspname) || '.' || quote_ident(dict.dictname)
+                  END AS objname,
+         d.description
+ FROM
+         pg_description d
+         JOIN pg_ts_dict dict ON d.classoid = dict.tableoid AND d.objoid = dict.oid
+         JOIN pg_namespace nsp ON dict.dictnamespace = nsp.oid
+ WHERE
+         d.objsubid = 0
+ UNION ALL
+ SELECT
+         d.objoid, d.classoid, d.objsubid,
+         'text search parser'::text AS objtype,
+         prs.prsnamespace AS objnamespace,
+         CASE WHEN pg_ts_parser_is_visible(prs.oid)
+                  THEN quote_ident(prs.prsname)
+                  ELSE quote_ident(nsp.nspname) || '.' || quote_ident(prs.prsname)
+                  END AS objname,
+         d.description
+ FROM
+         pg_description d
+         JOIN pg_ts_parser prs ON d.classoid = prs.tableoid AND d.objoid = prs.oid
+         JOIN pg_namespace nsp ON prs.prsnamespace = nsp.oid
+ WHERE
+         d.objsubid = 0
+ UNION ALL
+ SELECT
+         d.objoid, d.classoid, d.objsubid,
+         'text search template'::text AS objtype,
+         tmpl.tmplnamespace AS objnamespace,
+         CASE WHEN pg_ts_template_is_visible(tmpl.oid)
+                  THEN quote_ident(tmpl.tmplname)
+                  ELSE quote_ident(nsp.nspname) || '.' || quote_ident(tmpl.tmplname)
+                  END AS objname,
+         d.description
+ FROM
+         pg_description d
+         JOIN pg_ts_template tmpl
+                 ON d.classoid = tmpl.tableoid AND d.objoid = tmpl.oid
+         JOIN pg_namespace nsp ON tmpl.tmplnamespace = nsp.oid
+ WHERE
+         d.objsubid = 0
+ UNION ALL
+ SELECT
+         d.objoid, d.classoid, d.objsubid,
+         'trigger'::text AS objtype,
+         rel.relnamespace AS objnamespace,
+         quote_ident(tg.tgname) || ' ON ' ||
+         CASE WHEN pg_table_is_visible(rel.oid)
+              THEN quote_ident(rel.relname)
+              ELSE quote_ident(nsp.nspname) || '.' || quote_ident(rel.relname)
+              END AS objname,
+         d.description
+ FROM
+         pg_description d
+         JOIN pg_trigger tg ON d.classoid = tg.tableoid AND d.objoid = tg.oid
+         JOIN pg_class rel ON tg.tgrelid = rel.oid
+         JOIN pg_namespace nsp ON rel.relnamespace = nsp.oid
+ WHERE
+         d.objsubid = 0
+ UNION ALL
+ SELECT
+         d.objoid, d.classoid, d.objsubid,
+         'access method'::text AS objtype,
+         NULL::oid AS objnamespace,
+         quote_ident(am.amname) AS objname,
+         d.description
+ FROM
+         pg_description d
+         JOIN pg_am am ON d.classoid = am.tableoid AND d.objoid = am.oid
+ WHERE
+         d.objsubid = 0
+ UNION ALL
+ SELECT
+         d.objoid, d.classoid, 0::integer AS objsubid,
+         'database'::text AS objtype,
+         NULL::oid AS objnamespace,
+         quote_ident(dat.datname) AS objname,
+         d.description
+ FROM
+         pg_shdescription d
+         JOIN pg_database dat ON d.classoid = dat.tableoid AND d.objoid = dat.oid
+ UNION ALL
+ SELECT
+         d.objoid, d.classoid, 0::integer AS objsubid,
+         'role'::text AS objtype,
+         NULL::oid AS objnamespace,
+         quote_ident(rol.rolname) AS objname,
+         d.description
+ FROM
+         pg_shdescription d
+         JOIN pg_authid rol ON d.classoid = rol.tableoid AND d.objoid = rol.oid
+ UNION ALL
+ SELECT
+         d.objoid, d.classoid, 0::integer AS objsubid,
+         'tablespace'::text AS objtype,
+         NULL::oid AS objnamespace,
+         quote_ident(spc.spcname) AS objname,
+         d.description
+ FROM
+         pg_shdescription d
+         JOIN pg_tablespace spc
+                 ON d.classoid = spc.tableoid AND d.objoid = spc.oid
+ UNION ALL
+ SELECT
+         d.objoid, d.classoid, d.objsubid,
+         'foreign data wrapper'::text AS objtype,
+         NULL::oid AS objnamespace,
+         quote_ident(fdw.fdwname) AS objname,
+         d.description
+ FROM
+         pg_description d
+         JOIN pg_foreign_data_wrapper fdw
+                 ON d.classoid = fdw.tableoid AND d.objoid = fdw.oid
+ WHERE
+         d.objsubid = 0
+ UNION ALL
+ SELECT
+         d.objoid, d.classoid, d.objsubid,
+         'server'::text AS objtype,
+         NULL::oid AS objnamespace,
+         quote_ident(srv.srvname) AS objname,
+         d.description
+ FROM
+         pg_description d
+         JOIN pg_foreign_server srv
+                 ON d.classoid = srv.tableoid AND d.objoid = srv.oid
+ WHERE
+         d.objsubid = 0;
+ 
+ 
+ 
  CREATE VIEW pg_roles AS
      SELECT
          rolname,
diff --git a/src/test/regress/expected/rules.out b/src/test/regress/expected/rules.out
new file mode 100644
index 454e1f9..4d95d63
*** a/src/test/regress/expected/rules.out
--- b/src/test/regress/expected/rules.out
*************** drop table cchild;
*** 1276,1286 ****
  -- Check that ruleutils are working
  --
  SELECT viewname, definition FROM pg_views WHERE schemaname <> 'information_schema' ORDER BY viewname;
!             viewname             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   definition                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
! ---------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
   iexit                           | SELECT ih.name, ih.thepath, interpt_pp(ih.thepath, r.thepath) AS exit FROM ihighway ih, ramp r WHERE (ih.thepath ## r.thepath);
   pg_available_extension_versions | SELECT e.name, e.version, (x.extname IS NOT NULL) AS installed, e.superuser, e.relocatable, e.schema, e.requires, e.comment FROM (pg_available_extension_versions() e(name, version, superuser, relocatable, schema, requires, comment) LEFT JOIN pg_extension x ON (((e.name = x.extname) AND (e.version = x.extversion))));
   pg_available_extensions         | SELECT e.name, e.default_version, x.extversion AS installed_version, e.comment FROM (pg_available_extensions() e(name, default_version, comment) LEFT JOIN pg_extension x ON ((e.name = x.extname)));
   pg_cursors                      | SELECT c.name, c.statement, c.is_holdable, c.is_binary, c.is_scrollable, c.creation_time FROM pg_cursor() c(name, statement, is_holdable, is_binary, is_scrollable, creation_time);
   pg_group                        | SELECT pg_authid.rolname AS groname, pg_authid.oid AS grosysid, ARRAY(SELECT pg_auth_members.member FROM pg_auth_members WHERE (pg_auth_members.roleid = pg_authid.oid)) AS grolist FROM pg_authid WHERE (NOT pg_authid.rolcanlogin);
   pg_indexes                      | SELECT n.nspname AS schemaname, c.relname AS tablename, i.relname AS indexname, t.spcname AS tablespace, pg_get_indexdef(i.oid) AS indexdef FROM ((((pg_index x JOIN pg_class c ON ((c.oid = x.indrelid))) JOIN pg_class i ON ((i.oid = x.indexrelid))) LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))) LEFT JOIN pg_tablespace t ON ((t.oid = i.reltablespace))) WHERE ((c.relkind = 'r'::"char") AND (i.relkind = 'i'::"char"));
--- 1276,1287 ----
  -- Check that ruleutils are working
  --
  SELECT viewname, definition FROM pg_views WHERE schemaname <> 'information_schema' ORDER BY viewname;
!             viewname             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              definition                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
! ---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
   iexit                           | SELECT ih.name, ih.thepath, interpt_pp(ih.thepath, r.thepath) AS exit FROM ihighway ih, ramp r WHERE (ih.thepath ## r.thepath);
   pg_available_extension_versions | SELECT e.name, e.version, (x.extname IS NOT NULL) AS installed, e.superuser, e.relocatable, e.schema, e.requires, e.comment FROM (pg_available_extension_versions() e(name, version, superuser, relocatable, schema, requires, comment) LEFT JOIN pg_extension x ON (((e.name = x.extname) AND (e.version = x.extversion))));
   pg_available_extensions         | SELECT e.name, e.default_version, x.extversion AS installed_version, e.comment FROM (pg_available_extensions() e(name, default_version, comment) LEFT JOIN pg_extension x ON ((e.name = x.extname)));
+  pg_comments                     | (((((((((((((((((((((((((SELECT d.objoid, d.classoid, d.objsubid, CASE WHEN (rel.relkind = 'r'::"char") THEN 'table'::text WHEN (rel.relkind = 'v'::"char") THEN 'view'::text WHEN (rel.relkind = 'i'::"char") THEN 'index'::text WHEN (rel.relkind = 'S'::"char") THEN 'sequence'::text WHEN (rel.relkind = 'f'::"char") THEN 'foreign table'::text ELSE NULL::text END AS objtype, rel.relnamespace AS objnamespace, CASE WHEN pg_table_is_visible(rel.oid) THEN quote_ident((rel.relname)::text) ELSE ((quote_ident((nsp.nspname)::text) || '.'::text) || quote_ident((rel.relname)::text)) END AS objname, d.description FROM ((pg_description d JOIN pg_class rel ON (((d.classoid = rel.tableoid) AND (d.objoid = rel.oid)))) JOIN pg_namespace nsp ON ((rel.relnamespace = nsp.oid))) WHERE (d.objsubid = 0) UNION ALL SELECT d.objoid, d.classoid, d.objsubid, 'column'::text AS objtype, rel.relnamespace AS objnamespace, ((CASE WHEN pg_table_is_visible(rel.oid) THEN quote_ident((rel.relname)::text) ELSE ((quote_ident((nsp.nspname)::text) || '.'::text) || quote_ident((rel.relname)::text)) END || '.'::text) || (att.attname)::text) AS objname, d.description FROM (((pg_description d JOIN pg_class rel ON (((d.classoid = rel.tableoid) AND (d.objoid = rel.oid)))) JOIN pg_attribute att ON (((rel.oid = att.attrelid) AND (d.objsubid = att.attnum)))) JOIN pg_namespace nsp ON ((rel.relnamespace = nsp.oid))) WHERE (d.objsubid <> 0)) UNION ALL SELECT d.objoid, d.classoid, d.objsubid, CASE WHEN (pro.proisagg = true) THEN 'aggregate'::text WHEN (pro.proisagg = false) THEN 'function'::text ELSE NULL::text END AS objtype, pro.pronamespace AS objnamespace, (((CASE WHEN pg_function_is_visible(pro.oid) THEN quote_ident((pro.proname)::text) ELSE ((quote_ident((nsp.nspname)::text) || '.'::text) || quote_ident((pro.proname)::text)) END || '('::text) || pg_get_function_arguments(pro.oid)) || ')'::text) AS objname, d.description FROM ((pg_description d JOIN pg_proc pro ON (((d.classoid = pro.tableoid) AND (d.objoid = pro.oid)))) JOIN pg_namespace nsp ON ((pro.pronamespace = nsp.oid))) WHERE (d.objsubid = 0)) UNION ALL SELECT d.objoid, d.classoid, d.objsubid, 'cast'::text AS objtype, NULL::oid AS objnamespace, (((('('::text || format_type(cst.castsource, NULL::integer)) || ' AS '::text) || format_type(cst.casttarget, NULL::integer)) || ')'::text) AS objname, d.description FROM (pg_description d JOIN pg_cast cst ON (((d.classoid = cst.tableoid) AND (d.objoid = cst.oid)))) WHERE (d.objsubid = 0)) UNION ALL SELECT d.objoid, d.classoid, d.objsubid, 'collation'::text AS objtype, col.collnamespace AS objnamespace, col.collname AS objname, d.description FROM ((pg_description d JOIN pg_collation col ON (((d.classoid = col.tableoid) AND (d.objoid = col.oid)))) JOIN pg_namespace nsp ON ((col.collnamespace = nsp.oid))) WHERE (d.objsubid = 0)) UNION ALL SELECT d.objoid, d.classoid, d.objsubid, 'constraint'::text AS objtype, rel.relnamespace AS objnamespace, (((con.conname)::text || ' ON '::text) || CASE WHEN pg_table_is_visible(rel.oid) THEN quote_ident((rel.relname)::text) ELSE ((quote_ident((nsp.nspname)::text) || '.'::text) || quote_ident((rel.relname)::text)) END) AS objname, d.description FROM (((pg_description d JOIN pg_constraint con ON (((d.classoid = con.tableoid) AND (d.objoid = con.oid)))) JOIN pg_class rel ON ((con.conrelid = rel.oid))) JOIN pg_namespace nsp ON ((rel.relnamespace = nsp.oid))) WHERE (d.objsubid = 0)) UNION ALL SELECT d.objoid, d.classoid, d.objsubid, 'conversion'::text AS objtype, con.connamespace AS objnamespace, CASE WHEN pg_conversion_is_visible(con.oid) THEN quote_ident((con.conname)::text) ELSE ((quote_ident((nsp.nspname)::text) || '.'::text) || quote_ident((con.conname)::text)) END AS objname, d.description FROM ((pg_description d JOIN pg_conversion con ON (((d.classoid = con.tableoid) AND (d.objoid = con.oid)))) JOIN pg_namespace nsp ON ((con.connamespace = nsp.oid))) WHERE (d.objsubid = 0)) UNION ALL SELECT d.objoid, d.classoid, d.objsubid, CASE WHEN (typ.typtype = 'd'::"char") THEN 'domain'::text ELSE 'type'::text END AS objtype, typ.typnamespace AS objnamespace, CASE WHEN pg_type_is_visible(typ.oid) THEN quote_ident((typ.typname)::text) ELSE ((quote_ident((nsp.nspname)::text) || '.'::text) || quote_ident((typ.typname)::text)) END AS objname, d.description FROM ((pg_description d JOIN pg_type typ ON (((d.classoid = typ.tableoid) AND (d.objoid = typ.oid)))) JOIN pg_namespace nsp ON ((typ.typnamespace = nsp.oid))) WHERE (d.objsubid = 0)) UNION ALL SELECT d.objoid, d.classoid, d.objsubid, 'extension'::text AS objtype, ext.extnamespace AS objnamespace, ext.extname AS objname, d.description FROM ((pg_description d JOIN pg_extension ext ON (((d.classoid = ext.tableoid) AND (d.objoid = ext.oid)))) JOIN pg_namespace nsp ON ((ext.extnamespace = nsp.oid))) WHERE (d.objsubid = 0)) UNION ALL SELECT d.objoid, d.classoid, d.objsubid, 'large object'::text AS objtype, NULL::oid AS objnamespace, (d.objoid)::text AS objname, d.description FROM (pg_description d JOIN pg_largeobject_metadata lom ON ((d.objoid = lom.oid))) WHERE ((d.classoid = (SELECT pg_class.oid FROM pg_class WHERE (pg_class.relname = 'pg_largeobject'::name))) AND (d.objsubid = 0))) UNION ALL SELECT d.objoid, d.classoid, d.objsubid, 'operator'::text AS objtype, opr.oprnamespace AS objnamespace, (((((CASE WHEN pg_operator_is_visible(opr.oid) THEN (opr.oprname)::text ELSE ((quote_ident((nsp.nspname)::text) || '.'::text) || (opr.oprname)::text) END || '('::text) || CASE WHEN (opr.oprkind = 'r'::"char") THEN 'NONE'::text ELSE format_type(opr.oprleft, NULL::integer) END) || ','::text) || CASE WHEN (opr.oprkind = 'l'::"char") THEN 'NONE'::text ELSE format_type(opr.oprright, NULL::integer) END) || ')'::text) AS objname, d.description FROM ((pg_description d JOIN pg_operator opr ON (((d.classoid = opr.tableoid) AND (d.objoid = opr.oid)))) JOIN pg_namespace nsp ON ((opr.oprnamespace = nsp.oid))) WHERE (d.objsubid = 0)) UNION ALL SELECT d.objoid, d.classoid, d.objsubid, 'operator class'::text AS objtype, opc.opcnamespace AS objnamespace, ((CASE WHEN pg_opclass_is_visible(opc.oid) THEN quote_ident((opc.opcname)::text) ELSE ((quote_ident((nsp.nspname)::text) || '.'::text) || quote_ident((opc.opcname)::text)) END || ' USING '::text) || (am.amname)::text) AS objname, d.description FROM (((pg_description d JOIN pg_opclass opc ON (((d.classoid = opc.tableoid) AND (d.objoid = opc.oid)))) JOIN pg_am am ON ((opc.opcmethod = am.oid))) JOIN pg_namespace nsp ON ((opc.opcnamespace = nsp.oid))) WHERE (d.objsubid = 0)) UNION ALL SELECT d.objoid, d.classoid, d.objsubid, 'operator family'::text AS objtype, opf.opfnamespace AS objnamespace, ((CASE WHEN pg_opfamily_is_visible(opf.oid) THEN quote_ident((opf.opfname)::text) ELSE ((quote_ident((nsp.nspname)::text) || '.'::text) || quote_ident((opf.opfname)::text)) END || ' USING '::text) || (am.amname)::text) AS objname, d.description FROM (((pg_description d JOIN pg_opfamily opf ON (((d.classoid = opf.tableoid) AND (d.objoid = opf.oid)))) JOIN pg_am am ON ((opf.opfmethod = am.oid))) JOIN pg_namespace nsp ON ((opf.opfnamespace = nsp.oid))) WHERE (d.objsubid = 0)) UNION ALL SELECT d.objoid, d.classoid, d.objsubid, 'language'::text AS objtype, NULL::oid AS objnamespace, quote_ident((lan.lanname)::text) AS objname, d.description FROM (pg_description d JOIN pg_language lan ON (((d.classoid = lan.tableoid) AND (d.objoid = lan.oid)))) WHERE (d.objsubid = 0)) UNION ALL SELECT d.objoid, d.classoid, d.objsubid, 'rule'::text AS objtype, rel.relnamespace AS objnamespace, ((quote_ident((rew.rulename)::text) || ' ON '::text) || CASE WHEN pg_table_is_visible(rel.oid) THEN quote_ident((rel.relname)::text) ELSE ((quote_ident((nsp.nspname)::text) || '.'::text) || quote_ident((rel.relname)::text)) END) AS objname, d.description FROM (((pg_description d JOIN pg_rewrite rew ON (((d.classoid = rew.tableoid) AND (d.objoid = rew.oid)))) JOIN pg_class rel ON ((rew.ev_class = rel.oid))) JOIN pg_namespace nsp ON ((rel.relnamespace = nsp.oid))) WHERE (d.objsubid = 0)) UNION ALL SELECT d.objoid, d.classoid, d.objsubid, 'schema'::text AS objtype, nsp.oid AS objnamespace, quote_ident((nsp.nspname)::text) AS objname, d.description FROM (pg_description d JOIN pg_namespace nsp ON (((d.classoid = nsp.tableoid) AND (d.objoid = nsp.oid)))) WHERE (d.objsubid = 0)) UNION ALL SELECT d.objoid, d.classoid, d.objsubid, 'text search configuration'::text AS objtype, cfg.cfgnamespace AS objnamespace, CASE WHEN pg_ts_config_is_visible(cfg.oid) THEN quote_ident((cfg.cfgname)::text) ELSE ((quote_ident((nsp.nspname)::text) || '.'::text) || quote_ident((cfg.cfgname)::text)) END AS objname, d.description FROM ((pg_description d JOIN pg_ts_config cfg ON (((d.classoid = cfg.tableoid) AND (d.objoid = cfg.oid)))) JOIN pg_namespace nsp ON ((cfg.cfgnamespace = nsp.oid))) WHERE (d.objsubid = 0)) UNION ALL SELECT d.objoid, d.classoid, d.objsubid, 'text search dictionary'::text AS objtype, dict.dictnamespace AS objnamespace, CASE WHEN pg_ts_dict_is_visible(dict.oid) THEN quote_ident((dict.dictname)::text) ELSE ((quote_ident((nsp.nspname)::text) || '.'::text) || quote_ident((dict.dictname)::text)) END AS objname, d.description FROM ((pg_description d JOIN pg_ts_dict dict ON (((d.classoid = dict.tableoid) AND (d.objoid = dict.oid)))) JOIN pg_namespace nsp ON ((dict.dictnamespace = nsp.oid))) WHERE (d.objsubid = 0)) UNION ALL SELECT d.objoid, d.classoid, d.objsubid, 'text search parser'::text AS objtype, prs.prsnamespace AS objnamespace, CASE WHEN pg_ts_parser_is_visible(prs.oid) THEN quote_ident((prs.prsname)::text) ELSE ((quote_ident((nsp.nspname)::text) || '.'::text) || quote_ident((prs.prsname)::text)) END AS objname, d.description FROM ((pg_description d JOIN pg_ts_parser prs ON (((d.classoid = prs.tableoid) AND (d.objoid = prs.oid)))) JOIN pg_namespace nsp ON ((prs.prsnamespace = nsp.oid))) WHERE (d.objsubid = 0)) UNION ALL SELECT d.objoid, d.classoid, d.objsubid, 'text search template'::text AS objtype, tmpl.tmplnamespace AS objnamespace, CASE WHEN pg_ts_template_is_visible(tmpl.oid) THEN quote_ident((tmpl.tmplname)::text) ELSE ((quote_ident((nsp.nspname)::text) || '.'::text) || quote_ident((tmpl.tmplname)::text)) END AS objname, d.description FROM ((pg_description d JOIN pg_ts_template tmpl ON (((d.classoid = tmpl.tableoid) AND (d.objoid = tmpl.oid)))) JOIN pg_namespace nsp ON ((tmpl.tmplnamespace = nsp.oid))) WHERE (d.objsubid = 0)) UNION ALL SELECT d.objoid, d.classoid, d.objsubid, 'trigger'::text AS objtype, rel.relnamespace AS objnamespace, ((quote_ident((tg.tgname)::text) || ' ON '::text) || CASE WHEN pg_table_is_visible(rel.oid) THEN quote_ident((rel.relname)::text) ELSE ((quote_ident((nsp.nspname)::text) || '.'::text) || quote_ident((rel.relname)::text)) END) AS objname, d.description FROM (((pg_description d JOIN pg_trigger tg ON (((d.classoid = tg.tableoid) AND (d.objoid = tg.oid)))) JOIN pg_class rel ON ((tg.tgrelid = rel.oid))) JOIN pg_namespace nsp ON ((rel.relnamespace = nsp.oid))) WHERE (d.objsubid = 0)) UNION ALL SELECT d.objoid, d.classoid, d.objsubid, 'access method'::text AS objtype, NULL::oid AS objnamespace, quote_ident((am.amname)::text) AS objname, d.description FROM (pg_description d JOIN pg_am am ON (((d.classoid = am.tableoid) AND (d.objoid = am.oid)))) WHERE (d.objsubid = 0)) UNION ALL SELECT d.objoid, d.classoid, 0 AS objsubid, 'database'::text AS objtype, NULL::oid AS objnamespace, quote_ident((dat.datname)::text) AS objname, d.description FROM (pg_shdescription d JOIN pg_database dat ON (((d.classoid = dat.tableoid) AND (d.objoid = dat.oid))))) UNION ALL SELECT d.objoid, d.classoid, 0 AS objsubid, 'role'::text AS objtype, NULL::oid AS objnamespace, quote_ident((rol.rolname)::text) AS objname, d.description FROM (pg_shdescription d JOIN pg_authid rol ON (((d.classoid = rol.tableoid) AND (d.objoid = rol.oid))))) UNION ALL SELECT d.objoid, d.classoid, 0 AS objsubid, 'tablespace'::text AS objtype, NULL::oid AS objnamespace, quote_ident((spc.spcname)::text) AS objname, d.description FROM (pg_shdescription d JOIN pg_tablespace spc ON (((d.classoid = spc.tableoid) AND (d.objoid = spc.oid))))) UNION ALL SELECT d.objoid, d.classoid, d.objsubid, 'foreign data wrapper'::text AS objtype, NULL::oid AS objnamespace, quote_ident((fdw.fdwname)::text) AS objname, d.description FROM (pg_description d JOIN pg_foreign_data_wrapper fdw ON (((d.classoid = fdw.tableoid) AND (d.objoid = fdw.oid)))) WHERE (d.objsubid = 0)) UNION ALL SELECT d.objoid, d.classoid, d.objsubid, 'server'::text AS objtype, NULL::oid AS objnamespace, quote_ident((srv.srvname)::text) AS objname, d.description FROM (pg_description d JOIN pg_foreign_server srv ON (((d.classoid = srv.tableoid) AND (d.objoid = srv.oid)))) WHERE (d.objsubid = 0);
   pg_cursors                      | SELECT c.name, c.statement, c.is_holdable, c.is_binary, c.is_scrollable, c.creation_time FROM pg_cursor() c(name, statement, is_holdable, is_binary, is_scrollable, creation_time);
   pg_group                        | SELECT pg_authid.rolname AS groname, pg_authid.oid AS grosysid, ARRAY(SELECT pg_auth_members.member FROM pg_auth_members WHERE (pg_auth_members.roleid = pg_authid.oid)) AS grolist FROM pg_authid WHERE (NOT pg_authid.rolcanlogin);
   pg_indexes                      | SELECT n.nspname AS schemaname, c.relname AS tablename, i.relname AS indexname, t.spcname AS tablespace, pg_get_indexdef(i.oid) AS indexdef FROM ((((pg_index x JOIN pg_class c ON ((c.oid = x.indrelid))) JOIN pg_class i ON ((i.oid = x.indexrelid))) LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))) LEFT JOIN pg_tablespace t ON ((t.oid = i.reltablespace))) WHERE ((c.relkind = 'r'::"char") AND (i.relkind = 'i'::"char"));
*************** SELECT viewname, definition FROM pg_view
*** 1338,1344 ****
   shoelace_obsolete               | SELECT shoelace.sl_name, shoelace.sl_avail, shoelace.sl_color, shoelace.sl_len, shoelace.sl_unit, shoelace.sl_len_cm FROM shoelace WHERE (NOT (EXISTS (SELECT shoe.shoename FROM shoe WHERE (shoe.slcolor = shoelace.sl_color))));
   street                          | SELECT r.name, r.thepath, c.cname FROM ONLY road r, real_city c WHERE (c.outline ## r.thepath);
   toyemp                          | SELECT emp.name, emp.age, emp.location, (12 * emp.salary) AS annualsal FROM emp;
! (60 rows)
  
  SELECT tablename, rulename, definition FROM pg_rules
  	ORDER BY tablename, rulename;
--- 1339,1345 ----
   shoelace_obsolete               | SELECT shoelace.sl_name, shoelace.sl_avail, shoelace.sl_color, shoelace.sl_len, shoelace.sl_unit, shoelace.sl_len_cm FROM shoelace WHERE (NOT (EXISTS (SELECT shoe.shoename FROM shoe WHERE (shoe.slcolor = shoelace.sl_color))));
   street                          | SELECT r.name, r.thepath, c.cname FROM ONLY road r, real_city c WHERE (c.outline ## r.thepath);
   toyemp                          | SELECT emp.name, emp.age, emp.location, (12 * emp.salary) AS annualsal FROM emp;
! (61 rows)
  
  SELECT tablename, rulename, definition FROM pg_rules
  	ORDER BY tablename, rulename;