]> granicus.if.org Git - postgresql/commitdiff
Add ALTER TABLE ... ALTER COLUMN ... SET STATISTICS DISTINCT
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 2 Aug 2009 22:14:53 +0000 (22:14 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 2 Aug 2009 22:14:53 +0000 (22:14 +0000)
Robert Haas

17 files changed:
doc/src/sgml/catalogs.sgml
doc/src/sgml/ref/alter_table.sgml
doc/src/sgml/ref/analyze.sgml
src/backend/access/common/tupdesc.c
src/backend/bootstrap/bootstrap.c
src/backend/catalog/heap.c
src/backend/catalog/index.c
src/backend/commands/analyze.c
src/backend/commands/tablecmds.c
src/backend/parser/gram.y
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dump.h
src/bin/psql/tab-complete.c
src/include/catalog/catversion.h
src/include/catalog/pg_attribute.h
src/include/catalog/pg_class.h
src/include/nodes/parsenodes.h

index 99aee810da4eb32343e95e2eed9d81a984dd71d8..6cca97498172310e578ea127f5605bfa2a2ef5ef 100644 (file)
@@ -1,4 +1,4 @@
-<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.203 2009/07/29 20:56:17 tgl Exp $ -->
+<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.204 2009/08/02 22:14:51 tgl Exp $ -->
 <!--
  Documentation of the system catalogs, directed toward PostgreSQL developers
  -->
       </entry>
      </row>
 
+     <row>
+      <entry><structfield>attdistinct</structfield></entry>
+      <entry><type>float4</type></entry>
+      <entry></entry>
+      <entry>
+       <structfield>attdistinct</structfield>, if nonzero, is a user-specified
+       number-of-distinct-values figure to be used instead of estimating the
+       number of distinct values during <command>ANALYZE</>.  Nonzero values
+       have the same meanings as for
+       <link linkend="catalog-pg-statistic"><structname>pg_statistic</></link>.<structfield>stadistinct</>
+      </entry>
+     </row>
+
      <row>
       <entry><structfield>attlen</structfield></entry>
       <entry><type>int2</type></entry>
       <entry></entry>
       <entry>The number of distinct nonnull data values in the column.
       A value greater than zero is the actual number of distinct values.
-      A value less than zero is the negative of a fraction of the number
-      of rows in the table (for example, a column in which values appear about
-      twice on the average could be represented by <structfield>stadistinct</> = -0.5).
+      A value less than zero is the negative of a multiplier for the number
+      of rows in the table; for example, a column in which values appear about
+      twice on the average could be represented by
+      <structfield>stadistinct</> = -0.5.
       A zero value means the number of distinct values is unknown
       </entry>
      </row>
index 87892f84b1e792193439cc287a5704da841f4a06..01aefb91307231c65e6f3ca9499ba394851486a7 100644 (file)
@@ -1,5 +1,5 @@
 <!--
-$PostgreSQL: pgsql/doc/src/sgml/ref/alter_table.sgml,v 1.107 2009/07/20 02:42:27 adunstan Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/alter_table.sgml,v 1.108 2009/08/02 22:14:51 tgl Exp $
 PostgreSQL documentation
 -->
 
@@ -39,6 +39,7 @@ where <replaceable class="PARAMETER">action</replaceable> is one of:
     ALTER [ COLUMN ] <replaceable class="PARAMETER">column</replaceable> DROP DEFAULT
     ALTER [ COLUMN ] <replaceable class="PARAMETER">column</replaceable> { SET | DROP } NOT NULL
     ALTER [ COLUMN ] <replaceable class="PARAMETER">column</replaceable> SET STATISTICS <replaceable class="PARAMETER">integer</replaceable>
+    ALTER [ COLUMN ] <replaceable class="PARAMETER">column</replaceable> SET STATISTICS DISTINCT <replaceable class="PARAMETER">number</replaceable>
     ALTER [ COLUMN ] <replaceable class="PARAMETER">column</replaceable> SET STORAGE { PLAIN | EXTERNAL | EXTENDED | MAIN }
     ADD <replaceable class="PARAMETER">table_constraint</replaceable>
     DROP CONSTRAINT [ IF EXISTS ]  <replaceable class="PARAMETER">constraint_name</replaceable> [ RESTRICT | CASCADE ]
@@ -90,8 +91,8 @@ where <replaceable class="PARAMETER">action</replaceable> is one of:
       dropped as well.  You will need to say <literal>CASCADE</> if
       anything outside the table depends on the column, for example,
       foreign key references or views.
-      If <literal>IF EXISTS</literal> is specified and the column 
-      does not exist, no error is thrown. In this case a notice 
+      If <literal>IF EXISTS</literal> is specified and the column
+      does not exist, no error is thrown. In this case a notice
       is issued instead.
      </para>
     </listitem>
@@ -156,6 +157,31 @@ where <replaceable class="PARAMETER">action</replaceable> is one of:
     </listitem>
    </varlistentry>
 
+   <varlistentry>
+    <term><literal>SET STATISTICS DISTINCT</literal></term>
+    <listitem>
+     <para>
+      This form overrides the number-of-distinct-values estimate made by
+      subsequent <xref linkend="sql-analyze" endterm="sql-analyze-title">
+      operations.  When set to a positive value, <command>ANALYZE</> will
+      assume that the column contains exactly the specified number of distinct
+      nonnull values.  When set to a negative value, which must be greater
+      than or equal to -1, <command>ANALYZE</> will assume that the number of
+      distinct nonnull values in the column is linear in the size of the
+      table; the exact count is to be computed by multiplying the estimated
+      table size by the absolute value of the given number.  For example,
+      a value of -1 implies that all values in the column are distinct, while
+      a value of -0.5 implies that each value appears twice on the average.
+      This can be useful when the size of the table changes over time, since
+      the multiplication by the number of rows in the table is not performed
+      until query planning time.  Specify a value of 0 to revert to estimating
+      the number of distinct values normally.  For more information on the use
+      of statistics by the <productname>PostgreSQL</productname> query
+      planner, refer to <xref linkend="planner-stats">.
+     </para>
+    </listitem>
+   </varlistentry>
+
    <varlistentry>
     <indexterm>
      <primary>TOAST</primary>
index 418082e6d931b4f056652bffaf09a703812ba5c5..c0d2673dc50f01d0d6ece91ee1689d3329842233 100644 (file)
@@ -1,5 +1,5 @@
 <!--
-$PostgreSQL: pgsql/doc/src/sgml/ref/analyze.sgml,v 1.25 2008/12/13 19:13:44 tgl Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/analyze.sgml,v 1.26 2009/08/02 22:14:51 tgl Exp $
 PostgreSQL documentation
 -->
 
@@ -165,6 +165,17 @@ ANALYZE [ VERBOSE ] [ <replaceable class="PARAMETER">table</replaceable> [ ( <re
    the target causes a proportional increase in the time and space needed
    to do <command>ANALYZE</command>.
   </para>
+
+  <para>
+   One of the values estimated by <command>ANALYZE</command> is the number of
+   distinct values that appear in each column.  Because only a subset of the
+   rows are examined, this estimate can sometimes be quite inaccurate, even
+   with the largest possible statistics target.  If this inaccuracy leads to
+   bad query plans, a more accurate value can be determined manually and then
+   installed with
+   <command>ALTER TABLE ... ALTER COLUMN ... SET STATISTICS DISTINCT</>
+   (see <xref linkend="sql-altertable" endterm="sql-altertable-title">).
+  </para>
  </refsect1>
 
  <refsect1>
index 0bd50318f6c15d06b96921975d6dd3eeceae1908..9c561beed190ca810c3730224e7861cfc1fe2dda 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/access/common/tupdesc.c,v 1.127 2009/07/16 06:33:42 petere Exp $
+ *       $PostgreSQL: pgsql/src/backend/access/common/tupdesc.c,v 1.128 2009/08/02 22:14:51 tgl Exp $
  *
  * NOTES
  *       some of the executor utility code such as "ExecTypeFromTL" should be
@@ -338,6 +338,8 @@ equalTupleDescs(TupleDesc tupdesc1, TupleDesc tupdesc2)
                        return false;
                if (attr1->attstattarget != attr2->attstattarget)
                        return false;
+               if (attr1->attdistinct != attr2->attdistinct)
+                       return false;
                if (attr1->attlen != attr2->attlen)
                        return false;
                if (attr1->attndims != attr2->attndims)
@@ -465,6 +467,7 @@ TupleDescInitEntry(TupleDesc desc,
                MemSet(NameStr(att->attname), 0, NAMEDATALEN);
 
        att->attstattarget = -1;
+       att->attdistinct = 0;
        att->attcacheoff = -1;
        att->atttypmod = typmod;
 
index ff31e5f040e6972820a8621994e76b4e4dc50725..ac560ee298ddd46b217d481a6d48e1bb90a9bf65 100644 (file)
@@ -8,7 +8,7 @@
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.251 2009/07/31 20:26:22 tgl Exp $
+ *       $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.252 2009/08/02 22:14:51 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -757,6 +757,7 @@ DefineAttr(char *name, char *type, int attnum)
        }
 
        attrtypes[attnum]->attstattarget = -1;
+       attrtypes[attnum]->attdistinct = 0;
        attrtypes[attnum]->attcacheoff = -1;
        attrtypes[attnum]->atttypmod = -1;
        attrtypes[attnum]->attislocal = true;
index 478583a742fb5edc13b22b15a62d5bc6a89b8dd6..010845536825b3892ee0336647c84260792deaa4 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/catalog/heap.c,v 1.356 2009/07/30 02:45:36 tgl Exp $
+ *       $PostgreSQL: pgsql/src/backend/catalog/heap.c,v 1.357 2009/08/02 22:14:52 tgl Exp $
  *
  *
  * INTERFACE ROUTINES
@@ -111,37 +111,37 @@ static List *insert_ordered_unique_oid(List *list, Oid datum);
  */
 
 static FormData_pg_attribute a1 = {
-       0, {"ctid"}, TIDOID, 0, sizeof(ItemPointerData),
+       0, {"ctid"}, TIDOID, 0, 0, sizeof(ItemPointerData),
        SelfItemPointerAttributeNumber, 0, -1, -1,
        false, 'p', 's', true, false, false, true, 0, {0}
 };
 
 static FormData_pg_attribute a2 = {
-       0, {"oid"}, OIDOID, 0, sizeof(Oid),
+       0, {"oid"}, OIDOID, 0, 0, sizeof(Oid),
        ObjectIdAttributeNumber, 0, -1, -1,
        true, 'p', 'i', true, false, false, true, 0, {0}
 };
 
 static FormData_pg_attribute a3 = {
-       0, {"xmin"}, XIDOID, 0, sizeof(TransactionId),
+       0, {"xmin"}, XIDOID, 0, 0, sizeof(TransactionId),
        MinTransactionIdAttributeNumber, 0, -1, -1,
        true, 'p', 'i', true, false, false, true, 0, {0}
 };
 
 static FormData_pg_attribute a4 = {
-       0, {"cmin"}, CIDOID, 0, sizeof(CommandId),
+       0, {"cmin"}, CIDOID, 0, 0, sizeof(CommandId),
        MinCommandIdAttributeNumber, 0, -1, -1,
        true, 'p', 'i', true, false, false, true, 0, {0}
 };
 
 static FormData_pg_attribute a5 = {
-       0, {"xmax"}, XIDOID, 0, sizeof(TransactionId),
+       0, {"xmax"}, XIDOID, 0, 0, sizeof(TransactionId),
        MaxTransactionIdAttributeNumber, 0, -1, -1,
        true, 'p', 'i', true, false, false, true, 0, {0}
 };
 
 static FormData_pg_attribute a6 = {
-       0, {"cmax"}, CIDOID, 0, sizeof(CommandId),
+       0, {"cmax"}, CIDOID, 0, 0, sizeof(CommandId),
        MaxCommandIdAttributeNumber, 0, -1, -1,
        true, 'p', 'i', true, false, false, true, 0, {0}
 };
@@ -153,7 +153,7 @@ static FormData_pg_attribute a6 = {
  * used in SQL.
  */
 static FormData_pg_attribute a7 = {
-       0, {"tableoid"}, OIDOID, 0, sizeof(Oid),
+       0, {"tableoid"}, OIDOID, 0, 0, sizeof(Oid),
        TableOidAttributeNumber, 0, -1, -1,
        true, 'p', 'i', true, false, false, true, 0, {0}
 };
@@ -501,6 +501,7 @@ InsertPgAttributeTuple(Relation pg_attribute_rel,
        values[Anum_pg_attribute_attname - 1] = NameGetDatum(&new_attribute->attname);
        values[Anum_pg_attribute_atttypid - 1] = ObjectIdGetDatum(new_attribute->atttypid);
        values[Anum_pg_attribute_attstattarget - 1] = Int32GetDatum(new_attribute->attstattarget);
+       values[Anum_pg_attribute_attdistinct - 1] = Float4GetDatum(new_attribute->attdistinct);
        values[Anum_pg_attribute_attlen - 1] = Int16GetDatum(new_attribute->attlen);
        values[Anum_pg_attribute_attnum - 1] = Int16GetDatum(new_attribute->attnum);
        values[Anum_pg_attribute_attndims - 1] = Int32GetDatum(new_attribute->attndims);
@@ -571,6 +572,7 @@ AddNewAttributeTuples(Oid new_rel_oid,
                attr->attrelid = new_rel_oid;
                /* Make sure these are OK, too */
                attr->attstattarget = -1;
+               attr->attdistinct = 0;
                attr->attcacheoff = -1;
 
                InsertPgAttributeTuple(rel, attr, indstate);
index 73472d1568eba2f58663cdabb662ec8c345b059d..759950b226528dbad2d32725bf3eb354af61dad1 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/catalog/index.c,v 1.320 2009/07/29 20:56:18 tgl Exp $
+ *       $PostgreSQL: pgsql/src/backend/catalog/index.c,v 1.321 2009/08/02 22:14:52 tgl Exp $
  *
  *
  * INTERFACE ROUTINES
@@ -192,6 +192,7 @@ ConstructTupleDescriptor(Relation heapRelation,
                        to->attnum = i + 1;
 
                        to->attstattarget = -1;
+                       to->attdistinct = 0;
                        to->attcacheoff = -1;
                        to->attnotnull = false;
                        to->atthasdef = false;
index f5e76e2aedde0464aedeb52f0443ea5c2231a006..2a90eeaad93e55a8acc4202582bed28cec248a62 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/commands/analyze.c,v 1.139 2009/06/11 14:48:55 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/commands/analyze.c,v 1.140 2009/08/02 22:14:52 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -425,6 +425,11 @@ analyze_rel(Oid relid, VacuumStmt *vacstmt,
                                                                         std_fetch_func,
                                                                         numrows,
                                                                         totalrows);
+
+                       /* If attdistinct is set, override with that value */
+                       if (stats->attr->attdistinct != 0)
+                               stats->stadistinct = stats->attr->attdistinct;
+
                        MemoryContextResetAndDeleteChildren(col_context);
                }
 
@@ -679,6 +684,9 @@ compute_index_stats(Relation onerel, double totalrows,
                                                                                 ind_fetch_func,
                                                                                 numindexrows,
                                                                                 totalindexrows);
+                               /* If attdistinct is set, override with that value */
+                               if (stats->attr->attdistinct != 0)
+                                       stats->stadistinct = stats->attr->attdistinct;
                                MemoryContextResetAndDeleteChildren(col_context);
                        }
                }
index 53abfec6976c47ba20277816e544ea294f4893d7..1f2d67bcb127741a8beb712e2b19a489d0dc6049 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.294 2009/07/30 02:45:36 tgl Exp $
+ *       $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.295 2009/08/02 22:14:52 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -280,9 +280,13 @@ static void ATExecSetNotNull(AlteredTableInfo *tab, Relation rel,
 static void ATExecColumnDefault(Relation rel, const char *colName,
                                        Node *newDefault);
 static void ATPrepSetStatistics(Relation rel, const char *colName,
-                                       Node *flagValue);
+                                       Node *newValue);
 static void ATExecSetStatistics(Relation rel, const char *colName,
                                        Node *newValue);
+static void ATPrepSetDistinct(Relation rel, const char *colName,
+                                       Node *newValue);
+static void ATExecSetDistinct(Relation rel, const char *colName,
+                                Node *newValue);
 static void ATExecSetStorage(Relation rel, const char *colName,
                                 Node *newValue);
 static void ATExecDropColumn(List **wqueue, Relation rel, const char *colName,
@@ -2399,13 +2403,19 @@ ATPrepCmd(List **wqueue, Relation rel, AlterTableCmd *cmd,
                        /* No command-specific prep needed */
                        pass = AT_PASS_ADD_CONSTR;
                        break;
-               case AT_SetStatistics:  /* ALTER COLUMN STATISTICS */
+               case AT_SetStatistics:  /* ALTER COLUMN SET STATISTICS */
                        ATSimpleRecursion(wqueue, rel, cmd, recurse);
                        /* Performs own permission checks */
                        ATPrepSetStatistics(rel, cmd->name, cmd->def);
                        pass = AT_PASS_COL_ATTRS;
                        break;
-               case AT_SetStorage:             /* ALTER COLUMN STORAGE */
+               case AT_SetDistinct:    /* ALTER COLUMN SET STATISTICS DISTINCT */
+                       ATSimpleRecursion(wqueue, rel, cmd, recurse);
+                       /* Performs own permission checks */
+                       ATPrepSetDistinct(rel, cmd->name, cmd->def);
+                       pass = AT_PASS_COL_ATTRS;
+                       break;
+               case AT_SetStorage:             /* ALTER COLUMN SET STORAGE */
                        ATSimplePermissions(rel, false);
                        ATSimpleRecursion(wqueue, rel, cmd, recurse);
                        /* No command-specific prep needed */
@@ -2616,10 +2626,13 @@ ATExecCmd(List **wqueue, AlteredTableInfo *tab, Relation rel,
                case AT_SetNotNull:             /* ALTER COLUMN SET NOT NULL */
                        ATExecSetNotNull(tab, rel, cmd->name);
                        break;
-               case AT_SetStatistics:  /* ALTER COLUMN STATISTICS */
+               case AT_SetStatistics:  /* ALTER COLUMN SET STATISTICS */
                        ATExecSetStatistics(rel, cmd->name, cmd->def);
                        break;
-               case AT_SetStorage:             /* ALTER COLUMN STORAGE */
+               case AT_SetDistinct:    /* ALTER COLUMN SET STATISTICS DISTINCT */
+                       ATExecSetDistinct(rel, cmd->name, cmd->def);
+                       break;
+               case AT_SetStorage:             /* ALTER COLUMN SET STORAGE */
                        ATExecSetStorage(rel, cmd->name, cmd->def);
                        break;
                case AT_DropColumn:             /* DROP COLUMN */
@@ -3620,6 +3633,7 @@ ATExecAddColumn(AlteredTableInfo *tab, Relation rel,
        namestrcpy(&(attribute.attname), colDef->colname);
        attribute.atttypid = typeOid;
        attribute.attstattarget = (newattnum > 0) ? -1 : 0;
+       attribute.attdistinct = 0;
        attribute.attlen = tform->typlen;
        attribute.attcacheoff = -1;
        attribute.atttypmod = typmod;
@@ -4007,7 +4021,7 @@ ATExecColumnDefault(Relation rel, const char *colName,
  * ALTER TABLE ALTER COLUMN SET STATISTICS
  */
 static void
-ATPrepSetStatistics(Relation rel, const char *colName, Node *flagValue)
+ATPrepSetStatistics(Relation rel, const char *colName, Node *newValue)
 {
        /*
         * We do our own permission checking because (a) we want to allow SET
@@ -4087,6 +4101,94 @@ ATExecSetStatistics(Relation rel, const char *colName, Node *newValue)
        heap_close(attrelation, RowExclusiveLock);
 }
 
+/*
+ * ALTER TABLE ALTER COLUMN SET STATISTICS DISTINCT
+ */
+static void
+ATPrepSetDistinct(Relation rel, const char *colName, Node *newValue)
+{
+       /*
+        * We do our own permission checking because (a) we want to allow SET
+        * DISTINCT on indexes (for expressional index columns), and (b) we want
+        * to allow SET DISTINCT on system catalogs without requiring
+        * allowSystemTableMods to be turned on.
+        */
+       if (rel->rd_rel->relkind != RELKIND_RELATION &&
+               rel->rd_rel->relkind != RELKIND_INDEX)
+               ereport(ERROR,
+                               (errcode(ERRCODE_WRONG_OBJECT_TYPE),
+                                errmsg("\"%s\" is not a table or index",
+                                               RelationGetRelationName(rel))));
+
+       /* Permissions checks */
+       if (!pg_class_ownercheck(RelationGetRelid(rel), GetUserId()))
+               aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_CLASS,
+                                          RelationGetRelationName(rel));
+}
+
+static void
+ATExecSetDistinct(Relation rel, const char *colName, Node *newValue)
+{
+       float4          newdistinct;
+       Relation        attrelation;
+       HeapTuple       tuple;
+       Form_pg_attribute attrtuple;
+
+       switch (nodeTag(newValue))
+       {
+               case T_Integer:
+                       newdistinct = intVal(newValue);
+                       break;
+               case T_Float:
+                       newdistinct = floatVal(newValue);
+                       break;
+               default:
+                       elog(ERROR, "unrecognized node type: %d",
+                                (int) nodeTag(newValue));
+                       newdistinct = 0;        /* keep compiler quiet */
+                       break;
+       }
+
+       /*
+        * Limit ndistinct to sane values
+        */
+       if (newdistinct < -1.0)
+       {
+               ereport(ERROR,
+                               (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+                                errmsg("number of distinct values %g is too low",
+                                               newdistinct)));
+       }
+
+       attrelation = heap_open(AttributeRelationId, RowExclusiveLock);
+
+       tuple = SearchSysCacheCopyAttName(RelationGetRelid(rel), colName);
+
+       if (!HeapTupleIsValid(tuple))
+               ereport(ERROR,
+                               (errcode(ERRCODE_UNDEFINED_COLUMN),
+                                errmsg("column \"%s\" of relation \"%s\" does not exist",
+                                               colName, RelationGetRelationName(rel))));
+       attrtuple = (Form_pg_attribute) GETSTRUCT(tuple);
+
+       if (attrtuple->attnum <= 0)
+               ereport(ERROR,
+                               (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+                                errmsg("cannot alter system column \"%s\"",
+                                               colName)));
+
+       attrtuple->attdistinct = newdistinct;
+
+       simple_heap_update(attrelation, &tuple->t_self, tuple);
+
+       /* keep system catalog indexes current */
+       CatalogUpdateIndexes(attrelation, tuple);
+
+       heap_freetuple(tuple);
+
+       heap_close(attrelation, RowExclusiveLock);
+}
+
 /*
  * ALTER TABLE ALTER COLUMN SET STORAGE
  */
index 543aea9928369021b4b597492519421cebd92909..6e52d3bcbd37ac42ef2ace2b04bd11bc71aabe00 100644 (file)
@@ -11,7 +11,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.675 2009/07/30 02:45:37 tgl Exp $
+ *       $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.676 2009/08/02 22:14:52 tgl Exp $
  *
  * HISTORY
  *       AUTHOR                        DATE                    MAJOR EVENT
@@ -1605,6 +1605,15 @@ alter_table_cmd:
                                        n->def = (Node *) makeInteger($6);
                                        $$ = (Node *)n;
                                }
+                       /* ALTER TABLE <name> ALTER [COLUMN] <colname> SET STATISTICS DISTINCT <NumericOnly> */
+                       | ALTER opt_column ColId SET STATISTICS DISTINCT NumericOnly
+                               {
+                                       AlterTableCmd *n = makeNode(AlterTableCmd);
+                                       n->subtype = AT_SetDistinct;
+                                       n->name = $3;
+                                       n->def = (Node *) $7;
+                                       $$ = (Node *)n;
+                               }
                        /* ALTER TABLE <name> ALTER [COLUMN] <colname> SET STORAGE <storagemode> */
                        | ALTER opt_column ColId SET STORAGE ColId
                                {
index b1883efe755c5db3e77f6ee6562c27f8a60b3d03..360eaf1caf72027ef0d7a0f1d49d13aec4efdb5f 100644 (file)
@@ -12,7 +12,7 @@
  *     by PostgreSQL
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.543 2009/07/29 20:56:19 tgl Exp $
+ *       $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.544 2009/08/02 22:14:52 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -4707,6 +4707,7 @@ getTableAttrs(TableInfo *tblinfo, int numTables)
        int                     i_atttypname;
        int                     i_atttypmod;
        int                     i_attstattarget;
+       int                     i_attdistinct;
        int                     i_attstorage;
        int                     i_typstorage;
        int                     i_attnotnull;
@@ -4752,11 +4753,28 @@ getTableAttrs(TableInfo *tblinfo, int numTables)
 
                resetPQExpBuffer(q);
 
-               if (g_fout->remoteVersion >= 70300)
+               if (g_fout->remoteVersion >= 80500)
+               {
+                       /* attdistinct is new in 8.5 */
+                       appendPQExpBuffer(q, "SELECT a.attnum, a.attname, a.atttypmod, "
+                                                         "a.attstattarget, a.attdistinct, "
+                                                         "a.attstorage, t.typstorage, "
+                                                         "a.attnotnull, a.atthasdef, a.attisdropped, "
+                                                         "a.attlen, a.attalign, a.attislocal, "
+                                  "pg_catalog.format_type(t.oid,a.atttypmod) AS atttypname "
+                        "FROM pg_catalog.pg_attribute a LEFT JOIN pg_catalog.pg_type t "
+                                                         "ON a.atttypid = t.oid "
+                                                         "WHERE a.attrelid = '%u'::pg_catalog.oid "
+                                                         "AND a.attnum > 0::pg_catalog.int2 "
+                                                         "ORDER BY a.attrelid, a.attnum",
+                                                         tbinfo->dobj.catId.oid);
+               }
+               else if (g_fout->remoteVersion >= 70300)
                {
                        /* need left join here to not fail on dropped columns ... */
                        appendPQExpBuffer(q, "SELECT a.attnum, a.attname, a.atttypmod, "
-                                                         "a.attstattarget, a.attstorage, t.typstorage, "
+                                                         "a.attstattarget, 0 AS attdistinct, "
+                                                         "a.attstorage, t.typstorage, "
                                                          "a.attnotnull, a.atthasdef, a.attisdropped, "
                                                          "a.attlen, a.attalign, a.attislocal, "
                                   "pg_catalog.format_type(t.oid,a.atttypmod) AS atttypname "
@@ -4774,8 +4792,9 @@ getTableAttrs(TableInfo *tblinfo, int numTables)
                         * we don't dump it because we can't tell whether it's been
                         * explicitly set or was just a default.
                         */
-                       appendPQExpBuffer(q, "SELECT a.attnum, a.attname, "
-                                                  "a.atttypmod, -1 AS attstattarget, a.attstorage, "
+                       appendPQExpBuffer(q, "SELECT a.attnum, a.attname, a.atttypmod, "
+                                                         "-1 AS attstattarget, 0 AS attdistinct, "
+                                                         "a.attstorage, "
                                                          "t.typstorage, a.attnotnull, a.atthasdef, "
                                                          "false AS attisdropped, a.attlen, "
                                                          "a.attalign, false AS attislocal, "
@@ -4791,8 +4810,8 @@ getTableAttrs(TableInfo *tblinfo, int numTables)
                {
                        /* format_type not available before 7.1 */
                        appendPQExpBuffer(q, "SELECT attnum, attname, atttypmod, "
-                                                         "-1 AS attstattarget, attstorage, "
-                                                         "attstorage AS typstorage, "
+                                                         "-1 AS attstattarget, 0 AS attdistinct, "
+                                                         "attstorage, attstorage AS typstorage, "
                                                          "attnotnull, atthasdef, false AS attisdropped, "
                                                          "attlen, attalign, "
                                                          "false AS attislocal, "
@@ -4814,6 +4833,7 @@ getTableAttrs(TableInfo *tblinfo, int numTables)
                i_atttypname = PQfnumber(res, "atttypname");
                i_atttypmod = PQfnumber(res, "atttypmod");
                i_attstattarget = PQfnumber(res, "attstattarget");
+               i_attdistinct = PQfnumber(res, "attdistinct");
                i_attstorage = PQfnumber(res, "attstorage");
                i_typstorage = PQfnumber(res, "typstorage");
                i_attnotnull = PQfnumber(res, "attnotnull");
@@ -4828,6 +4848,7 @@ getTableAttrs(TableInfo *tblinfo, int numTables)
                tbinfo->atttypnames = (char **) malloc(ntups * sizeof(char *));
                tbinfo->atttypmod = (int *) malloc(ntups * sizeof(int));
                tbinfo->attstattarget = (int *) malloc(ntups * sizeof(int));
+               tbinfo->attdistinct = (float4 *) malloc(ntups * sizeof(float4));
                tbinfo->attstorage = (char *) malloc(ntups * sizeof(char));
                tbinfo->typstorage = (char *) malloc(ntups * sizeof(char));
                tbinfo->attisdropped = (bool *) malloc(ntups * sizeof(bool));
@@ -4853,6 +4874,8 @@ getTableAttrs(TableInfo *tblinfo, int numTables)
                        tbinfo->atttypnames[j] = strdup(PQgetvalue(res, j, i_atttypname));
                        tbinfo->atttypmod[j] = atoi(PQgetvalue(res, j, i_atttypmod));
                        tbinfo->attstattarget[j] = atoi(PQgetvalue(res, j, i_attstattarget));
+                       tbinfo->attdistinct[j] = strtod(PQgetvalue(res, j, i_attdistinct),
+                                                                                       (char **) NULL);
                        tbinfo->attstorage[j] = *(PQgetvalue(res, j, i_attstorage));
                        tbinfo->typstorage[j] = *(PQgetvalue(res, j, i_typstorage));
                        tbinfo->attisdropped[j] = (PQgetvalue(res, j, i_attisdropped)[0] == 't');
@@ -10189,6 +10212,22 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo)
                                                                  tbinfo->attstattarget[j]);
                        }
 
+                       /*
+                        * Dump per-column ndistinct information. We only issue an ALTER
+                        * TABLE statement if the attdistinct entry for this column is
+                        * non-zero (i.e. it's not the default value)
+                        */
+                       if (tbinfo->attdistinct[j] != 0 &&
+                               !tbinfo->attisdropped[j])
+                       {
+                               appendPQExpBuffer(q, "ALTER TABLE ONLY %s ",
+                                                                 fmtId(tbinfo->dobj.name));
+                               appendPQExpBuffer(q, "ALTER COLUMN %s ",
+                                                                 fmtId(tbinfo->attnames[j]));
+                               appendPQExpBuffer(q, "SET STATISTICS DISTINCT %g;\n", 
+                                                                 tbinfo->attdistinct[j]);
+                       }
+
                        /*
                         * Dump per-column storage information.  The statement is only
                         * dumped if the storage has been changed from the type's default.
index b6702cf5186009d4d066c64655055644053e7986..6b84d59723dbe8506e8189dd03a425b71065501c 100644 (file)
@@ -6,7 +6,7 @@
  * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.h,v 1.155 2009/07/29 20:56:19 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.h,v 1.156 2009/08/02 22:14:52 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -243,6 +243,7 @@ typedef struct _tableInfo
        char      **atttypnames;        /* attribute type names */
        int                *atttypmod;          /* type-specific type modifiers */
        int                *attstattarget;      /* attribute statistics targets */
+       float4     *attdistinct;        /* override ndistinct calculation */
        char       *attstorage;         /* attribute storage scheme */
        char       *typstorage;         /* type storage scheme */
        bool       *attisdropped;       /* true if attr is dropped; don't dump it */
index 6af3f2f1ea626124362bfb5c4d7d5b9063ec33d5..ef418bdcab857757e56bdda03aa43663a7ae345a 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2000-2009, PostgreSQL Global Development Group
  *
- * $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.184 2009/06/11 14:49:08 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.185 2009/08/02 22:14:52 tgl Exp $
  */
 
 /*----------------------------------------------------------------------
@@ -674,12 +674,10 @@ psql_completion(char *text, int start, int end)
        else if (pg_strcasecmp(prev_wd, "CREATE") == 0)
                matches = completion_matches(text, create_command_generator);
 
-/* DROP, except ALTER (TABLE|DOMAIN|GROUP) sth DROP */
+/* DROP, but watch out for DROP embedded in other commands */
        /* complete with something you can drop */
        else if (pg_strcasecmp(prev_wd, "DROP") == 0 &&
-                        pg_strcasecmp(prev3_wd, "TABLE") != 0 &&
-                        pg_strcasecmp(prev3_wd, "DOMAIN") != 0 &&
-                        pg_strcasecmp(prev3_wd, "GROUP") != 0)
+                        pg_strcasecmp(prev2_wd, "DROP") == 0)
                matches = completion_matches(text, drop_command_generator);
 
 /* ALTER */
@@ -967,13 +965,44 @@ psql_completion(char *text, int start, int end)
                         (pg_strcasecmp(prev4_wd, "TABLE") == 0 &&
                          pg_strcasecmp(prev2_wd, "ALTER") == 0))
        {
-               /* DROP ... does not work well yet */
                static const char *const list_COLUMNALTER[] =
-               {"TYPE", "SET DEFAULT", "DROP DEFAULT", "SET NOT NULL",
-               "DROP NOT NULL", "SET STATISTICS", "SET STORAGE", NULL};
+               {"TYPE", "SET", "DROP", NULL};
 
                COMPLETE_WITH_LIST(list_COLUMNALTER);
        }
+       else if (((pg_strcasecmp(prev4_wd, "ALTER") == 0 &&
+                          pg_strcasecmp(prev3_wd, "COLUMN") == 0) ||
+                         (pg_strcasecmp(prev5_wd, "TABLE") == 0 &&
+                          pg_strcasecmp(prev3_wd, "ALTER") == 0)) &&
+                        pg_strcasecmp(prev_wd, "SET") == 0)
+       {
+               static const char *const list_COLUMNSET[] =
+               {"DEFAULT", "NOT NULL", "STATISTICS", "STORAGE", NULL};
+
+               COMPLETE_WITH_LIST(list_COLUMNSET);
+       }
+       else if (((pg_strcasecmp(prev5_wd, "ALTER") == 0 &&
+                          pg_strcasecmp(prev4_wd, "COLUMN") == 0) ||
+                         pg_strcasecmp(prev4_wd, "ALTER") == 0) &&
+                        pg_strcasecmp(prev2_wd, "SET") == 0 &&
+                        pg_strcasecmp(prev_wd, "STATISTICS") == 0)
+       {
+               static const char *const list_COLUMNSETSTATS[] =
+               {"DISTINCT", NULL};
+
+               COMPLETE_WITH_LIST(list_COLUMNSETSTATS);
+       }
+       else if (((pg_strcasecmp(prev4_wd, "ALTER") == 0 &&
+                          pg_strcasecmp(prev3_wd, "COLUMN") == 0) ||
+                         (pg_strcasecmp(prev5_wd, "TABLE") == 0 &&
+                          pg_strcasecmp(prev3_wd, "ALTER") == 0)) &&
+                        pg_strcasecmp(prev_wd, "DROP") == 0)
+       {
+               static const char *const list_COLUMNDROP[] =
+               {"DEFAULT", "NOT NULL", NULL};
+
+               COMPLETE_WITH_LIST(list_COLUMNDROP);
+       }
        else if (pg_strcasecmp(prev3_wd, "TABLE") == 0 &&
                         pg_strcasecmp(prev_wd, "CLUSTER") == 0)
                COMPLETE_WITH_CONST("ON");
index 847362ad273ea0cc9da477a722b5240e770ce85f..dc1b41d06bbcfcfd4b1231a3984998a6f00f02f8 100644 (file)
@@ -37,7 +37,7 @@
  * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.534 2009/07/29 20:56:19 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.535 2009/08/02 22:14:52 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -53,6 +53,6 @@
  */
 
 /*                                                     yyyymmddN */
-#define CATALOG_VERSION_NO     200907291
+#define CATALOG_VERSION_NO     200908021
 
 #endif
index e1c6fc83731b71cd56ac2b8e6463bc503d3c70c0..ce6da9acdf49fbfcc6590d71c7e6b9d697472f6a 100644 (file)
@@ -8,7 +8,7 @@
  * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/include/catalog/pg_attribute.h,v 1.149 2009/07/29 20:56:20 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_attribute.h,v 1.150 2009/08/02 22:14:52 tgl Exp $
  *
  * NOTES
  *       the genbki.sh script reads this file and generates .bki
@@ -59,6 +59,13 @@ CATALOG(pg_attribute,1249) BKI_BOOTSTRAP BKI_WITHOUT_OIDS
         */
        int4            attstattarget;
 
+       /*
+        * attdistinct, if nonzero, is a user-specified ndistinct value to be used
+        * instead of estimating the number of distinct values during ANALYZE.
+        * Nonzero values have the same meanings as for pg_statistic.stadistinct.
+        */
+       float4          attdistinct;
+
        /*
         * attlen is a copy of the typlen field from pg_type for this attribute.
         * See atttypid comments above.
@@ -176,25 +183,26 @@ typedef FormData_pg_attribute *Form_pg_attribute;
  * ----------------
  */
 
-#define Natts_pg_attribute                             18
+#define Natts_pg_attribute                             19
 #define Anum_pg_attribute_attrelid             1
 #define Anum_pg_attribute_attname              2
 #define Anum_pg_attribute_atttypid             3
 #define Anum_pg_attribute_attstattarget 4
-#define Anum_pg_attribute_attlen               5
-#define Anum_pg_attribute_attnum               6
-#define Anum_pg_attribute_attndims             7
-#define Anum_pg_attribute_attcacheoff  8
-#define Anum_pg_attribute_atttypmod            9
-#define Anum_pg_attribute_attbyval             10
-#define Anum_pg_attribute_attstorage   11
-#define Anum_pg_attribute_attalign             12
-#define Anum_pg_attribute_attnotnull   13
-#define Anum_pg_attribute_atthasdef            14
-#define Anum_pg_attribute_attisdropped 15
-#define Anum_pg_attribute_attislocal   16
-#define Anum_pg_attribute_attinhcount  17
-#define Anum_pg_attribute_attacl               18
+#define Anum_pg_attribute_attdistinct  5
+#define Anum_pg_attribute_attlen               6
+#define Anum_pg_attribute_attnum               7
+#define Anum_pg_attribute_attndims             8
+#define Anum_pg_attribute_attcacheoff  9
+#define Anum_pg_attribute_atttypmod            10
+#define Anum_pg_attribute_attbyval             11
+#define Anum_pg_attribute_attstorage   12
+#define Anum_pg_attribute_attalign             13
+#define Anum_pg_attribute_attnotnull   14
+#define Anum_pg_attribute_atthasdef            15
+#define Anum_pg_attribute_attisdropped 16
+#define Anum_pg_attribute_attislocal   17
+#define Anum_pg_attribute_attinhcount  18
+#define Anum_pg_attribute_attacl               19
 
 
 /* ----------------
@@ -212,248 +220,250 @@ typedef FormData_pg_attribute *Form_pg_attribute;
  * ----------------
  */
 #define Schema_pg_type \
-{ 1247, {"typname"},      19, -1, NAMEDATALEN, 1, 0, -1, -1, false, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 1247, {"typnamespace"},  26, -1,     4,      2, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1247, {"typowner"},     26, -1,      4,      3, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1247, {"typlen"},               21, -1,      2,      4, 0, -1, -1, true, 'p', 's', true, false, false, true, 0, { 0 } }, \
-{ 1247, {"typbyval"},     16, -1,      1,      5, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 1247, {"typtype"},      18, -1,      1,      6, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 1247, {"typcategory"},   18, -1,     1,      7, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 1247, {"typispreferred"},16, -1,     1,      8, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 1247, {"typisdefined"},  16, -1,     1,      9, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 1247, {"typdelim"},     18, -1,      1, 10, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 1247, {"typrelid"},     26, -1,      4, 11, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1247, {"typelem"},      26, -1,      4, 12, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1247, {"typarray"},     26, -1,      4, 13, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1247, {"typinput"},     24, -1,      4, 14, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1247, {"typoutput"},    24, -1,      4, 15, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1247, {"typreceive"},    24, -1,     4, 16, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1247, {"typsend"},      24, -1,      4, 17, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1247, {"typmodin"},     24, -1,      4, 18, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1247, {"typmodout"},    24, -1,      4, 19, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1247, {"typanalyze"},    24, -1,     4, 20, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1247, {"typalign"},     18, -1,      1, 21, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 1247, {"typstorage"},    18, -1,     1, 22, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 1247, {"typnotnull"},    16, -1,     1, 23, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 1247, {"typbasetype"},   26, -1,     4, 24, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1247, {"typtypmod"},    23, -1,      4, 25, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1247, {"typndims"},     23, -1,      4, 26, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1247, {"typdefaultbin"}, 25, -1, -1, 27, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
-{ 1247, {"typdefault"},    25, -1, -1, 28, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }
-
-DATA(insert ( 1247 typname                     19 -1 NAMEDATALEN       1 0 -1 -1 f p c t f f t 0 _null_));
-DATA(insert ( 1247 typnamespace                26 -1 4   2 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1247 typowner                    26 -1 4   3 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1247 typlen                      21 -1 2   4 0 -1 -1 t p s t f f t 0 _null_));
-DATA(insert ( 1247 typbyval                    16 -1 1   5 0 -1 -1 t p c t f f t 0 _null_));
-DATA(insert ( 1247 typtype                     18 -1 1   6 0 -1 -1 t p c t f f t 0 _null_));
-DATA(insert ( 1247 typcategory         18 -1 1   7 0 -1 -1 t p c t f f t 0 _null_));
-DATA(insert ( 1247 typispreferred      16 -1 1   8 0 -1 -1 t p c t f f t 0 _null_));
-DATA(insert ( 1247 typisdefined                16 -1 1   9 0 -1 -1 t p c t f f t 0 _null_));
-DATA(insert ( 1247 typdelim                    18 -1 1  10 0 -1 -1 t p c t f f t 0 _null_));
-DATA(insert ( 1247 typrelid                    26 -1 4  11 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1247 typelem                     26 -1 4  12 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1247 typarray                    26 -1 4  13 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1247 typinput                    24 -1 4  14 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1247 typoutput           24 -1 4  15 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1247 typreceive          24 -1 4  16 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1247 typsend                     24 -1 4  17 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1247 typmodin                    24 -1 4  18 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1247 typmodout           24 -1 4  19 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1247 typanalyze          24 -1 4  20 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1247 typalign                    18 -1 1  21 0 -1 -1 t p c t f f t 0 _null_));
-DATA(insert ( 1247 typstorage          18 -1 1  22 0 -1 -1 t p c t f f t 0 _null_));
-DATA(insert ( 1247 typnotnull          16 -1 1  23 0 -1 -1 t p c t f f t 0 _null_));
-DATA(insert ( 1247 typbasetype         26 -1 4  24 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1247 typtypmod           23 -1 4  25 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1247 typndims                    23 -1 4  26 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1247 typdefaultbin       25 -1 -1 27 0 -1 -1 f x i f f f t 0 _null_));
-DATA(insert ( 1247 typdefault          25 -1 -1 28 0 -1 -1 f x i f f f t 0 _null_));
-DATA(insert ( 1247 ctid                                27 0  6  -1 0 -1 -1 f p s t f f t 0 _null_));
-DATA(insert ( 1247 oid                         26 0  4  -2 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1247 xmin                                28 0  4  -3 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1247 cmin                                29 0  4  -4 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1247 xmax                                28 0  4  -5 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1247 cmax                                29 0  4  -6 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1247 tableoid                    26 0  4  -7 0 -1 -1 t p i t f f t 0 _null_));
+{ 1247, {"typname"},      19, -1, 0, NAMEDATALEN, 1, 0, -1, -1, false, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 1247, {"typnamespace"},  26, -1, 0,  4,      2, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1247, {"typowner"},     26, -1, 0,   4,      3, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1247, {"typlen"},               21, -1, 0,   2,      4, 0, -1, -1, true, 'p', 's', true, false, false, true, 0, { 0 } }, \
+{ 1247, {"typbyval"},     16, -1, 0,   1,      5, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 1247, {"typtype"},      18, -1, 0,   1,      6, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 1247, {"typcategory"},   18, -1, 0,  1,      7, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 1247, {"typispreferred"},16, -1, 0,  1,      8, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 1247, {"typisdefined"},  16, -1, 0,  1,      9, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 1247, {"typdelim"},     18, -1, 0,   1, 10, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 1247, {"typrelid"},     26, -1, 0,   4, 11, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1247, {"typelem"},      26, -1, 0,   4, 12, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1247, {"typarray"},     26, -1, 0,   4, 13, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1247, {"typinput"},     24, -1, 0,   4, 14, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1247, {"typoutput"},    24, -1, 0,   4, 15, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1247, {"typreceive"},    24, -1, 0,  4, 16, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1247, {"typsend"},      24, -1, 0,   4, 17, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1247, {"typmodin"},     24, -1, 0,   4, 18, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1247, {"typmodout"},    24, -1, 0,   4, 19, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1247, {"typanalyze"},    24, -1, 0,  4, 20, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1247, {"typalign"},     18, -1, 0,   1, 21, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 1247, {"typstorage"},    18, -1, 0,  1, 22, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 1247, {"typnotnull"},    16, -1, 0,  1, 23, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 1247, {"typbasetype"},   26, -1, 0,  4, 24, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1247, {"typtypmod"},    23, -1, 0,   4, 25, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1247, {"typndims"},     23, -1, 0,   4, 26, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1247, {"typdefaultbin"}, 25, -1, 0, -1, 27, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
+{ 1247, {"typdefault"},    25, -1, 0, -1, 28, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }
+
+DATA(insert ( 1247 typname                     19 -1 0 NAMEDATALEN     1 0 -1 -1 f p c t f f t 0 _null_));
+DATA(insert ( 1247 typnamespace                26 -1 4   2 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1247 typowner                    26 -1 4   3 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1247 typlen                      21 -1 2   4 0 -1 -1 t p s t f f t 0 _null_));
+DATA(insert ( 1247 typbyval                    16 -1 1   5 0 -1 -1 t p c t f f t 0 _null_));
+DATA(insert ( 1247 typtype                     18 -1 1   6 0 -1 -1 t p c t f f t 0 _null_));
+DATA(insert ( 1247 typcategory         18 -1 1   7 0 -1 -1 t p c t f f t 0 _null_));
+DATA(insert ( 1247 typispreferred      16 -1 1   8 0 -1 -1 t p c t f f t 0 _null_));
+DATA(insert ( 1247 typisdefined                16 -1 1   9 0 -1 -1 t p c t f f t 0 _null_));
+DATA(insert ( 1247 typdelim                    18 -1 1  10 0 -1 -1 t p c t f f t 0 _null_));
+DATA(insert ( 1247 typrelid                    26 -1 4  11 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1247 typelem                     26 -1 4  12 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1247 typarray                    26 -1 4  13 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1247 typinput                    24 -1 4  14 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1247 typoutput           24 -1 4  15 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1247 typreceive          24 -1 4  16 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1247 typsend                     24 -1 4  17 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1247 typmodin                    24 -1 4  18 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1247 typmodout           24 -1 4  19 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1247 typanalyze          24 -1 4  20 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1247 typalign                    18 -1 1  21 0 -1 -1 t p c t f f t 0 _null_));
+DATA(insert ( 1247 typstorage          18 -1 1  22 0 -1 -1 t p c t f f t 0 _null_));
+DATA(insert ( 1247 typnotnull          16 -1 1  23 0 -1 -1 t p c t f f t 0 _null_));
+DATA(insert ( 1247 typbasetype         26 -1 4  24 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1247 typtypmod           23 -1 4  25 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1247 typndims                    23 -1 4  26 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1247 typdefaultbin       25 -1 -1 27 0 -1 -1 f x i f f f t 0 _null_));
+DATA(insert ( 1247 typdefault          25 -1 -1 28 0 -1 -1 f x i f f f t 0 _null_));
+DATA(insert ( 1247 ctid                                27 0  6  -1 0 -1 -1 f p s t f f t 0 _null_));
+DATA(insert ( 1247 oid                         26 0  4  -2 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1247 xmin                                28 0  4  -3 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1247 cmin                                29 0  4  -4 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1247 xmax                                28 0  4  -5 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1247 cmax                                29 0  4  -6 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1247 tableoid                    26 0  4  -7 0 -1 -1 t p i t f f t 0 _null_));
 
 /* ----------------
  *             pg_proc
  * ----------------
  */
 #define Schema_pg_proc \
-{ 1255, {"proname"},                   19, -1, NAMEDATALEN,  1, 0, -1, -1, false, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 1255, {"pronamespace"},              26, -1, 4,      2, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1255, {"proowner"},                  26, -1, 4,      3, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1255, {"prolang"},                   26, -1, 4,      4, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1255, {"procost"},              700, -1, 4,  5, 0, -1, -1, FLOAT4PASSBYVAL, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1255, {"prorows"},              700, -1, 4,  6, 0, -1, -1, FLOAT4PASSBYVAL, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1255, {"provariadic"},               26, -1, 4,      7, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1255, {"proisagg"},                  16, -1, 1,      8, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 1255, {"proiswindow"},               16, -1, 1,      9, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 1255, {"prosecdef"},                 16, -1, 1, 10, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 1255, {"proisstrict"},               16, -1, 1, 11, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 1255, {"proretset"},                 16, -1, 1, 12, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 1255, {"provolatile"},               18, -1, 1, 13, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 1255, {"pronargs"},                  21, -1, 2, 14, 0, -1, -1, true, 'p', 's', true, false, false, true, 0, { 0 } }, \
-{ 1255, {"pronargdefaults"},   21, -1, 2, 15, 0, -1, -1, true, 'p', 's', true, false, false, true, 0, { 0 } }, \
-{ 1255, {"prorettype"},                        26, -1, 4, 16, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1255, {"proargtypes"},               30, -1, -1, 17, 1, -1, -1, false, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1255, {"proallargtypes"},   1028, -1, -1, 18, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
-{ 1255, {"proargmodes"},         1002, -1, -1, 19, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
-{ 1255, {"proargnames"},         1009, -1, -1, 20, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
-{ 1255, {"proargdefaults"},            25, -1, -1, 21, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
-{ 1255, {"prosrc"},                            25, -1, -1, 22, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
-{ 1255, {"probin"},                            17, -1, -1, 23, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
-{ 1255, {"proconfig"},           1009, -1, -1, 24, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
-{ 1255, {"proacl"},                      1034, -1, -1, 25, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }
-
-DATA(insert ( 1255 proname                     19 -1 NAMEDATALEN       1 0 -1 -1 f p c t f f t 0 _null_));
-DATA(insert ( 1255 pronamespace                26 -1 4   2 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1255 proowner                    26 -1 4   3 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1255 prolang                     26 -1 4   4 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1255 procost                700 -1 4   5 0 -1 -1 FLOAT4PASSBYVAL p i t f f t 0 _null_));
-DATA(insert ( 1255 prorows                700 -1 4   6 0 -1 -1 FLOAT4PASSBYVAL p i t f f t 0 _null_));
-DATA(insert ( 1255 provariadic         26 -1 4   7 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1255 proisagg                    16 -1 1   8 0 -1 -1 t p c t f f t 0 _null_));
-DATA(insert ( 1255 proiswindow         16 -1 1   9 0 -1 -1 t p c t f f t 0 _null_));
-DATA(insert ( 1255 prosecdef           16 -1 1  10 0 -1 -1 t p c t f f t 0 _null_));
-DATA(insert ( 1255 proisstrict         16 -1 1  11 0 -1 -1 t p c t f f t 0 _null_));
-DATA(insert ( 1255 proretset           16 -1 1  12 0 -1 -1 t p c t f f t 0 _null_));
-DATA(insert ( 1255 provolatile         18 -1 1  13 0 -1 -1 t p c t f f t 0 _null_));
-DATA(insert ( 1255 pronargs                    21 -1 2  14 0 -1 -1 t p s t f f t 0 _null_));
-DATA(insert ( 1255 pronargdefaults     21 -1 2  15 0 -1 -1 t p s t f f t 0 _null_));
-DATA(insert ( 1255 prorettype          26 -1 4  16 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1255 proargtypes         30 -1 -1 17 1 -1 -1 f p i t f f t 0 _null_));
-DATA(insert ( 1255 proallargtypes 1028 -1 -1 18 1 -1 -1 f x i f f f t 0 _null_));
-DATA(insert ( 1255 proargmodes   1002 -1 -1 19 1 -1 -1 f x i f f f t 0 _null_));
-DATA(insert ( 1255 proargnames   1009 -1 -1 20 1 -1 -1 f x i f f f t 0 _null_));
-DATA(insert ( 1255 proargdefaults      25 -1 -1 21 0 -1 -1 f x i f f f t 0 _null_));
-DATA(insert ( 1255 prosrc                      25 -1 -1 22 0 -1 -1 f x i f f f t 0 _null_));
-DATA(insert ( 1255 probin                      17 -1 -1 23 0 -1 -1 f x i f f f t 0 _null_));
-DATA(insert ( 1255 proconfig     1009 -1 -1 24 1 -1 -1 f x i f f f t 0 _null_));
-DATA(insert ( 1255 proacl                1034 -1 -1 25 1 -1 -1 f x i f f f t 0 _null_));
-DATA(insert ( 1255 ctid                                27 0  6  -1 0 -1 -1 f p s t f f t 0 _null_));
-DATA(insert ( 1255 oid                         26 0  4  -2 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1255 xmin                                28 0  4  -3 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1255 cmin                                29 0  4  -4 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1255 xmax                                28 0  4  -5 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1255 cmax                                29 0  4  -6 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1255 tableoid                    26 0  4  -7 0 -1 -1 t p i t f f t 0 _null_));
+{ 1255, {"proname"},                   19, -1, 0, NAMEDATALEN,  1, 0, -1, -1, false, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 1255, {"pronamespace"},              26, -1, 0, 4,   2, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1255, {"proowner"},                  26, -1, 0, 4,   3, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1255, {"prolang"},                   26, -1, 0, 4,   4, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1255, {"procost"},              700, -1, 0, 4,       5, 0, -1, -1, FLOAT4PASSBYVAL, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1255, {"prorows"},              700, -1, 0, 4,       6, 0, -1, -1, FLOAT4PASSBYVAL, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1255, {"provariadic"},               26, -1, 0, 4,   7, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1255, {"proisagg"},                  16, -1, 0, 1,   8, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 1255, {"proiswindow"},               16, -1, 0, 1,   9, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 1255, {"prosecdef"},                 16, -1, 0, 1, 10, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 1255, {"proisstrict"},               16, -1, 0, 1, 11, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 1255, {"proretset"},                 16, -1, 0, 1, 12, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 1255, {"provolatile"},               18, -1, 0, 1, 13, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 1255, {"pronargs"},                  21, -1, 0, 2, 14, 0, -1, -1, true, 'p', 's', true, false, false, true, 0, { 0 } }, \
+{ 1255, {"pronargdefaults"},   21, -1, 0, 2, 15, 0, -1, -1, true, 'p', 's', true, false, false, true, 0, { 0 } }, \
+{ 1255, {"prorettype"},                        26, -1, 0, 4, 16, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1255, {"proargtypes"},               30, -1, 0, -1, 17, 1, -1, -1, false, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1255, {"proallargtypes"},   1028, -1, 0, -1, 18, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
+{ 1255, {"proargmodes"},         1002, -1, 0, -1, 19, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
+{ 1255, {"proargnames"},         1009, -1, 0, -1, 20, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
+{ 1255, {"proargdefaults"},            25, -1, 0, -1, 21, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
+{ 1255, {"prosrc"},                            25, -1, 0, -1, 22, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
+{ 1255, {"probin"},                            17, -1, 0, -1, 23, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
+{ 1255, {"proconfig"},           1009, -1, 0, -1, 24, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
+{ 1255, {"proacl"},                      1034, -1, 0, -1, 25, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }
+
+DATA(insert ( 1255 proname                     19 -1 0 NAMEDATALEN     1 0 -1 -1 f p c t f f t 0 _null_));
+DATA(insert ( 1255 pronamespace                26 -1 4   2 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1255 proowner                    26 -1 4   3 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1255 prolang                     26 -1 4   4 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1255 procost                700 -1 4   5 0 -1 -1 FLOAT4PASSBYVAL p i t f f t 0 _null_));
+DATA(insert ( 1255 prorows                700 -1 4   6 0 -1 -1 FLOAT4PASSBYVAL p i t f f t 0 _null_));
+DATA(insert ( 1255 provariadic         26 -1 4   7 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1255 proisagg                    16 -1 1   8 0 -1 -1 t p c t f f t 0 _null_));
+DATA(insert ( 1255 proiswindow         16 -1 1   9 0 -1 -1 t p c t f f t 0 _null_));
+DATA(insert ( 1255 prosecdef           16 -1 1  10 0 -1 -1 t p c t f f t 0 _null_));
+DATA(insert ( 1255 proisstrict         16 -1 1  11 0 -1 -1 t p c t f f t 0 _null_));
+DATA(insert ( 1255 proretset           16 -1 1  12 0 -1 -1 t p c t f f t 0 _null_));
+DATA(insert ( 1255 provolatile         18 -1 1  13 0 -1 -1 t p c t f f t 0 _null_));
+DATA(insert ( 1255 pronargs                    21 -1 2  14 0 -1 -1 t p s t f f t 0 _null_));
+DATA(insert ( 1255 pronargdefaults     21 -1 2  15 0 -1 -1 t p s t f f t 0 _null_));
+DATA(insert ( 1255 prorettype          26 -1 4  16 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1255 proargtypes         30 -1 -1 17 1 -1 -1 f p i t f f t 0 _null_));
+DATA(insert ( 1255 proallargtypes 1028 -1 -1 18 1 -1 -1 f x i f f f t 0 _null_));
+DATA(insert ( 1255 proargmodes   1002 -1 -1 19 1 -1 -1 f x i f f f t 0 _null_));
+DATA(insert ( 1255 proargnames   1009 -1 -1 20 1 -1 -1 f x i f f f t 0 _null_));
+DATA(insert ( 1255 proargdefaults      25 -1 -1 21 0 -1 -1 f x i f f f t 0 _null_));
+DATA(insert ( 1255 prosrc                      25 -1 -1 22 0 -1 -1 f x i f f f t 0 _null_));
+DATA(insert ( 1255 probin                      17 -1 -1 23 0 -1 -1 f x i f f f t 0 _null_));
+DATA(insert ( 1255 proconfig     1009 -1 -1 24 1 -1 -1 f x i f f f t 0 _null_));
+DATA(insert ( 1255 proacl                1034 -1 -1 25 1 -1 -1 f x i f f f t 0 _null_));
+DATA(insert ( 1255 ctid                                27 0  6  -1 0 -1 -1 f p s t f f t 0 _null_));
+DATA(insert ( 1255 oid                         26 0  4  -2 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1255 xmin                                28 0  4  -3 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1255 cmin                                29 0  4  -4 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1255 xmax                                28 0  4  -5 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1255 cmax                                29 0  4  -6 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1255 tableoid                    26 0  4  -7 0 -1 -1 t p i t f f t 0 _null_));
 
 /* ----------------
  *             pg_attribute
  * ----------------
  */
 #define Schema_pg_attribute \
-{ 1249, {"attrelid"},    26, -1,       4,      1, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1249, {"attname"},     19, -1, NAMEDATALEN,  2, 0, -1, -1, false, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 1249, {"atttypid"},    26, -1,       4,      3, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1249, {"attstattarget"}, 23, -1,     4,      4, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1249, {"attlen"},              21, -1,       2,      5, 0, -1, -1, true, 'p', 's', true, false, false, true, 0, { 0 } }, \
-{ 1249, {"attnum"},              21, -1,       2,      6, 0, -1, -1, true, 'p', 's', true, false, false, true, 0, { 0 } }, \
-{ 1249, {"attndims"},    23, -1,       4,      7, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1249, {"attcacheoff"},  23, -1,      4,      8, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1249, {"atttypmod"},   23, -1,       4,      9, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1249, {"attbyval"},    16, -1,       1, 10, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 1249, {"attstorage"},   18, -1,      1, 11, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 1249, {"attalign"},    18, -1,       1, 12, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 1249, {"attnotnull"},   16, -1,      1, 13, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 1249, {"atthasdef"},   16, -1,       1, 14, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 1249, {"attisdropped"}, 16, -1,      1, 15, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 1249, {"attislocal"},   16, -1,      1, 16, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 1249, {"attinhcount"},  23, -1,      4, 17, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1249, {"attacl"},            1034, -1,  -1, 18, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }
-
-DATA(insert ( 1249 attrelid                    26 -1  4   1 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1249 attname                     19 -1 NAMEDATALEN  2 0 -1 -1 f p c t f f t 0 _null_));
-DATA(insert ( 1249 atttypid                    26 -1  4   3 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1249 attstattarget       23 -1  4   4 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1249 attlen                      21 -1  2   5 0 -1 -1 t p s t f f t 0 _null_));
-DATA(insert ( 1249 attnum                      21 -1  2   6 0 -1 -1 t p s t f f t 0 _null_));
-DATA(insert ( 1249 attndims                    23 -1  4   7 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1249 attcacheoff         23 -1  4   8 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1249 atttypmod           23 -1  4   9 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1249 attbyval                    16 -1  1  10 0 -1 -1 t p c t f f t 0 _null_));
-DATA(insert ( 1249 attstorage          18 -1  1  11 0 -1 -1 t p c t f f t 0 _null_));
-DATA(insert ( 1249 attalign                    18 -1  1  12 0 -1 -1 t p c t f f t 0 _null_));
-DATA(insert ( 1249 attnotnull          16 -1  1  13 0 -1 -1 t p c t f f t 0 _null_));
-DATA(insert ( 1249 atthasdef           16 -1  1  14 0 -1 -1 t p c t f f t 0 _null_));
-DATA(insert ( 1249 attisdropped                16 -1  1  15 0 -1 -1 t p c t f f t 0 _null_));
-DATA(insert ( 1249 attislocal          16 -1  1  16 0 -1 -1 t p c t f f t 0 _null_));
-DATA(insert ( 1249 attinhcount         23 -1  4  17 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1249 attacl                1034 -1 -1  18 1 -1 -1 f x i f f f t 0 _null_));
-DATA(insert ( 1249 ctid                                27 0  6  -1 0 -1 -1 f p s t f f t 0 _null_));
+{ 1249, {"attrelid"},    26, -1, 0,    4,      1, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1249, {"attname"},     19, -1, 0, NAMEDATALEN,       2, 0, -1, -1, false, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 1249, {"atttypid"},    26, -1, 0,    4,      3, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1249, {"attstattarget"}, 23, -1, 0,  4,      4, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1249, {"attdistinct"}, 700, -1, 0,   4,      5, 0, -1, -1, FLOAT4PASSBYVAL, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1249, {"attlen"},              21, -1, 0,    2,      6, 0, -1, -1, true, 'p', 's', true, false, false, true, 0, { 0 } }, \
+{ 1249, {"attnum"},              21, -1, 0,    2,      7, 0, -1, -1, true, 'p', 's', true, false, false, true, 0, { 0 } }, \
+{ 1249, {"attndims"},    23, -1, 0,    4,      8, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1249, {"attcacheoff"},  23, -1, 0,   4,      9, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1249, {"atttypmod"},   23, -1, 0,    4, 10, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1249, {"attbyval"},    16, -1, 0,    1, 11, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 1249, {"attstorage"},   18, -1, 0,   1, 12, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 1249, {"attalign"},    18, -1, 0,    1, 13, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 1249, {"attnotnull"},   16, -1, 0,   1, 14, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 1249, {"atthasdef"},   16, -1, 0,    1, 15, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 1249, {"attisdropped"}, 16, -1, 0,   1, 16, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 1249, {"attislocal"},   16, -1, 0,   1, 17, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 1249, {"attinhcount"},  23, -1, 0,   4, 18, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1249, {"attacl"},            1034, -1, 0,  -1, 19, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }
+
+DATA(insert ( 1249 attrelid                    26 -1 0  4   1 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1249 attname                     19 -1 0 NAMEDATALEN  2 0 -1 -1 f p c t f f t 0 _null_));
+DATA(insert ( 1249 atttypid                    26 -1 0  4   3 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1249 attstattarget       23 -1 0  4   4 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1249 attdistinct    700 -1 0  4   5 0 -1 -1 FLOAT4PASSBYVAL p i t f f t 0 _null_));
+DATA(insert ( 1249 attlen                      21 -1 0  2   6 0 -1 -1 t p s t f f t 0 _null_));
+DATA(insert ( 1249 attnum                      21 -1 0  2   7 0 -1 -1 t p s t f f t 0 _null_));
+DATA(insert ( 1249 attndims                    23 -1 0  4   8 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1249 attcacheoff         23 -1 0  4   9 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1249 atttypmod           23 -1 0  4  10 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1249 attbyval                    16 -1 0  1  11 0 -1 -1 t p c t f f t 0 _null_));
+DATA(insert ( 1249 attstorage          18 -1 0  1  12 0 -1 -1 t p c t f f t 0 _null_));
+DATA(insert ( 1249 attalign                    18 -1 0  1  13 0 -1 -1 t p c t f f t 0 _null_));
+DATA(insert ( 1249 attnotnull          16 -1 0  1  14 0 -1 -1 t p c t f f t 0 _null_));
+DATA(insert ( 1249 atthasdef           16 -1 0  1  15 0 -1 -1 t p c t f f t 0 _null_));
+DATA(insert ( 1249 attisdropped                16 -1 0  1  16 0 -1 -1 t p c t f f t 0 _null_));
+DATA(insert ( 1249 attislocal          16 -1 0  1  17 0 -1 -1 t p c t f f t 0 _null_));
+DATA(insert ( 1249 attinhcount         23 -1 0  4  18 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1249 attacl                1034 -1 0 -1  19 1 -1 -1 f x i f f f t 0 _null_));
+DATA(insert ( 1249 ctid                                27 0 0  6  -1 0 -1 -1 f p s t f f t 0 _null_));
 /* no OIDs in pg_attribute */
-DATA(insert ( 1249 xmin                                28 0  4  -3 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1249 cmin                                29 0  4  -4 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1249 xmax                                28 0  4  -5 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1249 cmax                                29 0  4  -6 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1249 tableoid                    26 0  4  -7 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1249 xmin                                28 0  4  -3 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1249 cmin                                29 0  4  -4 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1249 xmax                                28 0  4  -5 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1249 cmax                                29 0  4  -6 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1249 tableoid                    26 0  4  -7 0 -1 -1 t p i t f f t 0 _null_));
 
 /* ----------------
  *             pg_class
  * ----------------
  */
 #define Schema_pg_class \
-{ 1259, {"relname"},      19, -1, NAMEDATALEN, 1, 0, -1, -1, false, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 1259, {"relnamespace"},  26, -1,     4,      2, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1259, {"reltype"},      26, -1,      4,      3, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1259, {"relowner"},     26, -1,      4,      4, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1259, {"relam"},                26, -1,      4,      5, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1259, {"relfilenode"},   26, -1,     4,      6, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1259, {"reltablespace"}, 26, -1,     4,      7, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1259, {"relpages"},     23, -1,      4,      8, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1259, {"reltuples"},    700, -1, 4,  9, 0, -1, -1, FLOAT4PASSBYVAL, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1259, {"reltoastrelid"}, 26, -1,     4, 10, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1259, {"reltoastidxid"}, 26, -1,     4, 11, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1259, {"relhasindex"},   16, -1,     1, 12, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 1259, {"relisshared"},   16, -1,     1, 13, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 1259, {"relistemp"},    16, -1,      1, 14, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 1259, {"relkind"},      18, -1,      1, 15, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 1259, {"relnatts"},     21, -1,      2, 16, 0, -1, -1, true, 'p', 's', true, false, false, true, 0, { 0 } }, \
-{ 1259, {"relchecks"},    21, -1,      2, 17, 0, -1, -1, true, 'p', 's', true, false, false, true, 0, { 0 } }, \
-{ 1259, {"relhasoids"},    16, -1,     1, 18, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 1259, {"relhaspkey"},    16, -1,     1, 19, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 1259, {"relhasrules"},   16, -1,     1, 20, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 1259, {"relhastriggers"},16, -1,     1, 21, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 1259, {"relhassubclass"},16, -1,     1, 22, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 1259, {"relfrozenxid"},  28, -1,     4, 23, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 1259, {"relacl"},             1034, -1, -1, 24, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
-{ 1259, {"reloptions"},  1009, -1, -1, 25, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }
-
-DATA(insert ( 1259 relname                     19 -1 NAMEDATALEN       1 0 -1 -1 f p c t f f t 0 _null_));
-DATA(insert ( 1259 relnamespace                26 -1 4   2 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1259 reltype                     26 -1 4   3 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1259 relowner                    26 -1 4   4 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1259 relam                       26 -1 4   5 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1259 relfilenode         26 -1 4   6 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1259 reltablespace       26 -1 4   7 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1259 relpages                    23 -1 4   8 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1259 reltuples      700 -1 4   9 0 -1 -1 FLOAT4PASSBYVAL p i t f f t 0 _null_));
-DATA(insert ( 1259 reltoastrelid       26 -1 4  10 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1259 reltoastidxid       26 -1 4  11 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1259 relhasindex         16 -1 1  12 0 -1 -1 t p c t f f t 0 _null_));
-DATA(insert ( 1259 relisshared         16 -1 1  13 0 -1 -1 t p c t f f t 0 _null_));
-DATA(insert ( 1259 relistemp           16 -1 1  14 0 -1 -1 t p c t f f t 0 _null_));
-DATA(insert ( 1259 relkind                     18 -1 1  15 0 -1 -1 t p c t f f t 0 _null_));
-DATA(insert ( 1259 relnatts                    21 -1 2  16 0 -1 -1 t p s t f f t 0 _null_));
-DATA(insert ( 1259 relchecks           21 -1 2  17 0 -1 -1 t p s t f f t 0 _null_));
-DATA(insert ( 1259 relhasoids          16 -1 1  18 0 -1 -1 t p c t f f t 0 _null_));
-DATA(insert ( 1259 relhaspkey          16 -1 1  19 0 -1 -1 t p c t f f t 0 _null_));
-DATA(insert ( 1259 relhasrules         16 -1 1  20 0 -1 -1 t p c t f f t 0 _null_));
-DATA(insert ( 1259 relhastriggers      16 -1 1  21 0 -1 -1 t p c t f f t 0 _null_));
-DATA(insert ( 1259 relhassubclass      16 -1 1  22 0 -1 -1 t p c t f f t 0 _null_));
-DATA(insert ( 1259 relfrozenxid                28 -1 4  23 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1259 relacl                1034 -1 -1 24 1 -1 -1 f x i f f f t 0 _null_));
-DATA(insert ( 1259 reloptions    1009 -1 -1 25 1 -1 -1 f x i f f f t 0 _null_));
-DATA(insert ( 1259 ctid                                27 0  6  -1 0 -1 -1 f p s t f f t 0 _null_));
-DATA(insert ( 1259 oid                         26 0  4  -2 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1259 xmin                                28 0  4  -3 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1259 cmin                                29 0  4  -4 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1259 xmax                                28 0  4  -5 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1259 cmax                                29 0  4  -6 0 -1 -1 t p i t f f t 0 _null_));
-DATA(insert ( 1259 tableoid                    26 0  4  -7 0 -1 -1 t p i t f f t 0 _null_));
+{ 1259, {"relname"},      19, -1, 0, NAMEDATALEN, 1, 0, -1, -1, false, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 1259, {"relnamespace"},  26, -1, 0,  4,      2, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1259, {"reltype"},      26, -1, 0,   4,      3, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1259, {"relowner"},     26, -1, 0,   4,      4, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1259, {"relam"},                26, -1, 0,   4,      5, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1259, {"relfilenode"},   26, -1, 0,  4,      6, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1259, {"reltablespace"}, 26, -1, 0,  4,      7, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1259, {"relpages"},     23, -1, 0,   4,      8, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1259, {"reltuples"},    700, -1, 0, 4,       9, 0, -1, -1, FLOAT4PASSBYVAL, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1259, {"reltoastrelid"}, 26, -1, 0,  4, 10, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1259, {"reltoastidxid"}, 26, -1, 0,  4, 11, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1259, {"relhasindex"},   16, -1, 0,  1, 12, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 1259, {"relisshared"},   16, -1, 0,  1, 13, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 1259, {"relistemp"},    16, -1, 0,   1, 14, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 1259, {"relkind"},      18, -1, 0,   1, 15, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 1259, {"relnatts"},     21, -1, 0,   2, 16, 0, -1, -1, true, 'p', 's', true, false, false, true, 0, { 0 } }, \
+{ 1259, {"relchecks"},    21, -1, 0,   2, 17, 0, -1, -1, true, 'p', 's', true, false, false, true, 0, { 0 } }, \
+{ 1259, {"relhasoids"},    16, -1, 0,  1, 18, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 1259, {"relhaspkey"},    16, -1, 0,  1, 19, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 1259, {"relhasrules"},   16, -1, 0,  1, 20, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 1259, {"relhastriggers"},16, -1, 0,  1, 21, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 1259, {"relhassubclass"},16, -1, 0,  1, 22, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 1259, {"relfrozenxid"},  28, -1, 0,  4, 23, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 1259, {"relacl"},             1034, -1, 0, -1, 24, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
+{ 1259, {"reloptions"},  1009, -1, 0, -1, 25, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }
+
+DATA(insert ( 1259 relname                     19 -1 0 NAMEDATALEN     1 0 -1 -1 f p c t f f t 0 _null_));
+DATA(insert ( 1259 relnamespace                26 -1 4   2 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1259 reltype                     26 -1 4   3 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1259 relowner                    26 -1 4   4 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1259 relam                       26 -1 4   5 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1259 relfilenode         26 -1 4   6 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1259 reltablespace       26 -1 4   7 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1259 relpages                    23 -1 4   8 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1259 reltuples      700 -1 4   9 0 -1 -1 FLOAT4PASSBYVAL p i t f f t 0 _null_));
+DATA(insert ( 1259 reltoastrelid       26 -1 4  10 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1259 reltoastidxid       26 -1 4  11 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1259 relhasindex         16 -1 1  12 0 -1 -1 t p c t f f t 0 _null_));
+DATA(insert ( 1259 relisshared         16 -1 1  13 0 -1 -1 t p c t f f t 0 _null_));
+DATA(insert ( 1259 relistemp           16 -1 1  14 0 -1 -1 t p c t f f t 0 _null_));
+DATA(insert ( 1259 relkind                     18 -1 1  15 0 -1 -1 t p c t f f t 0 _null_));
+DATA(insert ( 1259 relnatts                    21 -1 2  16 0 -1 -1 t p s t f f t 0 _null_));
+DATA(insert ( 1259 relchecks           21 -1 2  17 0 -1 -1 t p s t f f t 0 _null_));
+DATA(insert ( 1259 relhasoids          16 -1 1  18 0 -1 -1 t p c t f f t 0 _null_));
+DATA(insert ( 1259 relhaspkey          16 -1 1  19 0 -1 -1 t p c t f f t 0 _null_));
+DATA(insert ( 1259 relhasrules         16 -1 1  20 0 -1 -1 t p c t f f t 0 _null_));
+DATA(insert ( 1259 relhastriggers      16 -1 1  21 0 -1 -1 t p c t f f t 0 _null_));
+DATA(insert ( 1259 relhassubclass      16 -1 1  22 0 -1 -1 t p c t f f t 0 _null_));
+DATA(insert ( 1259 relfrozenxid                28 -1 4  23 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1259 relacl                1034 -1 -1 24 1 -1 -1 f x i f f f t 0 _null_));
+DATA(insert ( 1259 reloptions    1009 -1 -1 25 1 -1 -1 f x i f f f t 0 _null_));
+DATA(insert ( 1259 ctid                                27 0  6  -1 0 -1 -1 f p s t f f t 0 _null_));
+DATA(insert ( 1259 oid                         26 0  4  -2 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1259 xmin                                28 0  4  -3 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1259 cmin                                29 0  4  -4 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1259 xmax                                28 0  4  -5 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1259 cmax                                29 0  4  -6 0 -1 -1 t p i t f f t 0 _null_));
+DATA(insert ( 1259 tableoid                    26 0  4  -7 0 -1 -1 t p i t f f t 0 _null_));
 
 /* ----------------
  *             pg_index
@@ -464,20 +474,20 @@ DATA(insert ( 1259 tableoid                       26 0  4  -7 0 -1 -1 t p i t f f t 0 _null_));
  * ----------------
  */
 #define Schema_pg_index \
-{ 0, {"indexrelid"},           26, -1, 4, 1, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 0, {"indrelid"},                     26, -1, 4, 2, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 0, {"indnatts"},                     21, -1, 2, 3, 0, -1, -1, true, 'p', 's', true, false, false, true, 0, { 0 } }, \
-{ 0, {"indisunique"},          16, -1, 1, 4, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 0, {"indisprimary"},         16, -1, 1, 5, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 0, {"indimmediate"},         16, -1, 1, 6, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 0, {"indisclustered"},       16, -1, 1, 7, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 0, {"indisvalid"},           16, -1, 1, 8, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 0, {"indcheckxmin"},         16, -1, 1, 9, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 0, {"indisready"},           16, -1, 1, 10, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
-{ 0, {"indkey"},                       22, -1, -1, 11, 1, -1, -1, false, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 0, {"indclass"},                     30, -1, -1, 12, 1, -1, -1, false, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 0, {"indoption"},                    22, -1, -1, 13, 1, -1, -1, false, 'p', 'i', true, false, false, true, 0, { 0 } }, \
-{ 0, {"indexprs"},                     25, -1, -1, 14, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
-{ 0, {"indpred"},                      25, -1, -1, 15, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }
+{ 0, {"indexrelid"},           26, -1, 0, 4, 1, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 0, {"indrelid"},                     26, -1, 0, 4, 2, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 0, {"indnatts"},                     21, -1, 0, 2, 3, 0, -1, -1, true, 'p', 's', true, false, false, true, 0, { 0 } }, \
+{ 0, {"indisunique"},          16, -1, 0, 1, 4, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 0, {"indisprimary"},         16, -1, 0, 1, 5, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 0, {"indimmediate"},         16, -1, 0, 1, 6, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 0, {"indisclustered"},       16, -1, 0, 1, 7, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 0, {"indisvalid"},           16, -1, 0, 1, 8, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 0, {"indcheckxmin"},         16, -1, 0, 1, 9, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 0, {"indisready"},           16, -1, 0, 1, 10, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
+{ 0, {"indkey"},                       22, -1, 0, -1, 11, 1, -1, -1, false, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 0, {"indclass"},                     30, -1, 0, -1, 12, 1, -1, -1, false, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 0, {"indoption"},                    22, -1, 0, -1, 13, 1, -1, -1, false, 'p', 'i', true, false, false, true, 0, { 0 } }, \
+{ 0, {"indexprs"},                     25, -1, 0, -1, 14, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
+{ 0, {"indpred"},                      25, -1, 0, -1, 15, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }
 
 #endif   /* PG_ATTRIBUTE_H */
index 1aeb324e3b599494b6c752e8b29b4d7fd4cbcfec..15a3b5f8d31f34db71516ab236c22e93160803a1 100644 (file)
@@ -8,7 +8,7 @@
  * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/include/catalog/pg_class.h,v 1.114 2009/06/11 14:49:09 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_class.h,v 1.115 2009/08/02 22:14:53 tgl Exp $
  *
  * NOTES
  *       the genbki.sh script reads this file and generates .bki
@@ -125,7 +125,7 @@ typedef FormData_pg_class *Form_pg_class;
 /* Note: "3" in the relfrozenxid column stands for FirstNormalTransactionId */
 DATA(insert OID = 1247 (  pg_type              PGNSP 71 PGUID 0 1247 0 0 0 0 0 f f f r 28 0 t f f f f 3 _null_ _null_ ));
 DESCR("");
-DATA(insert OID = 1249 (  pg_attribute PGNSP 75 PGUID 0 1249 0 0 0 0 0 f f f r 18 0 f f f f f 3 _null_ _null_ ));
+DATA(insert OID = 1249 (  pg_attribute PGNSP 75 PGUID 0 1249 0 0 0 0 0 f f f r 19 0 f f f f f 3 _null_ _null_ ));
 DESCR("");
 DATA(insert OID = 1255 (  pg_proc              PGNSP 81 PGUID 0 1255 0 0 0 0 0 f f f r 25 0 t f f f f 3 _null_ _null_ ));
 DESCR("");
index d0573455a0572acc4c4544b910005648ddc34d9e..f0b3941abf8f0c6b0faa3b383cc8f56bd2fc635c 100644 (file)
@@ -13,7 +13,7 @@
  * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.400 2009/07/30 02:45:38 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.401 2009/08/02 22:14:53 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -1098,8 +1098,9 @@ typedef enum AlterTableType
        AT_ColumnDefault,                       /* alter column default */
        AT_DropNotNull,                         /* alter column drop not null */
        AT_SetNotNull,                          /* alter column set not null */
-       AT_SetStatistics,                       /* alter column statistics */
-       AT_SetStorage,                          /* alter column storage */
+       AT_SetStatistics,                       /* alter column set statistics */
+       AT_SetDistinct,                         /* alter column set statistics distinct */
+       AT_SetStorage,                          /* alter column set storage */
        AT_DropColumn,                          /* drop column */
        AT_DropColumnRecurse,           /* internal to commands/tablecmds.c */
        AT_AddIndex,                            /* add index */