"$PGPATH"/postgres $PGSQL_OPT template1 >/dev/null <
CREATE DATABASE template0;
+
UPDATE pg_database SET \
datistemplate = 't', \
datallowconn = 'f' \
WHERE datname = 'template0';
+
+-- We use the OID of template0 to determine lastsysoid
+
+UPDATE pg_database SET datlastsysoid = \
+ (SELECT oid - 1 FROM pg_database WHERE datname = 'template0');
+
VACUUM FULL pg_database;
EOF
if [ "$?" -ne 0 ]; then
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.218 2001/08/03 20:47:40 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.219 2001/08/10 18:57:38 tgl Exp $
*
*
/* only checks for 'opts == CONV_ALL' anyway. */
} formatLiteralOptions;
-static void dumpComment(Archive *outfile, const char *target, const char *oid,
+static void dumpComment(Archive *fout, const char *target, const char *oid,
+ const char *classname, int subid,
const char *((*deps)[]));
static void dumpSequence(Archive *fout, TableInfo tbinfo, const bool schemaOnly, const bool dataOnly);
static void dumpACL(Archive *fout, TableInfo tbinfo);
{
const DumpContext *dctx = (DumpContext *) dctxv;
const char *classname = dctx->tblinfo[dctx->tblidx].relname;
+ const bool hasoids = dctx->tblinfo[dctx->tblidx].hasoids;
const bool oids = dctx->oids;
PGresult *res;
if (g_verbose)
write_msg(NULL, "dumping out the contents of table %s\n", classname);
- if (oids == true)
+ if (oids && hasoids)
{
/*
dumpClasses(const TableInfo *tblinfo, const int numTables, Archive *fout,
const char *onlytable, const bool oids, const bool force_quotes)
{
-
int i;
DataDumperPtr dumpFn;
DumpContext *dumpCtx;
- char *oidsPart;
char copyBuf[512];
char *copyStmt;
- if (oids == true)
- oidsPart = "WITH OIDS ";
- else
- oidsPart = "";
-
-
if (g_verbose)
{
if (onlytable == NULL || (strlen(onlytable) == 0))
dumpCtx->tblidx = i;
dumpCtx->oids = oids;
- if (!dumpData) /* Dump/restore using COPY */
+ if (!dumpData)
{
+ /* Dump/restore using COPY */
dumpFn = dumpClasses_nodumpData;
- /* dumpClasses_nodumpData(fout, classname, oids); */
- sprintf(copyBuf, "COPY %s %sFROM stdin;\n", fmtId(tblinfo[i].relname, force_quotes),
- oidsPart);
+ sprintf(copyBuf, "COPY %s %sFROM stdin;\n",
+ fmtId(tblinfo[i].relname, force_quotes),
+ (oids && tblinfo[i].hasoids) ? "WITH OIDS " : "");
copyStmt = copyBuf;
}
else
-/* Restore using INSERT */
{
+ /* Restore using INSERT */
dumpFn = dumpClasses_dumpData;
- /* dumpClasses_dumpData(fout, classname); */
copyStmt = NULL;
}
ArchiveEntry(fout, tblinfo[i].oid, tblinfo[i].relname,
- "TABLE DATA", NULL, "", "", copyStmt, tblinfo[i].usename,
+ "TABLE DATA", NULL, "", "",
+ copyStmt, tblinfo[i].usename,
dumpFn, dumpCtx);
}
}
MoveToEnd(g_fout, "TRIGGER");
MoveToEnd(g_fout, "RULE");
MoveToEnd(g_fout, "SEQUENCE SET");
+ /*
+ * Moving all comments to end is annoying, but must do it for comments
+ * on stuff we just moved, and we don't seem to have quite enough
+ * dependency structure to get it really right...
+ */
+ MoveToEnd(g_fout, "COMMENT");
if (plainText)
{
int loFd;
char buf[loBufSize];
int cnt;
- int blobOid;
+ Oid blobOid;
if (g_verbose)
write_msg(NULL, "saving BLOBs\n");
/* Process the tuples, if any */
for (i = 0; i < PQntuples(res); i++)
{
- blobOid = atoi(PQgetvalue(res, i, 0));
+ blobOid = atooid(PQgetvalue(res, i, 0));
/* Open the BLOB */
loFd = lo_open(g_conn, blobOid, INV_READ);
if (loFd == -1)
/* Process Attributes */
for (j = 0; j < tblinfo[i].numatts; j++)
{
- if (tblinfo[i].attoids[j])
- free(tblinfo[i].attoids[j]);
if (tblinfo[i].attnames[j])
free(tblinfo[i].attnames[j]);
if (tblinfo[i].typnames[j])
finfo[i].prorettype = strdup(PQgetvalue(res, i, i_prorettype));
finfo[i].retset = (strcmp(PQgetvalue(res, i, i_proretset), "t") == 0);
finfo[i].nargs = atoi(PQgetvalue(res, i, i_pronargs));
- finfo[i].lang = atoi(PQgetvalue(res, i, i_prolang));
+ finfo[i].lang = atooid(PQgetvalue(res, i, i_prolang));
finfo[i].usename = strdup(PQgetvalue(res, i, i_usename));
finfo[i].iscachable = (strcmp(PQgetvalue(res, i, i_iscachable), "t") == 0);
finfo[i].isstrict = (strcmp(PQgetvalue(res, i, i_isstrict), "t") == 0);
int i_relchecks;
int i_reltriggers;
int i_relhasindex;
+ int i_relhasoids;
char relkindview[2];
* (sequence) or 'v' (view).
*/
- if (g_fout->remoteVersion >= 70100)
+ if (g_fout->remoteVersion >= 70200)
{
appendPQExpBuffer(query,
"SELECT pg_class.oid, relname, relacl, relkind, "
"(select usename from pg_user where relowner = usesysid) as usename, "
- "relchecks, reltriggers, relhasindex "
+ "relchecks, reltriggers, relhasindex, relhasoids "
+ "from pg_class "
+ "where relname !~ '^pg_' "
+ "and relkind in ('%c', '%c', '%c') "
+ "order by oid",
+ RELKIND_RELATION, RELKIND_SEQUENCE, RELKIND_VIEW);
+ }
+ else if (g_fout->remoteVersion >= 70100)
+ {
+ /* all tables have oids in 7.1 */
+ appendPQExpBuffer(query,
+ "SELECT pg_class.oid, relname, relacl, relkind, "
+ "(select usename from pg_user where relowner = usesysid) as usename, "
+ "relchecks, reltriggers, relhasindex, 't'::bool as relhasoids "
"from pg_class "
"where relname !~ '^pg_' "
"and relkind in ('%c', '%c', '%c') "
"THEN '%c'::\"char\" "
"ELSE relkind END AS relkind,"
"(select usename from pg_user where relowner = usesysid) as usename, "
- "relchecks, reltriggers, relhasindex "
+ "relchecks, reltriggers, relhasindex, 't'::bool as relhasoids "
"from pg_class c "
"where relname !~ '^pg_' "
"and relkind in ('%c', '%c', '%c') "
i_relchecks = PQfnumber(res, "relchecks");
i_reltriggers = PQfnumber(res, "reltriggers");
i_relhasindex = PQfnumber(res, "relhasindex");
+ i_relhasoids = PQfnumber(res, "relhasoids");
for (i = 0; i < ntups; i++)
{
" )"
" and c.rcsrc = pg_relcheck.rcsrc "
" and c.rcrelid = i.inhparent) "
- " Order By oid ",
+ " order by rcname ",
tblinfo[i].oid);
res2 = PQexec(g_conn, query->data);
if (!res2 ||
else
tblinfo[i].pkIndexOid = NULL;
+ /* Has it got OIDs? */
+ tblinfo[i].hasoids = (strcmp(PQgetvalue(res, i, i_relhasoids), "t") == 0);
+
/* Get primary key name (if primary key exist) */
if (tblinfo[i].pkIndexOid != NULL)
{
int i_atttypmod;
int i_attnotnull;
int i_atthasdef;
- int i_attoid;
int i_atttypedefn;
PGresult *res;
int ntups;
{
/* Fake the LOJ below */
appendPQExpBuffer(q,
- " SELECT a.oid as attoid, a.attnum, a.attname, t.typname, a.atttypmod, "
+ " SELECT a.attnum, a.attname, t.typname, a.atttypmod, "
" a.attnotnull, a.atthasdef, NULL as atttypedefn "
" from pg_attribute a, pg_type t "
" where a.attrelid = '%s'::oid "
" and a.attnum > 0 "
" and a.atttypid = t.oid "
- " UNION ALL SELECT a.oid as attoid, a.attnum, a.attname, NULL as typname, a.atttypmod, "
+ " UNION ALL SELECT a.attnum, a.attname, NULL as typname, a.atttypmod, "
" a.attnotnull, a.atthasdef, NULL as atttypedefn "
" from pg_attribute a "
" where a.attrelid = '%s'::oid "
tblinfo[i].oid, tblinfo[i].oid);
} else {
- appendPQExpBuffer(q, "SELECT a.oid as attoid, a.attnum, a.attname, t.typname, a.atttypmod, "
+ appendPQExpBuffer(q, "SELECT a.attnum, a.attname, t.typname, a.atttypmod, "
"a.attnotnull, a.atthasdef, format_type(a.atttypid, a.atttypmod) as atttypedefn "
"from pg_attribute a LEFT OUTER JOIN pg_type t ON a.atttypid = t.oid "
"where a.attrelid = '%s'::oid "
ntups = PQntuples(res);
- i_attoid = PQfnumber(res, "attoid");
i_attname = PQfnumber(res, "attname");
i_typname = PQfnumber(res, "typname");
i_atttypmod = PQfnumber(res, "atttypmod");
i_atttypedefn = PQfnumber(res, "atttypedefn");
tblinfo[i].numatts = ntups;
- tblinfo[i].attoids = (char **) malloc(ntups * sizeof(char *));
tblinfo[i].attnames = (char **) malloc(ntups * sizeof(char *));
tblinfo[i].atttypedefns = (char **) malloc(ntups * sizeof(char *));
tblinfo[i].typnames = (char **) malloc(ntups * sizeof(char *));
exit_nicely();
}
- tblinfo[i].attoids[j] = strdup(PQgetvalue(res, j, i_attoid));
tblinfo[i].attnames[j] = strdup(PQgetvalue(res, j, i_attname));
tblinfo[i].atttypedefns[j] = strdup(PQgetvalue(res, j, i_atttypedefn));
tblinfo[i].typnames[j] = strdup(PQgetvalue(res, j, i_typname));
}
/*------------------------------------------------------------------
- * dumpComments --
+ * dumpComment --
*
* This routine is used to dump any comments associated with the
* oid handed to this routine. The routine takes a constant character
- * string for the target part of the object and the oid of the object
- * whose comments are to be dumped. It is perfectly acceptable
- * to hand an oid to this routine which has not been commented. Additional
- * dependencies can be passed for the comment, too --- this is needed for
- * VIEWs, whose comments are filed under the table OID but which are dumped
- * in order by their rule OID.
+ * string for the target part of the comment-creation command, plus
+ * OID, class name, and subid which are the primary key for pg_description.
+ * If a matching pg_description entry is found, it is dumped.
+ * Additional dependencies can be passed for the comment, too --- this is
+ * needed for VIEWs, whose comments are filed under the table OID but
+ * which are dumped in order by their rule OID.
*------------------------------------------------------------------
*/
static void
dumpComment(Archive *fout, const char *target, const char *oid,
+ const char *classname, int subid,
const char *((*deps)[]))
{
PGresult *res;
/*** Build query to find comment ***/
query = createPQExpBuffer();
- appendPQExpBuffer(query, "SELECT description FROM pg_description WHERE objoid = ");
- appendPQExpBuffer(query, oid);
+
+ if (fout->remoteVersion >= 70200)
+ {
+ appendPQExpBuffer(query, "SELECT description FROM pg_description "
+ "WHERE objoid = %s and classoid = "
+ "(SELECT oid FROM pg_class where relname = '%s') "
+ "and objsubid = %d",
+ oid, classname, subid);
+ }
+ else
+ {
+ /* Note: this will fail to find attribute comments in pre-7.2... */
+ appendPQExpBuffer(query, "SELECT description FROM pg_description WHERE objoid = %s", oid);
+ }
/*** Execute query ***/
/*** If a comment exists, build COMMENT ON statement ***/
- if (PQntuples(res) != 0)
+ if (PQntuples(res) == 1)
{
i_description = PQfnumber(res, "description");
resetPQExpBuffer(query);
appendPQExpBuffer(query, "COMMENT ON %s IS ", target);
- formatStringLiteral(query, PQgetvalue(res, 0, i_description), PASS_LFTAB);
+ formatStringLiteral(query, PQgetvalue(res, 0, i_description),
+ PASS_LFTAB);
appendPQExpBuffer(query, ";\n");
ArchiveEntry(fout, oid, target, "COMMENT", deps,
query->data, "" /* Del */ ,
"" /* Copy */ , "" /* Owner */ , NULL, NULL);
-
}
/*** Clear the statement buffer and return ***/
i_oid = PQfnumber(res, "oid");
resetPQExpBuffer(query);
appendPQExpBuffer(query, "DATABASE %s", fmtId(PQdb(g_conn), force_quotes));
- dumpComment(fout, query->data, PQgetvalue(res, 0, i_oid), NULL);
+ dumpComment(fout, query->data, PQgetvalue(res, 0, i_oid),
+ "pg_database", 0, NULL);
}
/*** Clear the statement buffer and return ***/
continue;
/* skip relation types */
- if (atoi(tinfo[i].typrelid) != 0)
+ if (atooid(tinfo[i].typrelid) != 0)
continue;
/* skip undefined placeholder types */
resetPQExpBuffer(q);
appendPQExpBuffer(q, "TYPE %s", fmtId(tinfo[i].typname, force_quotes));
- dumpComment(fout, q->data, tinfo[i].oid, NULL);
+ dumpComment(fout, q->data, tinfo[i].oid, "pg_type", 0, NULL);
}
destroyPQExpBuffer(q);
appendPQExpBuffer(q, "FUNCTION %s ",
fmtId(finfo[i].proname, force_quotes));
appendPQExpBuffer(q, "( %s )", fnlist->data);
- dumpComment(fout, q->data, finfo[i].oid, NULL);
+ dumpComment(fout, q->data, finfo[i].oid, "pg_proc", 0, NULL);
done:
destroyPQExpBuffer(q);
resetPQExpBuffer(q);
appendPQExpBuffer(q, "AGGREGATE %s %s", agginfo[i].aggname,
findTypeByOid(tinfo, numTypes, agginfo[i].aggbasetype, zeroAsOpaque + useBaseTypeName));
- dumpComment(fout, q->data, agginfo[i].oid, NULL);
+ dumpComment(fout, q->data, agginfo[i].oid, "pg_aggregate", 0, NULL);
}
destroyPQExpBuffer(q);
appendPQExpBuffer(q, ")");
}
+ if (!tblinfo[i].hasoids)
+ appendPQExpBuffer(q, " WITHOUT OIDS");
+
appendPQExpBuffer(q, ";\n");
}
appendPQExpBuffer(q, "COLUMN %s", fmtId(tblinfo[i].relname, force_quotes));
appendPQExpBuffer(q, ".");
appendPQExpBuffer(q, "%s", fmtId(tblinfo[i].attnames[j], force_quotes));
- dumpComment(fout, q->data, tblinfo[i].attoids[j], NULL);
+ dumpComment(fout, q->data, tblinfo[i].oid,
+ "pg_class", j+1, commentDeps);
}
/* Dump Table Comments */
resetPQExpBuffer(q);
appendPQExpBuffer(q, "%s %s", reltypename, fmtId(tblinfo[i].relname, force_quotes));
- dumpComment(fout, q->data, tblinfo[i].oid, commentDeps);
+ dumpComment(fout, q->data, tblinfo[i].oid,
+ "pg_class", 0, commentDeps);
}
}
char *classname[INDEX_MAX_KEYS];
char *funcname; /* the name of the function to comput the
* index key from */
- int indclass;
+ Oid indclass;
int nclass;
PGresult *res;
{
int numRows;
- indclass = atoi(indinfo[i].indclass[nclass]);
+ indclass = atooid(indinfo[i].indclass[nclass]);
if (indclass == 0)
break;
resetPQExpBuffer(q);
* is not necessarily right but should answer 99% of the time.
* Would have to add owner name to IndInfo to do it right.
*/
- ArchiveEntry(fout, tblinfo[tableInd].oid, id1->data, "INDEX", NULL, q->data, delq->data,
+ ArchiveEntry(fout, indinfo[i].indexreloid, id1->data,
+ "INDEX", NULL, q->data, delq->data,
"", tblinfo[tableInd].usename, NULL, NULL);
/* Dump Index Comments */
resetPQExpBuffer(q);
appendPQExpBuffer(q, "INDEX %s", id1->data);
- dumpComment(fout, q->data, indinfo[i].indexreloid, NULL);
+ dumpComment(fout, q->data, indinfo[i].indexreloid,
+ "pg_class", 0, NULL);
}
}
write_msg(NULL, "could not insert into pgdump_oid table: %s", PQerrorMessage(g_conn));
exit_nicely();
}
- max_oid = atol(PQoidStatus(res));
+ max_oid = atooid(PQoidStatus(res));
if (max_oid == 0)
{
write_msg(NULL, "inserted invalid oid\n");
snprintf(sql, 1024,
"CREATE TEMPORARY TABLE pgdump_oid (dummy int4);\n"
"COPY pgdump_oid WITH OIDS FROM stdin;\n"
- "%-d\t0\n"
+ "%u\t0\n"
"\\.\n"
"DROP TABLE pgdump_oid;\n",
max_oid);
resetPQExpBuffer(query);
appendPQExpBuffer(query, "SEQUENCE %s", fmtId(tbinfo.relname, force_quotes));
- dumpComment(fout, query->data, tbinfo.oid, NULL);
+ dumpComment(fout, query->data, tbinfo.oid,
+ "pg_class", 0, NULL);
}
destroyPQExpBuffer(query);
ArchiveEntry(fout, tblinfo[i].triggers[j].oid, tblinfo[i].triggers[j].tgname,
"TRIGGER", NULL, tblinfo[i].triggers[j].tgsrc, "", "",
tblinfo[i].usename, NULL, NULL);
- dumpComment(fout, tblinfo[i].triggers[j].tgcomment, tblinfo[i].triggers[j].oid, NULL);
+ dumpComment(fout, tblinfo[i].triggers[j].tgcomment, tblinfo[i].triggers[j].oid,
+ "pg_trigger", 0, NULL);
}
}
}
resetPQExpBuffer(query);
appendPQExpBuffer(query, "RULE %s", fmtId(PQgetvalue(res, i, i_rulename), force_quotes));
- dumpComment(fout, query->data, PQgetvalue(res, i, i_oid), NULL);
+ dumpComment(fout, query->data, PQgetvalue(res, i, i_oid),
+ "pg_rewrite", 0, NULL);
}
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_dump.h,v 1.68 2001/08/03 19:43:05 tgl Exp $
+ * $Id: pg_dump.h,v 1.69 2001/08/10 18:57:38 tgl Exp $
*
*
char *oid;
char *proname;
char *proowner;
- int lang;
+ Oid lang;
int nargs;
char *argtypes[FUNC_MAX_ARGS];
char *prorettype;
* created after the base table was created.
*/
bool sequence;
+ bool hasoids; /* does it have OIDs? */
int numatts; /* number of attributes */
int *inhAttrs; /* an array of flags, one for each
* attribute if the value is 1, then this
int *inhAttrDef; /* Flags indicating if attrdef is inherited */
int *inhNotNull; /* Flags indicating if NOT NULL in inherited */
char **attnames; /* the attribute names */
- char **attoids; /* oids of the various attributes */
char **atttypedefns; /* formatted column type definitions */
char **typnames; /* fill out attributes */
bool *notnull; /* Not null constraints of an attribute */
*
* Copyright 2000 by PostgreSQL Global Development Group
*
- * $Header: /cvsroot/pgsql/src/bin/psql/describe.c,v 1.37 2001/08/09 03:32:16 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/describe.c,v 1.38 2001/08/10 18:57:39 tgl Exp $
*/
#include "postgres_fe.h"
#include "describe.h"
" WHEN 0 THEN CAST('%s' AS text)\n"
" ELSE format_type(a.aggbasetype, NULL)\n"
" END AS \"%s\",\n"
- " obj_description(a.oid) as \"%s\"\n"
+ " obj_description(a.oid, 'pg_aggregate') as \"%s\"\n"
"FROM pg_aggregate a\n",
_("Name"), _("(all types)"),
_("Data type"), _("Description") );
",\n u.usename as \"%s\",\n"
" l.lanname as \"%s\",\n"
" p.prosrc as \"%s\",\n"
- " obj_description(p.oid) as \"%s\"",
+ " obj_description(p.oid, 'pg_proc') as \"%s\"",
_("Owner"), _("Language"),
_("Source code"), _("Description") );
" END AS \"%s\",\n",
_("Internal name"), _("Size") );
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
- " obj_description(t.oid) as \"%s\"\n",
+ " obj_description(t.oid, 'pg_type') as \"%s\"\n",
_("Description") );
/*
" CASE WHEN o.oprkind='l' THEN NULL ELSE format_type(o.oprleft, NULL) END AS \"%s\",\n"
" CASE WHEN o.oprkind='r' THEN NULL ELSE format_type(o.oprright, NULL) END AS \"%s\",\n"
" format_type(p.prorettype, NULL) AS \"%s\",\n"
- " obj_description(p.oid) as \"%s\"\n"
+ " obj_description(p.oid, 'pg_proc') as \"%s\"\n"
"FROM pg_proc p, pg_operator o\n"
"WHERE RegprocToOid(o.oprcode) = p.oid\n",
_("Name"), _("Left arg type"), _("Right arg type"),
#endif
if (desc)
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
- ",\n obj_description(d.oid) as \"%s\"",
+ ",\n obj_description(d.oid, 'pg_database') as \"%s\"",
_("Description"));
strcat(buf,
"\nFROM pg_database d LEFT JOIN pg_user u ON d.datdba = u.usesysid\n"
"FROM (\n"
/* Aggregate descriptions */
- " SELECT a.oid as oid, CAST(a.aggname AS text) as name, CAST('%s' AS text) as object\n"
+ " SELECT a.oid as oid, a.tableoid as tableoid,\n"
+ " CAST(a.aggname AS text) as name, CAST('%s' AS text) as object\n"
" FROM pg_aggregate a\n"
/* Function descriptions (except in/outs for datatypes) */
"UNION ALL\n"
- " SELECT p.oid as oid, CAST(p.proname AS text) as name, CAST('%s' AS text) as object\n"
+ " SELECT p.oid as oid, p.tableoid as tableoid,\n"
+ " CAST(p.proname AS text) as name, CAST('%s' AS text) as object\n"
" FROM pg_proc p\n"
" WHERE p.pronargs = 0 or oidvectortypes(p.proargtypes) <> ''\n"
/* Operator descriptions (must get comment via associated function) */
"UNION ALL\n"
- " SELECT RegprocToOid(o.oprcode) as oid, CAST(o.oprname AS text) as name, CAST('%s' AS text) as object\n"
+ " SELECT RegprocToOid(o.oprcode) as oid,\n"
+ " (SELECT oid FROM pg_class WHERE relname = 'pg_proc') as tableoid,\n"
+ " CAST(o.oprname AS text) as name, CAST('%s' AS text) as object\n"
" FROM pg_operator o\n"
/* Type description */
"UNION ALL\n"
- " SELECT t.oid as oid, format_type(t.oid, NULL) as name, CAST('%s' AS text) as object\n"
+ " SELECT t.oid as oid, t.tableoid as tableoid,\n"
+ " format_type(t.oid, NULL) as name, CAST('%s' AS text) as object\n"
" FROM pg_type t\n"
/* Relation (tables, views, indexes, sequences) descriptions */
"UNION ALL\n"
- " SELECT c.oid as oid, CAST(c.relname AS text) as name,\n"
+ " SELECT c.oid as oid, c.tableoid as tableoid,\n"
+ " CAST(c.relname AS text) as name,\n"
" CAST(\n"
" CASE c.relkind WHEN 'r' THEN '%s' WHEN 'v' THEN '%s' WHEN 'i' THEN '%s' WHEN 'S' THEN '%s' END"
" AS text) as object\n"
/* Rule description (ignore rules for views) */
"UNION ALL\n"
- " SELECT r.oid as oid, CAST(r.rulename AS text) as name, CAST('%s' AS text) as object\n"
+ " SELECT r.oid as oid, r.tableoid as tableoid,\n"
+ " CAST(r.rulename AS text) as name, CAST('%s' AS text) as object\n"
" FROM pg_rewrite r\n"
" WHERE r.rulename !~ '^_RET'\n"
/* Trigger description */
"UNION ALL\n"
- " SELECT t.oid as oid, CAST(t.tgname AS text) as name, CAST('%s' AS text) as object\n"
+ " SELECT t.oid as oid, t.tableoid as tableoid,\n"
+ " CAST(t.tgname AS text) as name, CAST('%s' AS text) as object\n"
" FROM pg_trigger t\n"
") AS tt,\n"
"pg_description d\n"
- "WHERE tt.oid = d.objoid\n",
+ "WHERE tt.oid = d.objoid and tt.tableoid = d.classoid and d.objsubid = 0\n",
_("Name"), _("Object"), _("Description"),
_("aggregate"), _("function"), _("operator"),
/* Get column info */
strcpy(buf, "SELECT a.attname, format_type(a.atttypid, a.atttypmod), a.attnotnull, a.atthasdef, a.attnum");
if (desc)
- strcat(buf, ", obj_description(a.oid)");
+ strcat(buf, ", col_description(a.attrelid, a.attnum)");
strcat(buf, "\nFROM pg_class c, pg_attribute a\n"
"WHERE c.relname = '");
strncat(buf, name, NAMEDATALEN);
if (desc)
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
- ",\n obj_description(c.oid) as \"%s\"",
+ ",\n obj_description(c.oid, 'pg_class') as \"%s\"",
_("Description"));
strcat(buf,
"\nFROM pg_class c LEFT JOIN pg_user u ON c.relowner = u.usesysid\n"
*
* Copyright 2000 by PostgreSQL Global Development Group
*
- * $Header: /cvsroot/pgsql/src/bin/psql/large_obj.c,v 1.15 2001/06/02 18:25:18 petere Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/large_obj.c,v 1.16 2001/08/10 18:57:39 tgl Exp $
*/
#include "postgres_fe.h"
#include "large_obj.h"
{
PGresult *res;
Oid loid;
- char buf[1024];
+ char oidbuf[32];
unsigned int i;
bool own_transaction = true;
const char *var = GetVariable(pset.vars, "LO_TRANSACTION");
/* insert description if given */
if (comment_arg)
{
- sprintf(buf, "INSERT INTO pg_description VALUES (%u, '", loid);
- for (i = 0; i < strlen(comment_arg); i++)
- if (comment_arg[i] == '\'')
- strcat(buf, "\\'");
- else
- strncat(buf, &comment_arg[i], 1);
- strcat(buf, "')");
-
- if (!(res = PSQLexec(buf)))
+ char *cmdbuf;
+ char *bufptr;
+ int slen = strlen(comment_arg);
+
+ cmdbuf = malloc(slen * 2 + 256);
+ if (!cmdbuf)
{
if (own_transaction)
{
}
return false;
}
+ sprintf(cmdbuf,
+ "INSERT INTO pg_description VALUES (%u, "
+ "(SELECT oid FROM pg_class WHERE relname = 'pg_largeobject'),"
+ " 0, '", loid);
+ bufptr = cmdbuf + strlen(cmdbuf);
+ for (i = 0; i < slen; i++)
+ {
+ if (comment_arg[i] == '\'' || comment_arg[i] == '\\')
+ *bufptr++ = '\\';
+ *bufptr++ = comment_arg[i];
+ }
+ strcpy(bufptr, "')");
+
+ if (!(res = PSQLexec(cmdbuf)))
+ {
+ if (own_transaction)
+ {
+ res = PQexec(pset.db, "ROLLBACK");
+ PQclear(res);
+ }
+ free(cmdbuf);
+ return false;
+ }
+
+ PQclear(res);
+ free(cmdbuf);
}
if (own_transaction)
}
- fprintf(pset.queryFout, "lo_import %d\n", loid);
- sprintf(buf, "%u", (unsigned int) loid);
- SetVariable(pset.vars, "LASTOID", buf);
+ fprintf(pset.queryFout, "lo_import %u\n", loid);
+ sprintf(oidbuf, "%u", loid);
+ SetVariable(pset.vars, "LASTOID", oidbuf);
return true;
}
}
/* remove the comment as well */
- sprintf(buf, "DELETE FROM pg_description WHERE objoid = %u", loid);
+ sprintf(buf, "DELETE FROM pg_description WHERE objoid = %u "
+ "AND classoid = (SELECT oid FROM pg_class WHERE relname = 'pg_largeobject')",
+ loid);
if (!(res = PSQLexec(buf)))
{
if (own_transaction)
printQueryOpt myopt = pset.popt;
snprintf(buf, sizeof(buf),
- "SELECT loid as \"ID\", obj_description(loid) as \"%s\"\n"
+ "SELECT loid as \"ID\", obj_description(loid, 'pg_largeobject') as \"%s\"\n"
"FROM (SELECT DISTINCT loid FROM pg_largeobject) x\n"
"ORDER BY \"ID\"",
gettext("Description"));
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: transam.h,v 1.36 2001/07/12 04:11:13 tgl Exp $
+ * $Id: transam.h,v 1.37 2001/08/10 18:57:39 tgl Exp $
*
*-------------------------------------------------------------------------
*/
typedef unsigned char XidStatus; /* (2 bits) */
/* ----------
- * We reserve the first 16384 object ids for manual assignment.
- * oid's less than this appear in the .bki files. the choice of
- * 16384 is completely arbitrary.
+ * Object ID (OID) zero is InvalidOid.
+ *
+ * OIDs 1-9999 are reserved for manual assignment (see the files
+ * in src/include/catalog/).
+ *
+ * OIDS 10000-16383 are reserved for assignment by genbki.sh.
+ *
+ * OIDs beginning at 16384 are assigned at runtime from the OID
+ * generator. (The first few of these will be assigned during initdb,
+ * to objects created after the initial BKI script processing.)
+ *
+ * The choices of 10000 and 16384 are completely arbitrary, and can be moved
+ * if we run low on OIDs in either category. Changing the macros below
+ * should be sufficient to do this.
+ *
+ * NOTE: if the OID generator wraps around, we should skip over OIDs 0-16383
+ * and resume with 16384. This minimizes the odds of OID conflict, by not
+ * reassigning OIDs that might have been assigned during initdb.
* ----------
*/
+#define FirstGenBKIObjectId 10000
#define BootstrapObjectIdData 16384
/*
/* in transam/varsup.c */
extern void GetNewTransactionId(TransactionId *xid);
extern void ReadNewTransactionId(TransactionId *xid);
-extern void GetNewObjectId(Oid *oid_return);
+extern Oid GetNewObjectId(void);
extern void CheckMaxObjectId(Oid assigned_oid);
/* ----------------
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: bootstrap.h,v 1.22 2001/05/12 01:48:49 petere Exp $
+ * $Id: bootstrap.h,v 1.23 2001/08/10 18:57:39 tgl Exp $
*
*-------------------------------------------------------------------------
*/
extern char *LexIDStr(int ident_num);
extern void DefineAttr(char *name, char *type, int attnum);
-extern void InsertOneValue(Oid objectid, char *value, int i);
+extern void InsertOneValue(char *value, int i);
extern void InsertOneNull(int i);
extern char *MapArrayTypeName(char *s);
extern char *CleanUpStr(char *s);
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: catversion.h,v 1.86 2001/07/15 22:48:18 tgl Exp $
+ * $Id: catversion.h,v 1.87 2001/08/10 18:57:39 tgl Exp $
*
*-------------------------------------------------------------------------
*/
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 200107151
+#define CATALOG_VERSION_NO 200108101
#endif
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: heap.h,v 1.36 2001/05/30 12:57:36 momjian Exp $
+ * $Id: heap.h,v 1.37 2001/08/10 18:57:39 tgl Exp $
*
*-------------------------------------------------------------------------
*/
extern void heap_storage_create(Relation rel);
extern Oid heap_create_with_catalog(char *relname, TupleDesc tupdesc,
- char relkind, bool istemp,
+ char relkind, bool relhasoids, bool istemp,
bool allow_system_table_mods);
extern void heap_drop_with_catalog(const char *relname,
extern int RemoveCheckConstraint(Relation rel, const char *constrName, bool inh);
-extern Form_pg_attribute SystemAttributeDefinition(AttrNumber attno);
+extern Form_pg_attribute SystemAttributeDefinition(AttrNumber attno,
+ bool relhasoids);
#endif /* HEAP_H */
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: index.h,v 1.37 2001/07/16 05:06:59 tgl Exp $
+ * $Id: index.h,v 1.38 2001/08/10 18:57:39 tgl Exp $
*
*-------------------------------------------------------------------------
*/
Relation indexRelation,
Oid accessMethodObjectId);
-extern void index_create(char *heapRelationName,
+extern Oid index_create(char *heapRelationName,
char *indexRelationName,
IndexInfo *indexInfo,
Oid accessMethodObjectId,
extern void UpdateStats(Oid relid, double reltuples);
extern bool IndexesAreActive(Oid relid, bool comfirmCommitted);
-extern void setRelhasindex(Oid relid, bool hasindex);
+extern void setRelhasindex(Oid relid, bool hasindex,
+ bool isprimary, Oid reltoastidxid);
extern void setNewRelfilenode(Relation relation);
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: indexing.h,v 1.51 2001/06/16 18:59:31 tgl Exp $
+ * $Id: indexing.h,v 1.52 2001/08/10 18:57:39 tgl Exp $
*
*-------------------------------------------------------------------------
*/
/*
* Number of indices that exist for each system catalog
*/
-#define Num_pg_aggregate_indices 1
+#define Num_pg_aggregate_indices 2
#define Num_pg_am_indices 2
#define Num_pg_amop_indices 2
#define Num_pg_amproc_indices 1
#define AccessMethodStrategyIndex "pg_amop_strategy_index"
#define AccessProcedureIndex "pg_amproc_am_opcl_procnum_index"
#define AggregateNameTypeIndex "pg_aggregate_name_type_index"
+#define AggregateOidIndex "pg_aggregate_oid_index"
#define AmNameIndex "pg_am_name_index"
#define AmOidIndex "pg_am_oid_index"
#define AttrDefaultIndex "pg_attrdef_adrelid_adnum_index"
#define ClassOidIndex "pg_class_oid_index"
#define DatabaseNameIndex "pg_database_datname_index"
#define DatabaseOidIndex "pg_database_oid_index"
-#define DescriptionObjIndex "pg_description_objoid_index"
+#define DescriptionObjIndex "pg_description_o_c_o_index"
#define GroupNameIndex "pg_group_name_index"
#define GroupSysidIndex "pg_group_sysid_index"
#define IndexIndrelidIndex "pg_index_indrelid_index"
*/
DECLARE_UNIQUE_INDEX(pg_aggregate_name_type_index on pg_aggregate using btree(aggname name_ops, aggbasetype oid_ops));
+DECLARE_UNIQUE_INDEX(pg_aggregate_oid_index on pg_aggregate using btree(oid oid_ops));
DECLARE_UNIQUE_INDEX(pg_am_name_index on pg_am using btree(amname name_ops));
DECLARE_UNIQUE_INDEX(pg_am_oid_index on pg_am using btree(oid oid_ops));
DECLARE_UNIQUE_INDEX(pg_amop_opid_index on pg_amop using btree(amopclaid oid_ops, amopopr oid_ops, amopid oid_ops));
DECLARE_UNIQUE_INDEX(pg_class_relname_index on pg_class using btree(relname name_ops));
DECLARE_UNIQUE_INDEX(pg_database_datname_index on pg_database using btree(datname name_ops));
DECLARE_UNIQUE_INDEX(pg_database_oid_index on pg_database using btree(oid oid_ops));
-DECLARE_UNIQUE_INDEX(pg_description_objoid_index on pg_description using btree(objoid oid_ops));
+DECLARE_UNIQUE_INDEX(pg_description_o_c_o_index on pg_description using btree(objoid oid_ops, classoid oid_ops, objsubid int4_ops));
DECLARE_UNIQUE_INDEX(pg_group_name_index on pg_group using btree(groname name_ops));
DECLARE_UNIQUE_INDEX(pg_group_sysid_index on pg_group using btree(grosysid int4_ops));
/* This following index is not used for a cache and is not unique */
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_amop.h,v 1.38 2001/03/22 04:00:37 momjian Exp $
+ * $Id: pg_amop.h,v 1.39 2001/08/10 18:57:39 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
* typedef struct FormData_pg_amop
* ----------------
*/
-CATALOG(pg_amop)
+CATALOG(pg_amop) BKI_WITHOUT_OIDS
{
Oid amopid; /* an index access method */
Oid amopclaid; /* an index opclass */
* rtree box_ops
*/
-DATA(insert OID = 0 ( 402 422 493 1 ));
-DATA(insert OID = 0 ( 402 422 494 2 ));
-DATA(insert OID = 0 ( 402 422 500 3 ));
-DATA(insert OID = 0 ( 402 422 495 4 ));
-DATA(insert OID = 0 ( 402 422 496 5 ));
-DATA(insert OID = 0 ( 402 422 499 6 ));
-DATA(insert OID = 0 ( 402 422 498 7 ));
-DATA(insert OID = 0 ( 402 422 497 8 ));
+DATA(insert ( 402 422 493 1 ));
+DATA(insert ( 402 422 494 2 ));
+DATA(insert ( 402 422 500 3 ));
+DATA(insert ( 402 422 495 4 ));
+DATA(insert ( 402 422 496 5 ));
+DATA(insert ( 402 422 499 6 ));
+DATA(insert ( 402 422 498 7 ));
+DATA(insert ( 402 422 497 8 ));
/*
* rtree bigbox_ops
*/
-DATA(insert OID = 0 ( 402 433 493 1 ));
-DATA(insert OID = 0 ( 402 433 494 2 ));
-DATA(insert OID = 0 ( 402 433 500 3 ));
-DATA(insert OID = 0 ( 402 433 495 4 ));
-DATA(insert OID = 0 ( 402 433 496 5 ));
-DATA(insert OID = 0 ( 402 433 499 6 ));
-DATA(insert OID = 0 ( 402 433 498 7 ));
-DATA(insert OID = 0 ( 402 433 497 8 ));
+DATA(insert ( 402 433 493 1 ));
+DATA(insert ( 402 433 494 2 ));
+DATA(insert ( 402 433 500 3 ));
+DATA(insert ( 402 433 495 4 ));
+DATA(insert ( 402 433 496 5 ));
+DATA(insert ( 402 433 499 6 ));
+DATA(insert ( 402 433 498 7 ));
+DATA(insert ( 402 433 497 8 ));
/*
* rtree poly_ops (supports polygons)
*/
-DATA(insert OID = 0 ( 402 434 485 1 ));
-DATA(insert OID = 0 ( 402 434 486 2 ));
-DATA(insert OID = 0 ( 402 434 492 3 ));
-DATA(insert OID = 0 ( 402 434 487 4 ));
-DATA(insert OID = 0 ( 402 434 488 5 ));
-DATA(insert OID = 0 ( 402 434 491 6 ));
-DATA(insert OID = 0 ( 402 434 490 7 ));
-DATA(insert OID = 0 ( 402 434 489 8 ));
+DATA(insert ( 402 434 485 1 ));
+DATA(insert ( 402 434 486 2 ));
+DATA(insert ( 402 434 492 3 ));
+DATA(insert ( 402 434 487 4 ));
+DATA(insert ( 402 434 488 5 ));
+DATA(insert ( 402 434 491 6 ));
+DATA(insert ( 402 434 490 7 ));
+DATA(insert ( 402 434 489 8 ));
/*
* rtree circle_ops (supports circles)
* writes such functions.
*/
-/* DATA(insert OID = 0 ( 402 714 1506 1 )); */
-/* DATA(insert OID = 0 ( 402 714 1507 2 )); */
-/* DATA(insert OID = 0 ( 402 714 1513 3 )); */
-/* DATA(insert OID = 0 ( 402 714 1508 4 )); */
-/* DATA(insert OID = 0 ( 402 714 1509 5 )); */
-/* DATA(insert OID = 0 ( 402 714 1512 6 )); */
-/* DATA(insert OID = 0 ( 402 714 1511 7 )); */
-/* DATA(insert OID = 0 ( 402 714 1510 8 )); */
+/* DATA(insert ( 402 714 1506 1 )); */
+/* DATA(insert ( 402 714 1507 2 )); */
+/* DATA(insert ( 402 714 1513 3 )); */
+/* DATA(insert ( 402 714 1508 4 )); */
+/* DATA(insert ( 402 714 1509 5 )); */
+/* DATA(insert ( 402 714 1512 6 )); */
+/* DATA(insert ( 402 714 1511 7 )); */
+/* DATA(insert ( 402 714 1510 8 )); */
/*
* nbtree int2_ops
*/
-DATA(insert OID = 0 ( 403 421 95 1 ));
-DATA(insert OID = 0 ( 403 421 522 2 ));
-DATA(insert OID = 0 ( 403 421 94 3 ));
-DATA(insert OID = 0 ( 403 421 524 4 ));
-DATA(insert OID = 0 ( 403 421 520 5 ));
+DATA(insert ( 403 421 95 1 ));
+DATA(insert ( 403 421 522 2 ));
+DATA(insert ( 403 421 94 3 ));
+DATA(insert ( 403 421 524 4 ));
+DATA(insert ( 403 421 520 5 ));
/*
* nbtree float8_ops
*/
-DATA(insert OID = 0 ( 403 423 672 1 ));
-DATA(insert OID = 0 ( 403 423 673 2 ));
-DATA(insert OID = 0 ( 403 423 670 3 ));
-DATA(insert OID = 0 ( 403 423 675 4 ));
-DATA(insert OID = 0 ( 403 423 674 5 ));
+DATA(insert ( 403 423 672 1 ));
+DATA(insert ( 403 423 673 2 ));
+DATA(insert ( 403 423 670 3 ));
+DATA(insert ( 403 423 675 4 ));
+DATA(insert ( 403 423 674 5 ));
/*
* nbtree int4_ops
*/
-DATA(insert OID = 0 ( 403 426 97 1 ));
-DATA(insert OID = 0 ( 403 426 523 2 ));
-DATA(insert OID = 0 ( 403 426 96 3 ));
-DATA(insert OID = 0 ( 403 426 525 4 ));
-DATA(insert OID = 0 ( 403 426 521 5 ));
+DATA(insert ( 403 426 97 1 ));
+DATA(insert ( 403 426 523 2 ));
+DATA(insert ( 403 426 96 3 ));
+DATA(insert ( 403 426 525 4 ));
+DATA(insert ( 403 426 521 5 ));
/*
* nbtree int8_ops
*/
-DATA(insert OID = 0 ( 403 754 412 1 ));
-DATA(insert OID = 0 ( 403 754 414 2 ));
-DATA(insert OID = 0 ( 403 754 410 3 ));
-DATA(insert OID = 0 ( 403 754 415 4 ));
-DATA(insert OID = 0 ( 403 754 413 5 ));
+DATA(insert ( 403 754 412 1 ));
+DATA(insert ( 403 754 414 2 ));
+DATA(insert ( 403 754 410 3 ));
+DATA(insert ( 403 754 415 4 ));
+DATA(insert ( 403 754 413 5 ));
/*
* nbtree oid_ops
*/
-DATA(insert OID = 0 ( 403 427 609 1 ));
-DATA(insert OID = 0 ( 403 427 611 2 ));
-DATA(insert OID = 0 ( 403 427 607 3 ));
-DATA(insert OID = 0 ( 403 427 612 4 ));
-DATA(insert OID = 0 ( 403 427 610 5 ));
+DATA(insert ( 403 427 609 1 ));
+DATA(insert ( 403 427 611 2 ));
+DATA(insert ( 403 427 607 3 ));
+DATA(insert ( 403 427 612 4 ));
+DATA(insert ( 403 427 610 5 ));
/*
* nbtree oidvector_ops
*/
-DATA(insert OID = 0 ( 403 435 645 1 ));
-DATA(insert OID = 0 ( 403 435 647 2 ));
-DATA(insert OID = 0 ( 403 435 649 3 ));
-DATA(insert OID = 0 ( 403 435 648 4 ));
-DATA(insert OID = 0 ( 403 435 646 5 ));
+DATA(insert ( 403 435 645 1 ));
+DATA(insert ( 403 435 647 2 ));
+DATA(insert ( 403 435 649 3 ));
+DATA(insert ( 403 435 648 4 ));
+DATA(insert ( 403 435 646 5 ));
/*
* nbtree float4_ops
*/
-DATA(insert OID = 0 ( 403 428 622 1 ));
-DATA(insert OID = 0 ( 403 428 624 2 ));
-DATA(insert OID = 0 ( 403 428 620 3 ));
-DATA(insert OID = 0 ( 403 428 625 4 ));
-DATA(insert OID = 0 ( 403 428 623 5 ));
+DATA(insert ( 403 428 622 1 ));
+DATA(insert ( 403 428 624 2 ));
+DATA(insert ( 403 428 620 3 ));
+DATA(insert ( 403 428 625 4 ));
+DATA(insert ( 403 428 623 5 ));
/*
* nbtree char_ops
*/
-DATA(insert OID = 0 ( 403 429 631 1 ));
-DATA(insert OID = 0 ( 403 429 632 2 ));
-DATA(insert OID = 0 ( 403 429 92 3 ));
-DATA(insert OID = 0 ( 403 429 634 4 ));
-DATA(insert OID = 0 ( 403 429 633 5 ));
+DATA(insert ( 403 429 631 1 ));
+DATA(insert ( 403 429 632 2 ));
+DATA(insert ( 403 429 92 3 ));
+DATA(insert ( 403 429 634 4 ));
+DATA(insert ( 403 429 633 5 ));
/*
* nbtree name_ops
*/
-DATA(insert OID = 0 ( 403 1181 660 1 ));
-DATA(insert OID = 0 ( 403 1181 661 2 ));
-DATA(insert OID = 0 ( 403 1181 93 3 ));
-DATA(insert OID = 0 ( 403 1181 663 4 ));
-DATA(insert OID = 0 ( 403 1181 662 5 ));
+DATA(insert ( 403 1181 660 1 ));
+DATA(insert ( 403 1181 661 2 ));
+DATA(insert ( 403 1181 93 3 ));
+DATA(insert ( 403 1181 663 4 ));
+DATA(insert ( 403 1181 662 5 ));
/*
* nbtree text_ops
*/
-DATA(insert OID = 0 ( 403 431 664 1 ));
-DATA(insert OID = 0 ( 403 431 665 2 ));
-DATA(insert OID = 0 ( 403 431 98 3 ));
-DATA(insert OID = 0 ( 403 431 667 4 ));
-DATA(insert OID = 0 ( 403 431 666 5 ));
+DATA(insert ( 403 431 664 1 ));
+DATA(insert ( 403 431 665 2 ));
+DATA(insert ( 403 431 98 3 ));
+DATA(insert ( 403 431 667 4 ));
+DATA(insert ( 403 431 666 5 ));
/*
* nbtree abstime_ops
*/
-DATA(insert OID = 0 ( 403 432 562 1 ));
-DATA(insert OID = 0 ( 403 432 564 2 ));
-DATA(insert OID = 0 ( 403 432 560 3 ));
-DATA(insert OID = 0 ( 403 432 565 4 ));
-DATA(insert OID = 0 ( 403 432 563 5 ));
+DATA(insert ( 403 432 562 1 ));
+DATA(insert ( 403 432 564 2 ));
+DATA(insert ( 403 432 560 3 ));
+DATA(insert ( 403 432 565 4 ));
+DATA(insert ( 403 432 563 5 ));
/*
* nbtree bpchar_ops
*/
-DATA(insert OID = 0 ( 403 1076 1058 1 ));
-DATA(insert OID = 0 ( 403 1076 1059 2 ));
-DATA(insert OID = 0 ( 403 1076 1054 3 ));
-DATA(insert OID = 0 ( 403 1076 1061 4 ));
-DATA(insert OID = 0 ( 403 1076 1060 5 ));
+DATA(insert ( 403 1076 1058 1 ));
+DATA(insert ( 403 1076 1059 2 ));
+DATA(insert ( 403 1076 1054 3 ));
+DATA(insert ( 403 1076 1061 4 ));
+DATA(insert ( 403 1076 1060 5 ));
/*
* nbtree varchar_ops
*/
-DATA(insert OID = 0 ( 403 1077 1066 1 ));
-DATA(insert OID = 0 ( 403 1077 1067 2 ));
-DATA(insert OID = 0 ( 403 1077 1062 3 ));
-DATA(insert OID = 0 ( 403 1077 1069 4 ));
-DATA(insert OID = 0 ( 403 1077 1068 5 ));
+DATA(insert ( 403 1077 1066 1 ));
+DATA(insert ( 403 1077 1067 2 ));
+DATA(insert ( 403 1077 1062 3 ));
+DATA(insert ( 403 1077 1069 4 ));
+DATA(insert ( 403 1077 1068 5 ));
/*
* nbtree date_ops
*/
-DATA(insert OID = 0 ( 403 1114 1095 1 ));
-DATA(insert OID = 0 ( 403 1114 1096 2 ));
-DATA(insert OID = 0 ( 403 1114 1093 3 ));
-DATA(insert OID = 0 ( 403 1114 1098 4 ));
-DATA(insert OID = 0 ( 403 1114 1097 5 ));
+DATA(insert ( 403 1114 1095 1 ));
+DATA(insert ( 403 1114 1096 2 ));
+DATA(insert ( 403 1114 1093 3 ));
+DATA(insert ( 403 1114 1098 4 ));
+DATA(insert ( 403 1114 1097 5 ));
/*
* nbtree time_ops
*/
-DATA(insert OID = 0 ( 403 1115 1110 1 ));
-DATA(insert OID = 0 ( 403 1115 1111 2 ));
-DATA(insert OID = 0 ( 403 1115 1108 3 ));
-DATA(insert OID = 0 ( 403 1115 1113 4 ));
-DATA(insert OID = 0 ( 403 1115 1112 5 ));
+DATA(insert ( 403 1115 1110 1 ));
+DATA(insert ( 403 1115 1111 2 ));
+DATA(insert ( 403 1115 1108 3 ));
+DATA(insert ( 403 1115 1113 4 ));
+DATA(insert ( 403 1115 1112 5 ));
/*
* nbtree timetz_ops
*/
-DATA(insert OID = 0 ( 403 1399 1552 1 ));
-DATA(insert OID = 0 ( 403 1399 1553 2 ));
-DATA(insert OID = 0 ( 403 1399 1550 3 ));
-DATA(insert OID = 0 ( 403 1399 1555 4 ));
-DATA(insert OID = 0 ( 403 1399 1554 5 ));
+DATA(insert ( 403 1399 1552 1 ));
+DATA(insert ( 403 1399 1553 2 ));
+DATA(insert ( 403 1399 1550 3 ));
+DATA(insert ( 403 1399 1555 4 ));
+DATA(insert ( 403 1399 1554 5 ));
/*
* nbtree timestamp_ops
*/
-DATA(insert OID = 0 ( 403 1312 1322 1 ));
-DATA(insert OID = 0 ( 403 1312 1323 2 ));
-DATA(insert OID = 0 ( 403 1312 1320 3 ));
-DATA(insert OID = 0 ( 403 1312 1325 4 ));
-DATA(insert OID = 0 ( 403 1312 1324 5 ));
+DATA(insert ( 403 1312 1322 1 ));
+DATA(insert ( 403 1312 1323 2 ));
+DATA(insert ( 403 1312 1320 3 ));
+DATA(insert ( 403 1312 1325 4 ));
+DATA(insert ( 403 1312 1324 5 ));
/*
* nbtree interval_ops
*/
-DATA(insert OID = 0 ( 403 1313 1332 1 ));
-DATA(insert OID = 0 ( 403 1313 1333 2 ));
-DATA(insert OID = 0 ( 403 1313 1330 3 ));
-DATA(insert OID = 0 ( 403 1313 1335 4 ));
-DATA(insert OID = 0 ( 403 1313 1334 5 ));
+DATA(insert ( 403 1313 1332 1 ));
+DATA(insert ( 403 1313 1333 2 ));
+DATA(insert ( 403 1313 1330 3 ));
+DATA(insert ( 403 1313 1335 4 ));
+DATA(insert ( 403 1313 1334 5 ));
/*
* nbtree macaddr
*/
-DATA(insert OID = 0 ( 403 810 1222 1 ));
-DATA(insert OID = 0 ( 403 810 1223 2 ));
-DATA(insert OID = 0 ( 403 810 1220 3 ));
-DATA(insert OID = 0 ( 403 810 1225 4 ));
-DATA(insert OID = 0 ( 403 810 1224 5 ));
+DATA(insert ( 403 810 1222 1 ));
+DATA(insert ( 403 810 1223 2 ));
+DATA(insert ( 403 810 1220 3 ));
+DATA(insert ( 403 810 1225 4 ));
+DATA(insert ( 403 810 1224 5 ));
/*
* nbtree inet
*/
-DATA(insert OID = 0 ( 403 935 1203 1 ));
-DATA(insert OID = 0 ( 403 935 1204 2 ));
-DATA(insert OID = 0 ( 403 935 1201 3 ));
-DATA(insert OID = 0 ( 403 935 1206 4 ));
-DATA(insert OID = 0 ( 403 935 1205 5 ));
+DATA(insert ( 403 935 1203 1 ));
+DATA(insert ( 403 935 1204 2 ));
+DATA(insert ( 403 935 1201 3 ));
+DATA(insert ( 403 935 1206 4 ));
+DATA(insert ( 403 935 1205 5 ));
/*
* nbtree cidr
*/
-DATA(insert OID = 0 ( 403 652 822 1 ));
-DATA(insert OID = 0 ( 403 652 823 2 ));
-DATA(insert OID = 0 ( 403 652 820 3 ));
-DATA(insert OID = 0 ( 403 652 825 4 ));
-DATA(insert OID = 0 ( 403 652 824 5 ));
+DATA(insert ( 403 652 822 1 ));
+DATA(insert ( 403 652 823 2 ));
+DATA(insert ( 403 652 820 3 ));
+DATA(insert ( 403 652 825 4 ));
+DATA(insert ( 403 652 824 5 ));
/*
* nbtree numeric
*/
-DATA(insert OID = 0 ( 403 1768 1754 1 ));
-DATA(insert OID = 0 ( 403 1768 1755 2 ));
-DATA(insert OID = 0 ( 403 1768 1752 3 ));
-DATA(insert OID = 0 ( 403 1768 1757 4 ));
-DATA(insert OID = 0 ( 403 1768 1756 5 ));
+DATA(insert ( 403 1768 1754 1 ));
+DATA(insert ( 403 1768 1755 2 ));
+DATA(insert ( 403 1768 1752 3 ));
+DATA(insert ( 403 1768 1757 4 ));
+DATA(insert ( 403 1768 1756 5 ));
/*
* nbtree bool
*/
-DATA(insert OID = 0 ( 403 1690 58 1 ));
-DATA(insert OID = 0 ( 403 1690 1694 2 ));
-DATA(insert OID = 0 ( 403 1690 91 3 ));
-DATA(insert OID = 0 ( 403 1690 1695 4 ));
-DATA(insert OID = 0 ( 403 1690 59 5 ));
+DATA(insert ( 403 1690 58 1 ));
+DATA(insert ( 403 1690 1694 2 ));
+DATA(insert ( 403 1690 91 3 ));
+DATA(insert ( 403 1690 1695 4 ));
+DATA(insert ( 403 1690 59 5 ));
/*
* nbtree bit
*/
-DATA(insert OID = 0 ( 403 424 1786 1 ));
-DATA(insert OID = 0 ( 403 424 1788 2 ));
-DATA(insert OID = 0 ( 403 424 1784 3 ));
-DATA(insert OID = 0 ( 403 424 1789 4 ));
-DATA(insert OID = 0 ( 403 424 1787 5 ));
+DATA(insert ( 403 424 1786 1 ));
+DATA(insert ( 403 424 1788 2 ));
+DATA(insert ( 403 424 1784 3 ));
+DATA(insert ( 403 424 1789 4 ));
+DATA(insert ( 403 424 1787 5 ));
/*
* nbtree varbit
*/
-DATA(insert OID = 0 ( 403 425 1806 1 ));
-DATA(insert OID = 0 ( 403 425 1808 2 ));
-DATA(insert OID = 0 ( 403 425 1804 3 ));
-DATA(insert OID = 0 ( 403 425 1809 4 ));
-DATA(insert OID = 0 ( 403 425 1807 5 ));
+DATA(insert ( 403 425 1806 1 ));
+DATA(insert ( 403 425 1808 2 ));
+DATA(insert ( 403 425 1804 3 ));
+DATA(insert ( 403 425 1809 4 ));
+DATA(insert ( 403 425 1807 5 ));
/*
*/
/* int2_ops */
-DATA(insert OID = 0 ( 405 421 94 1 ));
+DATA(insert ( 405 421 94 1 ));
/* float8_ops */
-DATA(insert OID = 0 ( 405 423 670 1 ));
+DATA(insert ( 405 423 670 1 ));
/* int4_ops */
-DATA(insert OID = 0 ( 405 426 96 1 ));
+DATA(insert ( 405 426 96 1 ));
/* int8_ops */
-DATA(insert OID = 0 ( 405 754 410 1 ));
+DATA(insert ( 405 754 410 1 ));
/* oid_ops */
-DATA(insert OID = 0 ( 405 427 607 1 ));
+DATA(insert ( 405 427 607 1 ));
/* oidvector_ops */
-DATA(insert OID = 0 ( 405 435 649 1 ));
+DATA(insert ( 405 435 649 1 ));
/* float4_ops */
-DATA(insert OID = 0 ( 405 428 620 1 ));
+DATA(insert ( 405 428 620 1 ));
/* char_ops */
-DATA(insert OID = 0 ( 405 429 92 1 ));
+DATA(insert ( 405 429 92 1 ));
/* name_ops */
-DATA(insert OID = 0 ( 405 1181 93 1 ));
+DATA(insert ( 405 1181 93 1 ));
/* text_ops */
-DATA(insert OID = 0 ( 405 431 98 1 ));
+DATA(insert ( 405 431 98 1 ));
/* bpchar_ops */
-DATA(insert OID = 0 ( 405 1076 1054 1 ));
+DATA(insert ( 405 1076 1054 1 ));
/* varchar_ops */
-DATA(insert OID = 0 ( 405 1077 1062 1 ));
+DATA(insert ( 405 1077 1062 1 ));
/* date_ops */
-DATA(insert OID = 0 ( 405 1114 1093 1 ));
+DATA(insert ( 405 1114 1093 1 ));
/* time_ops */
-DATA(insert OID = 0 ( 405 1115 1108 1 ));
+DATA(insert ( 405 1115 1108 1 ));
/* timetz_ops */
-DATA(insert OID = 0 ( 405 1399 1550 1 ));
+DATA(insert ( 405 1399 1550 1 ));
/* timestamp_ops */
-DATA(insert OID = 0 ( 405 1312 1320 1 ));
+DATA(insert ( 405 1312 1320 1 ));
/* interval_ops */
-DATA(insert OID = 0 ( 405 1313 1330 1 ));
+DATA(insert ( 405 1313 1330 1 ));
/* macaddr_ops */
-DATA(insert OID = 0 ( 405 810 1220 1 ));
+DATA(insert ( 405 810 1220 1 ));
/* inet_ops */
-DATA(insert OID = 0 ( 405 935 1201 1 ));
+DATA(insert ( 405 935 1201 1 ));
/* cidr_ops */
-DATA(insert OID = 0 ( 405 652 820 1 ));
+DATA(insert ( 405 652 820 1 ));
#endif /* PG_AMOP_H */
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_amproc.h,v 1.27 2001/01/24 19:43:20 momjian Exp $
+ * $Id: pg_amproc.h,v 1.28 2001/08/10 18:57:39 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
* typedef struct FormData_pg_amproc
* ----------------
*/
-CATALOG(pg_amproc)
+CATALOG(pg_amproc) BKI_WITHOUT_OIDS
{
Oid amid; /* the access method this proc is for */
Oid amopclaid; /* the opclass this proc is for */
*/
/* rtree */
-DATA(insert OID = 0 (402 422 193 1));
-DATA(insert OID = 0 (402 422 194 2));
-DATA(insert OID = 0 (402 422 195 3));
-DATA(insert OID = 0 (402 433 193 1));
-DATA(insert OID = 0 (402 433 194 2));
-DATA(insert OID = 0 (402 433 196 3));
-DATA(insert OID = 0 (402 434 197 1));
-DATA(insert OID = 0 (402 434 198 2));
-DATA(insert OID = 0 (402 434 199 3));
+DATA(insert (402 422 193 1));
+DATA(insert (402 422 194 2));
+DATA(insert (402 422 195 3));
+DATA(insert (402 433 193 1));
+DATA(insert (402 433 194 2));
+DATA(insert (402 433 196 3));
+DATA(insert (402 434 197 1));
+DATA(insert (402 434 198 2));
+DATA(insert (402 434 199 3));
/* btree */
-DATA(insert OID = 0 (403 421 350 1));
-DATA(insert OID = 0 (403 423 355 1));
-DATA(insert OID = 0 (403 426 351 1));
-DATA(insert OID = 0 (403 427 356 1));
-DATA(insert OID = 0 (403 428 354 1));
-DATA(insert OID = 0 (403 429 358 1));
-DATA(insert OID = 0 (403 431 360 1));
-DATA(insert OID = 0 (403 432 357 1));
-DATA(insert OID = 0 (403 435 404 1));
-DATA(insert OID = 0 (403 754 842 1));
-DATA(insert OID = 0 (403 1076 1078 1));
-DATA(insert OID = 0 (403 1077 1079 1));
-DATA(insert OID = 0 (403 1114 1092 1));
-DATA(insert OID = 0 (403 1115 1107 1));
-DATA(insert OID = 0 (403 1181 359 1));
-DATA(insert OID = 0 (403 1312 1314 1));
-DATA(insert OID = 0 (403 1313 1315 1));
-DATA(insert OID = 0 (403 810 836 1));
-DATA(insert OID = 0 (403 935 926 1));
-DATA(insert OID = 0 (403 652 926 1));
-DATA(insert OID = 0 (403 1768 1769 1));
-DATA(insert OID = 0 (403 1690 1693 1));
-DATA(insert OID = 0 (403 1399 1358 1));
-DATA(insert OID = 0 (403 424 1596 1));
-DATA(insert OID = 0 (403 425 1672 1));
+DATA(insert (403 421 350 1));
+DATA(insert (403 423 355 1));
+DATA(insert (403 426 351 1));
+DATA(insert (403 427 356 1));
+DATA(insert (403 428 354 1));
+DATA(insert (403 429 358 1));
+DATA(insert (403 431 360 1));
+DATA(insert (403 432 357 1));
+DATA(insert (403 435 404 1));
+DATA(insert (403 754 842 1));
+DATA(insert (403 1076 1078 1));
+DATA(insert (403 1077 1079 1));
+DATA(insert (403 1114 1092 1));
+DATA(insert (403 1115 1107 1));
+DATA(insert (403 1181 359 1));
+DATA(insert (403 1312 1314 1));
+DATA(insert (403 1313 1315 1));
+DATA(insert (403 810 836 1));
+DATA(insert (403 935 926 1));
+DATA(insert (403 652 926 1));
+DATA(insert (403 1768 1769 1));
+DATA(insert (403 1690 1693 1));
+DATA(insert (403 1399 1358 1));
+DATA(insert (403 424 1596 1));
+DATA(insert (403 425 1672 1));
/* hash */
-DATA(insert OID = 0 (405 421 449 1));
-DATA(insert OID = 0 (405 423 452 1));
-DATA(insert OID = 0 (405 426 450 1));
-DATA(insert OID = 0 (405 427 453 1));
-DATA(insert OID = 0 (405 428 451 1));
-DATA(insert OID = 0 (405 429 454 1));
-DATA(insert OID = 0 (405 431 456 1));
-DATA(insert OID = 0 (405 435 457 1));
-DATA(insert OID = 0 (405 652 456 1));
-DATA(insert OID = 0 (405 754 949 1));
-DATA(insert OID = 0 (405 810 399 1));
-DATA(insert OID = 0 (405 935 456 1));
-DATA(insert OID = 0 (405 1076 1080 1));
-DATA(insert OID = 0 (405 1077 456 1));
-DATA(insert OID = 0 (405 1114 450 1));
-DATA(insert OID = 0 (405 1115 452 1));
-DATA(insert OID = 0 (405 1181 455 1));
-DATA(insert OID = 0 (405 1312 452 1));
-DATA(insert OID = 0 (405 1313 1697 1));
-DATA(insert OID = 0 (405 1399 1696 1));
+DATA(insert (405 421 449 1));
+DATA(insert (405 423 452 1));
+DATA(insert (405 426 450 1));
+DATA(insert (405 427 453 1));
+DATA(insert (405 428 451 1));
+DATA(insert (405 429 454 1));
+DATA(insert (405 431 456 1));
+DATA(insert (405 435 457 1));
+DATA(insert (405 652 456 1));
+DATA(insert (405 754 949 1));
+DATA(insert (405 810 399 1));
+DATA(insert (405 935 456 1));
+DATA(insert (405 1076 1080 1));
+DATA(insert (405 1077 456 1));
+DATA(insert (405 1114 450 1));
+DATA(insert (405 1115 452 1));
+DATA(insert (405 1181 455 1));
+DATA(insert (405 1312 452 1));
+DATA(insert (405 1313 1697 1));
+DATA(insert (405 1399 1696 1));
#endif /* PG_AMPROC_H */
* typedef struct FormData_pg_attrdef
* ----------------
*/
-CATALOG(pg_attrdef)
+CATALOG(pg_attrdef) BKI_WITHOUT_OIDS
{
Oid adrelid;
int2 adnum;
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_attribute.h,v 1.73 2001/06/12 05:55:50 tgl Exp $
+ * $Id: pg_attribute.h,v 1.74 2001/08/10 18:57:40 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
- * utils/cache/relcache.c requires some hard-coded tuple descriptors
- * for some of the system catalogs so if the schema for any of
+ * utils/cache/relcache.c requires hard-coded tuple descriptors
+ * for some of the system catalogs. So if the schema for any of
* these changes, be sure and change the appropriate Schema_xxx
* macros! -cim 2/5/91
*
* system attributes in catalog/heap.c also.
* ----------------
*/
-CATALOG(pg_attribute) BOOTSTRAP
+CATALOG(pg_attribute) BOOTSTRAP BKI_WITHOUT_OIDS
{
Oid attrelid; /* OID of relation containing this
* attribute */
{ 1247, {"typstorage"}, 18, 0, 1, 16, 0, -1, -1, true, 'p', false, 'c', false, false }, \
{ 1247, {"typdefault"}, 25, 0, -1, 17, 0, -1, -1, false , 'x', false, 'i', false, false }
-DATA(insert OID = 0 ( 1247 typname 19 DEFAULT_ATTSTATTARGET NAMEDATALEN 1 0 -1 -1 f p f i f f));
-DATA(insert OID = 0 ( 1247 typowner 23 0 4 2 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1247 typlen 21 0 2 3 0 -1 -1 t p f s f f));
-DATA(insert OID = 0 ( 1247 typprtlen 21 0 2 4 0 -1 -1 t p f s f f));
-DATA(insert OID = 0 ( 1247 typbyval 16 0 1 5 0 -1 -1 t p f c f f));
-DATA(insert OID = 0 ( 1247 typtype 18 0 1 6 0 -1 -1 t p f c f f));
-DATA(insert OID = 0 ( 1247 typisdefined 16 0 1 7 0 -1 -1 t p f c f f));
-DATA(insert OID = 0 ( 1247 typdelim 18 0 1 8 0 -1 -1 t p f c f f));
-DATA(insert OID = 0 ( 1247 typrelid 26 0 4 9 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1247 typelem 26 0 4 10 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1247 typinput 24 0 4 11 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1247 typoutput 24 0 4 12 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1247 typreceive 24 0 4 13 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1247 typsend 24 0 4 14 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1247 typalign 18 0 1 15 0 -1 -1 t p f c f f));
-DATA(insert OID = 0 ( 1247 typstorage 18 0 1 16 0 -1 -1 t p f c f f));
-DATA(insert OID = 0 ( 1247 typdefault 25 0 -1 17 0 -1 -1 f x f i f f));
-DATA(insert OID = 0 ( 1247 ctid 27 0 6 -1 0 -1 -1 f p f i f f));
-DATA(insert OID = 0 ( 1247 oid 26 0 4 -2 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1247 xmin 28 0 4 -3 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1247 cmin 29 0 4 -4 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1247 xmax 28 0 4 -5 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1247 cmax 29 0 4 -6 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1247 tableoid 26 0 4 -7 0 -1 -1 t p f i f f));
+DATA(insert ( 1247 typname 19 DEFAULT_ATTSTATTARGET NAMEDATALEN 1 0 -1 -1 f p f i f f));
+DATA(insert ( 1247 typowner 23 0 4 2 0 -1 -1 t p f i f f));
+DATA(insert ( 1247 typlen 21 0 2 3 0 -1 -1 t p f s f f));
+DATA(insert ( 1247 typprtlen 21 0 2 4 0 -1 -1 t p f s f f));
+DATA(insert ( 1247 typbyval 16 0 1 5 0 -1 -1 t p f c f f));
+DATA(insert ( 1247 typtype 18 0 1 6 0 -1 -1 t p f c f f));
+DATA(insert ( 1247 typisdefined 16 0 1 7 0 -1 -1 t p f c f f));
+DATA(insert ( 1247 typdelim 18 0 1 8 0 -1 -1 t p f c f f));
+DATA(insert ( 1247 typrelid 26 0 4 9 0 -1 -1 t p f i f f));
+DATA(insert ( 1247 typelem 26 0 4 10 0 -1 -1 t p f i f f));
+DATA(insert ( 1247 typinput 24 0 4 11 0 -1 -1 t p f i f f));
+DATA(insert ( 1247 typoutput 24 0 4 12 0 -1 -1 t p f i f f));
+DATA(insert ( 1247 typreceive 24 0 4 13 0 -1 -1 t p f i f f));
+DATA(insert ( 1247 typsend 24 0 4 14 0 -1 -1 t p f i f f));
+DATA(insert ( 1247 typalign 18 0 1 15 0 -1 -1 t p f c f f));
+DATA(insert ( 1247 typstorage 18 0 1 16 0 -1 -1 t p f c f f));
+DATA(insert ( 1247 typdefault 25 0 -1 17 0 -1 -1 f x f i f f));
+DATA(insert ( 1247 ctid 27 0 6 -1 0 -1 -1 f p f i f f));
+DATA(insert ( 1247 oid 26 0 4 -2 0 -1 -1 t p f i f f));
+DATA(insert ( 1247 xmin 28 0 4 -3 0 -1 -1 t p f i f f));
+DATA(insert ( 1247 cmin 29 0 4 -4 0 -1 -1 t p f i f f));
+DATA(insert ( 1247 xmax 28 0 4 -5 0 -1 -1 t p f i f f));
+DATA(insert ( 1247 cmax 29 0 4 -6 0 -1 -1 t p f i f f));
+DATA(insert ( 1247 tableoid 26 0 4 -7 0 -1 -1 t p f i f f));
/* ----------------
* pg_database
* ----------------
*/
-DATA(insert OID = 0 ( 1262 datname 19 0 NAMEDATALEN 1 0 -1 -1 f p f i f f));
-DATA(insert OID = 0 ( 1262 datdba 23 0 4 2 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1262 encoding 23 0 4 3 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1262 datistemplate 16 0 1 4 0 -1 -1 t p f c f f));
-DATA(insert OID = 0 ( 1262 datallowconn 16 0 1 5 0 -1 -1 t p f c f f));
-DATA(insert OID = 0 ( 1262 datlastsysoid 26 0 4 6 0 -1 -1 t p f i f f));
+DATA(insert ( 1262 datname 19 0 NAMEDATALEN 1 0 -1 -1 f p f i f f));
+DATA(insert ( 1262 datdba 23 0 4 2 0 -1 -1 t p f i f f));
+DATA(insert ( 1262 encoding 23 0 4 3 0 -1 -1 t p f i f f));
+DATA(insert ( 1262 datistemplate 16 0 1 4 0 -1 -1 t p f c f f));
+DATA(insert ( 1262 datallowconn 16 0 1 5 0 -1 -1 t p f c f f));
+DATA(insert ( 1262 datlastsysoid 26 0 4 6 0 -1 -1 t p f i f f));
/* do not mark datpath as toastable; GetRawDatabaseInfo won't cope */
-DATA(insert OID = 0 ( 1262 datpath 25 0 -1 7 0 -1 -1 f p f i f f));
-DATA(insert OID = 0 ( 1262 ctid 27 0 6 -1 0 -1 -1 f p f i f f));
-DATA(insert OID = 0 ( 1262 oid 26 0 4 -2 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1262 xmin 28 0 4 -3 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1262 cmin 29 0 4 -4 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1262 xmax 28 0 4 -5 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1262 cmax 29 0 4 -6 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1262 tableoid 26 0 4 -7 0 -1 -1 t p f i f f));
+DATA(insert ( 1262 datpath 25 0 -1 7 0 -1 -1 f p f i f f));
+DATA(insert ( 1262 ctid 27 0 6 -1 0 -1 -1 f p f i f f));
+DATA(insert ( 1262 oid 26 0 4 -2 0 -1 -1 t p f i f f));
+DATA(insert ( 1262 xmin 28 0 4 -3 0 -1 -1 t p f i f f));
+DATA(insert ( 1262 cmin 29 0 4 -4 0 -1 -1 t p f i f f));
+DATA(insert ( 1262 xmax 28 0 4 -5 0 -1 -1 t p f i f f));
+DATA(insert ( 1262 cmax 29 0 4 -6 0 -1 -1 t p f i f f));
+DATA(insert ( 1262 tableoid 26 0 4 -7 0 -1 -1 t p f i f f));
/* ----------------
* pg_proc
{ 1255, {"prosrc"}, 25, 0, -1, 16, 0, -1, -1, false, 'x', false, 'i', false, false }, \
{ 1255, {"probin"}, 17, 0, -1, 17, 0, -1, -1, false, 'x', false, 'i', false, false }
-DATA(insert OID = 0 ( 1255 proname 19 DEFAULT_ATTSTATTARGET NAMEDATALEN 1 0 -1 -1 f p f i f f));
-DATA(insert OID = 0 ( 1255 proowner 23 0 4 2 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1255 prolang 26 0 4 3 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1255 proisinh 16 0 1 4 0 -1 -1 t p f c f f));
-DATA(insert OID = 0 ( 1255 proistrusted 16 0 1 5 0 -1 -1 t p f c f f));
-DATA(insert OID = 0 ( 1255 proiscachable 16 0 1 6 0 -1 -1 t p f c f f));
-DATA(insert OID = 0 ( 1255 proisstrict 16 0 1 7 0 -1 -1 t p f c f f));
-DATA(insert OID = 0 ( 1255 pronargs 21 0 2 8 0 -1 -1 t p f s f f));
-DATA(insert OID = 0 ( 1255 proretset 16 0 1 9 0 -1 -1 t p f c f f));
-DATA(insert OID = 0 ( 1255 prorettype 26 0 4 10 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1255 proargtypes 30 0 INDEX_MAX_KEYS*4 11 0 -1 -1 f p f i f f));
-DATA(insert OID = 0 ( 1255 probyte_pct 23 0 4 12 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1255 properbyte_cpu 23 0 4 13 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1255 propercall_cpu 23 0 4 14 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1255 prooutin_ratio 23 0 4 15 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1255 prosrc 25 0 -1 16 0 -1 -1 f x f i f f));
-DATA(insert OID = 0 ( 1255 probin 17 0 -1 17 0 -1 -1 f x f i f f));
-DATA(insert OID = 0 ( 1255 ctid 27 0 6 -1 0 -1 -1 f p f i f f));
-DATA(insert OID = 0 ( 1255 oid 26 0 4 -2 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1255 xmin 28 0 4 -3 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1255 cmin 29 0 4 -4 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1255 xmax 28 0 4 -5 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1255 cmax 29 0 4 -6 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1255 tableoid 26 0 4 -7 0 -1 -1 t p f i f f));
+DATA(insert ( 1255 proname 19 DEFAULT_ATTSTATTARGET NAMEDATALEN 1 0 -1 -1 f p f i f f));
+DATA(insert ( 1255 proowner 23 0 4 2 0 -1 -1 t p f i f f));
+DATA(insert ( 1255 prolang 26 0 4 3 0 -1 -1 t p f i f f));
+DATA(insert ( 1255 proisinh 16 0 1 4 0 -1 -1 t p f c f f));
+DATA(insert ( 1255 proistrusted 16 0 1 5 0 -1 -1 t p f c f f));
+DATA(insert ( 1255 proiscachable 16 0 1 6 0 -1 -1 t p f c f f));
+DATA(insert ( 1255 proisstrict 16 0 1 7 0 -1 -1 t p f c f f));
+DATA(insert ( 1255 pronargs 21 0 2 8 0 -1 -1 t p f s f f));
+DATA(insert ( 1255 proretset 16 0 1 9 0 -1 -1 t p f c f f));
+DATA(insert ( 1255 prorettype 26 0 4 10 0 -1 -1 t p f i f f));
+DATA(insert ( 1255 proargtypes 30 0 INDEX_MAX_KEYS*4 11 0 -1 -1 f p f i f f));
+DATA(insert ( 1255 probyte_pct 23 0 4 12 0 -1 -1 t p f i f f));
+DATA(insert ( 1255 properbyte_cpu 23 0 4 13 0 -1 -1 t p f i f f));
+DATA(insert ( 1255 propercall_cpu 23 0 4 14 0 -1 -1 t p f i f f));
+DATA(insert ( 1255 prooutin_ratio 23 0 4 15 0 -1 -1 t p f i f f));
+DATA(insert ( 1255 prosrc 25 0 -1 16 0 -1 -1 f x f i f f));
+DATA(insert ( 1255 probin 17 0 -1 17 0 -1 -1 f x f i f f));
+DATA(insert ( 1255 ctid 27 0 6 -1 0 -1 -1 f p f i f f));
+DATA(insert ( 1255 oid 26 0 4 -2 0 -1 -1 t p f i f f));
+DATA(insert ( 1255 xmin 28 0 4 -3 0 -1 -1 t p f i f f));
+DATA(insert ( 1255 cmin 29 0 4 -4 0 -1 -1 t p f i f f));
+DATA(insert ( 1255 xmax 28 0 4 -5 0 -1 -1 t p f i f f));
+DATA(insert ( 1255 cmax 29 0 4 -6 0 -1 -1 t p f i f f));
+DATA(insert ( 1255 tableoid 26 0 4 -7 0 -1 -1 t p f i f f));
/* ----------------
* pg_shadow
* ----------------
*/
-DATA(insert OID = 0 ( 1260 usename 19 DEFAULT_ATTSTATTARGET NAMEDATALEN 1 0 -1 -1 f p f i f f));
-DATA(insert OID = 0 ( 1260 usesysid 23 DEFAULT_ATTSTATTARGET 4 2 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1260 usecreatedb 16 0 1 3 0 -1 -1 t p f c f f));
-DATA(insert OID = 0 ( 1260 usetrace 16 0 1 4 0 -1 -1 t p f c f f));
-DATA(insert OID = 0 ( 1260 usesuper 16 0 1 5 0 -1 -1 t p f c f f));
-DATA(insert OID = 0 ( 1260 usecatupd 16 0 1 6 0 -1 -1 t p f c f f));
-DATA(insert OID = 0 ( 1260 passwd 25 0 -1 7 0 -1 -1 f x f i f f));
-DATA(insert OID = 0 ( 1260 valuntil 702 0 4 8 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1260 ctid 27 0 6 -1 0 -1 -1 f p f i f f));
-DATA(insert OID = 0 ( 1260 oid 26 0 4 -2 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1260 xmin 28 0 4 -3 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1260 cmin 29 0 4 -4 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1260 xmax 28 0 4 -5 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1260 cmax 29 0 4 -6 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1260 tableoid 26 0 4 -7 0 -1 -1 t p f i f f));
+DATA(insert ( 1260 usename 19 DEFAULT_ATTSTATTARGET NAMEDATALEN 1 0 -1 -1 f p f i f f));
+DATA(insert ( 1260 usesysid 23 DEFAULT_ATTSTATTARGET 4 2 0 -1 -1 t p f i f f));
+DATA(insert ( 1260 usecreatedb 16 0 1 3 0 -1 -1 t p f c f f));
+DATA(insert ( 1260 usetrace 16 0 1 4 0 -1 -1 t p f c f f));
+DATA(insert ( 1260 usesuper 16 0 1 5 0 -1 -1 t p f c f f));
+DATA(insert ( 1260 usecatupd 16 0 1 6 0 -1 -1 t p f c f f));
+DATA(insert ( 1260 passwd 25 0 -1 7 0 -1 -1 f x f i f f));
+DATA(insert ( 1260 valuntil 702 0 4 8 0 -1 -1 t p f i f f));
+DATA(insert ( 1260 ctid 27 0 6 -1 0 -1 -1 f p f i f f));
+/* no OIDs in pg_shadow */
+DATA(insert ( 1260 xmin 28 0 4 -3 0 -1 -1 t p f i f f));
+DATA(insert ( 1260 cmin 29 0 4 -4 0 -1 -1 t p f i f f));
+DATA(insert ( 1260 xmax 28 0 4 -5 0 -1 -1 t p f i f f));
+DATA(insert ( 1260 cmax 29 0 4 -6 0 -1 -1 t p f i f f));
+DATA(insert ( 1260 tableoid 26 0 4 -7 0 -1 -1 t p f i f f));
/* ----------------
* pg_group
* ----------------
*/
-DATA(insert OID = 0 ( 1261 groname 19 DEFAULT_ATTSTATTARGET NAMEDATALEN 1 0 -1 -1 f p f i f f));
-DATA(insert OID = 0 ( 1261 grosysid 23 DEFAULT_ATTSTATTARGET 4 2 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1261 grolist 1007 0 -1 3 0 -1 -1 f x f i f f));
-DATA(insert OID = 0 ( 1261 ctid 27 0 6 -1 0 -1 -1 f p f i f f));
-DATA(insert OID = 0 ( 1261 oid 26 0 4 -2 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1261 xmin 28 0 4 -3 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1261 cmin 29 0 4 -4 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1261 xmax 28 0 4 -5 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1261 cmax 29 0 4 -6 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1261 tableoid 26 0 4 -7 0 -1 -1 t p f i f f));
+DATA(insert ( 1261 groname 19 DEFAULT_ATTSTATTARGET NAMEDATALEN 1 0 -1 -1 f p f i f f));
+DATA(insert ( 1261 grosysid 23 DEFAULT_ATTSTATTARGET 4 2 0 -1 -1 t p f i f f));
+DATA(insert ( 1261 grolist 1007 0 -1 3 0 -1 -1 f x f i f f));
+DATA(insert ( 1261 ctid 27 0 6 -1 0 -1 -1 f p f i f f));
+/* no OIDs in pg_group */
+DATA(insert ( 1261 xmin 28 0 4 -3 0 -1 -1 t p f i f f));
+DATA(insert ( 1261 cmin 29 0 4 -4 0 -1 -1 t p f i f f));
+DATA(insert ( 1261 xmax 28 0 4 -5 0 -1 -1 t p f i f f));
+DATA(insert ( 1261 cmax 29 0 4 -6 0 -1 -1 t p f i f f));
+DATA(insert ( 1261 tableoid 26 0 4 -7 0 -1 -1 t p f i f f));
/* ----------------
* pg_attribute
{ 1249, {"attnotnull"}, 16, 0, 1, 14, 0, -1, -1, true, 'p', false, 'c', false, false }, \
{ 1249, {"atthasdef"}, 16, 0, 1, 15, 0, -1, -1, true, 'p', false, 'c', false, false }
-DATA(insert OID = 0 ( 1249 attrelid 26 DEFAULT_ATTSTATTARGET 4 1 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1249 attname 19 DEFAULT_ATTSTATTARGET NAMEDATALEN 2 0 -1 -1 f p f i f f));
-DATA(insert OID = 0 ( 1249 atttypid 26 0 4 3 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1249 attstattarget 23 0 4 4 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1249 attlen 21 0 2 5 0 -1 -1 t p f s f f));
-DATA(insert OID = 0 ( 1249 attnum 21 0 2 6 0 -1 -1 t p f s f f));
-DATA(insert OID = 0 ( 1249 attndims 23 0 4 7 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1249 attcacheoff 23 0 4 8 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1249 atttypmod 23 0 4 9 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1249 attbyval 16 0 1 10 0 -1 -1 t p f c f f));
-DATA(insert OID = 0 ( 1249 attstorage 18 0 1 11 0 -1 -1 t p f c f f));
-DATA(insert OID = 0 ( 1249 attisset 16 0 1 12 0 -1 -1 t p f c f f));
-DATA(insert OID = 0 ( 1249 attalign 18 0 1 13 0 -1 -1 t p f c f f));
-DATA(insert OID = 0 ( 1249 attnotnull 16 0 1 14 0 -1 -1 t p f c f f));
-DATA(insert OID = 0 ( 1249 atthasdef 16 0 1 15 0 -1 -1 t p f c f f));
-DATA(insert OID = 0 ( 1249 ctid 27 0 6 -1 0 -1 -1 f p f i f f));
-DATA(insert OID = 0 ( 1249 oid 26 0 4 -2 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1249 xmin 28 0 4 -3 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1249 cmin 29 0 4 -4 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1249 xmax 28 0 4 -5 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1249 cmax 29 0 4 -6 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1249 tableoid 26 0 4 -7 0 -1 -1 t p f i f f));
+DATA(insert ( 1249 attrelid 26 DEFAULT_ATTSTATTARGET 4 1 0 -1 -1 t p f i f f));
+DATA(insert ( 1249 attname 19 DEFAULT_ATTSTATTARGET NAMEDATALEN 2 0 -1 -1 f p f i f f));
+DATA(insert ( 1249 atttypid 26 0 4 3 0 -1 -1 t p f i f f));
+DATA(insert ( 1249 attstattarget 23 0 4 4 0 -1 -1 t p f i f f));
+DATA(insert ( 1249 attlen 21 0 2 5 0 -1 -1 t p f s f f));
+DATA(insert ( 1249 attnum 21 0 2 6 0 -1 -1 t p f s f f));
+DATA(insert ( 1249 attndims 23 0 4 7 0 -1 -1 t p f i f f));
+DATA(insert ( 1249 attcacheoff 23 0 4 8 0 -1 -1 t p f i f f));
+DATA(insert ( 1249 atttypmod 23 0 4 9 0 -1 -1 t p f i f f));
+DATA(insert ( 1249 attbyval 16 0 1 10 0 -1 -1 t p f c f f));
+DATA(insert ( 1249 attstorage 18 0 1 11 0 -1 -1 t p f c f f));
+DATA(insert ( 1249 attisset 16 0 1 12 0 -1 -1 t p f c f f));
+DATA(insert ( 1249 attalign 18 0 1 13 0 -1 -1 t p f c f f));
+DATA(insert ( 1249 attnotnull 16 0 1 14 0 -1 -1 t p f c f f));
+DATA(insert ( 1249 atthasdef 16 0 1 15 0 -1 -1 t p f c f f));
+DATA(insert ( 1249 ctid 27 0 6 -1 0 -1 -1 f p f i f f));
+/* no OIDs in pg_attribute */
+DATA(insert ( 1249 xmin 28 0 4 -3 0 -1 -1 t p f i f f));
+DATA(insert ( 1249 cmin 29 0 4 -4 0 -1 -1 t p f i f f));
+DATA(insert ( 1249 xmax 28 0 4 -5 0 -1 -1 t p f i f f));
+DATA(insert ( 1249 cmax 29 0 4 -6 0 -1 -1 t p f i f f));
+DATA(insert ( 1249 tableoid 26 0 4 -7 0 -1 -1 t p f i f f));
/* ----------------
* pg_class
{ 1259, {"relukeys"}, 21, 0, 2, 16, 0, -1, -1, true, 'p', false, 's', false, false }, \
{ 1259, {"relfkeys"}, 21, 0, 2, 17, 0, -1, -1, true, 'p', false, 's', false, false }, \
{ 1259, {"relrefs"}, 21, 0, 2, 18, 0, -1, -1, true, 'p', false, 's', false, false }, \
-{ 1259, {"relhaspkey"}, 16, 0, 1, 19, 0, -1, -1, true, 'p', false, 'c', false, false }, \
-{ 1259, {"relhasrules"}, 16, 0, 1, 20, 0, -1, -1, true, 'p', false, 'c', false, false }, \
-{ 1259, {"relhassubclass"},16, 0, 1, 21, 0, -1, -1, true, 'p', false, 'c', false, false }, \
-{ 1259, {"relacl"}, 1034, 0, -1, 22, 0, -1, -1, false, 'x', false, 'i', false, false }
-
-DATA(insert OID = 0 ( 1259 relname 19 DEFAULT_ATTSTATTARGET NAMEDATALEN 1 0 -1 -1 f p f i f f));
-DATA(insert OID = 0 ( 1259 reltype 26 0 4 2 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1259 relowner 23 0 4 3 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1259 relam 26 0 4 4 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1259 relfilenode 26 0 4 5 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1259 relpages 23 0 4 6 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1259 reltuples 700 0 4 7 0 -1 -1 f p f i f f));
-DATA(insert OID = 0 ( 1259 reltoastrelid 26 0 4 8 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1259 reltoastidxid 26 0 4 9 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1259 relhasindex 16 0 1 10 0 -1 -1 t p f c f f));
-DATA(insert OID = 0 ( 1259 relisshared 16 0 1 11 0 -1 -1 t p f c f f));
-DATA(insert OID = 0 ( 1259 relkind 18 0 1 12 0 -1 -1 t p f c f f));
-DATA(insert OID = 0 ( 1259 relnatts 21 0 2 13 0 -1 -1 t p f s f f));
-DATA(insert OID = 0 ( 1259 relchecks 21 0 2 14 0 -1 -1 t p f s f f));
-DATA(insert OID = 0 ( 1259 reltriggers 21 0 2 15 0 -1 -1 t p f s f f));
-DATA(insert OID = 0 ( 1259 relukeys 21 0 2 16 0 -1 -1 t p f s f f));
-DATA(insert OID = 0 ( 1259 relfkeys 21 0 2 17 0 -1 -1 t p f s f f));
-DATA(insert OID = 0 ( 1259 relrefs 21 0 2 18 0 -1 -1 t p f s f f));
-DATA(insert OID = 0 ( 1259 relhaspkey 16 0 1 19 0 -1 -1 t p f c f f));
-DATA(insert OID = 0 ( 1259 relhasrules 16 0 1 20 0 -1 -1 t p f c f f));
-DATA(insert OID = 0 ( 1259 relhassubclass 16 0 1 21 0 -1 -1 t p f c f f));
-DATA(insert OID = 0 ( 1259 relacl 1034 0 -1 22 0 -1 -1 f x f i f f));
-DATA(insert OID = 0 ( 1259 ctid 27 0 6 -1 0 -1 -1 f p f i f f));
-DATA(insert OID = 0 ( 1259 oid 26 0 4 -2 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1259 xmin 28 0 4 -3 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1259 cmin 29 0 4 -4 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1259 xmax 28 0 4 -5 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1259 cmax 29 0 4 -6 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1259 tableoid 26 0 4 -7 0 -1 -1 t p f i f f));
+{ 1259, {"relhasoids"}, 16, 0, 1, 19, 0, -1, -1, true, 'p', false, 'c', false, false }, \
+{ 1259, {"relhaspkey"}, 16, 0, 1, 20, 0, -1, -1, true, 'p', false, 'c', false, false }, \
+{ 1259, {"relhasrules"}, 16, 0, 1, 21, 0, -1, -1, true, 'p', false, 'c', false, false }, \
+{ 1259, {"relhassubclass"},16, 0, 1, 22, 0, -1, -1, true, 'p', false, 'c', false, false }, \
+{ 1259, {"relacl"}, 1034, 0, -1, 23, 0, -1, -1, false, 'x', false, 'i', false, false }
+
+DATA(insert ( 1259 relname 19 DEFAULT_ATTSTATTARGET NAMEDATALEN 1 0 -1 -1 f p f i f f));
+DATA(insert ( 1259 reltype 26 0 4 2 0 -1 -1 t p f i f f));
+DATA(insert ( 1259 relowner 23 0 4 3 0 -1 -1 t p f i f f));
+DATA(insert ( 1259 relam 26 0 4 4 0 -1 -1 t p f i f f));
+DATA(insert ( 1259 relfilenode 26 0 4 5 0 -1 -1 t p f i f f));
+DATA(insert ( 1259 relpages 23 0 4 6 0 -1 -1 t p f i f f));
+DATA(insert ( 1259 reltuples 700 0 4 7 0 -1 -1 f p f i f f));
+DATA(insert ( 1259 reltoastrelid 26 0 4 8 0 -1 -1 t p f i f f));
+DATA(insert ( 1259 reltoastidxid 26 0 4 9 0 -1 -1 t p f i f f));
+DATA(insert ( 1259 relhasindex 16 0 1 10 0 -1 -1 t p f c f f));
+DATA(insert ( 1259 relisshared 16 0 1 11 0 -1 -1 t p f c f f));
+DATA(insert ( 1259 relkind 18 0 1 12 0 -1 -1 t p f c f f));
+DATA(insert ( 1259 relnatts 21 0 2 13 0 -1 -1 t p f s f f));
+DATA(insert ( 1259 relchecks 21 0 2 14 0 -1 -1 t p f s f f));
+DATA(insert ( 1259 reltriggers 21 0 2 15 0 -1 -1 t p f s f f));
+DATA(insert ( 1259 relukeys 21 0 2 16 0 -1 -1 t p f s f f));
+DATA(insert ( 1259 relfkeys 21 0 2 17 0 -1 -1 t p f s f f));
+DATA(insert ( 1259 relrefs 21 0 2 18 0 -1 -1 t p f s f f));
+DATA(insert ( 1259 relhasoids 16 0 1 19 0 -1 -1 t p f c f f));
+DATA(insert ( 1259 relhaspkey 16 0 1 20 0 -1 -1 t p f c f f));
+DATA(insert ( 1259 relhasrules 16 0 1 21 0 -1 -1 t p f c f f));
+DATA(insert ( 1259 relhassubclass 16 0 1 22 0 -1 -1 t p f c f f));
+DATA(insert ( 1259 relacl 1034 0 -1 23 0 -1 -1 f x f i f f));
+DATA(insert ( 1259 ctid 27 0 6 -1 0 -1 -1 f p f i f f));
+DATA(insert ( 1259 oid 26 0 4 -2 0 -1 -1 t p f i f f));
+DATA(insert ( 1259 xmin 28 0 4 -3 0 -1 -1 t p f i f f));
+DATA(insert ( 1259 cmin 29 0 4 -4 0 -1 -1 t p f i f f));
+DATA(insert ( 1259 xmax 28 0 4 -5 0 -1 -1 t p f i f f));
+DATA(insert ( 1259 cmax 29 0 4 -6 0 -1 -1 t p f i f f));
+DATA(insert ( 1259 tableoid 26 0 4 -7 0 -1 -1 t p f i f f));
/* ----------------
* pg_log - this relation is modified by special purpose access
#define Schema_pg_log \
{ 1269, {"logfoo"}, 26, 0, 4, 1, 0, -1, -1, true, 'p', false, 'i', false, false }
-DATA(insert OID = 0 ( 1269 logfoo 26 0 4 1 0 -1 -1 t p f i f f));
+DATA(insert ( 1269 logfoo 26 0 4 1 0 -1 -1 t p f i f f));
/* ----------------
* pg_xactlock - this relation is modified by special purpose access
#define Schema_pg_xactlock \
{ 376, {"xactlockfoo"}, 26, 0, 4, 1, 0, -1, -1, true, 'p', false, 'i', false, false }
-DATA(insert OID = 0 ( 376 xactlockfoo 26 0 4 1 0 -1 -1 t p f i f f));
+DATA(insert ( 376 xactlockfoo 26 0 4 1 0 -1 -1 t p f i f f));
#endif /* PG_ATTRIBUTE_H */
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_class.h,v 1.51 2001/06/12 05:55:50 tgl Exp $
+ * $Id: pg_class.h,v 1.52 2001/08/10 18:57:40 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
*/
CATALOG(pg_class) BOOTSTRAP
{
- NameData relname;
- Oid reltype;
- int4 relowner;
- Oid relam;
- Oid relfilenode;
- int4 relpages;
- float4 reltuples;
- Oid reltoastrelid;
- Oid reltoastidxid;
- bool relhasindex;
- bool relisshared;
- char relkind;
- int2 relnatts;
+ NameData relname; /* class name */
+ Oid reltype; /* OID of associated entry in pg_type */
+ int4 relowner; /* class owner */
+ Oid relam; /* index access method; 0 if not an index */
+ Oid relfilenode; /* identifier of physical storage file */
+ int4 relpages; /* # of blocks (not always up-to-date) */
+ float4 reltuples; /* # of tuples (not always up-to-date) */
+ Oid reltoastrelid; /* OID of toast table; 0 if none */
+ Oid reltoastidxid; /* if toast table, OID of chunk_id index */
+ bool relhasindex; /* T if has (or has had) any indexes */
+ bool relisshared; /* T if shared across databases */
+ char relkind; /* see RELKIND_xxx constants below */
+ int2 relnatts; /* number of user attributes */
/*
- * relnatts is the number of user attributes this class has. There
- * must be exactly this many instances in Class pg_attribute for this
- * class that have attnum > 0 (= user attribute).
+ * Class pg_attribute must contain exactly "relnatts" user attributes
+ * (with attnums ranging from 1 to relnatts) for this class. It may
+ * also contain entries with negative attnums for system attributes.
*/
int2 relchecks; /* # of CHECK constraints for class */
int2 reltriggers; /* # of TRIGGERs */
int2 relukeys; /* # of Unique keys (not used) */
int2 relfkeys; /* # of FOREIGN KEYs (not used) */
int2 relrefs; /* # of references to this rel (not used) */
- bool relhaspkey; /* has PRIMARY KEY (not used) */
+ bool relhasoids; /* T if we generate OIDs for rows of rel */
+ bool relhaspkey; /* has PRIMARY KEY index */
bool relhasrules; /* has associated rules */
bool relhassubclass; /* has derived classes */
/*
/* ----------------
* Natts_pg_class_fixed is used to tell routines that insert new
* pg_class tuples (as opposed to replacing old ones) that there's no
- * relacl field.
+ * relacl field. This is a kluge.
* ----------------
*/
-#define Natts_pg_class_fixed 21
-#define Natts_pg_class 22
+#define Natts_pg_class_fixed 22
+#define Natts_pg_class 23
#define Anum_pg_class_relname 1
#define Anum_pg_class_reltype 2
#define Anum_pg_class_relowner 3
#define Anum_pg_class_relukeys 16
#define Anum_pg_class_relfkeys 17
#define Anum_pg_class_relrefs 18
-#define Anum_pg_class_relhaspkey 19
-#define Anum_pg_class_relhasrules 20
-#define Anum_pg_class_relhassubclass 21
-#define Anum_pg_class_relacl 22
+#define Anum_pg_class_relhasoids 19
+#define Anum_pg_class_relhaspkey 20
+#define Anum_pg_class_relhasrules 21
+#define Anum_pg_class_relhassubclass 22
+#define Anum_pg_class_relacl 23
/* ----------------
* initial contents of pg_class
* ----------------
*/
-DATA(insert OID = 1247 ( pg_type 71 PGUID 0 1247 0 0 0 0 f f r 17 0 0 0 0 0 f f f _null_ ));
+DATA(insert OID = 1247 ( pg_type 71 PGUID 0 1247 0 0 0 0 f f r 17 0 0 0 0 0 t f f f _null_ ));
DESCR("");
-DATA(insert OID = 1249 ( pg_attribute 75 PGUID 0 1249 0 0 0 0 f f r 15 0 0 0 0 0 f f f _null_ ));
+DATA(insert OID = 1249 ( pg_attribute 75 PGUID 0 1249 0 0 0 0 f f r 15 0 0 0 0 0 f f f f _null_ ));
DESCR("");
-DATA(insert OID = 1255 ( pg_proc 81 PGUID 0 1255 0 0 0 0 f f r 17 0 0 0 0 0 f f f _null_ ));
+DATA(insert OID = 1255 ( pg_proc 81 PGUID 0 1255 0 0 0 0 f f r 17 0 0 0 0 0 t f f f _null_ ));
DESCR("");
-DATA(insert OID = 1259 ( pg_class 83 PGUID 0 1259 0 0 0 0 f f r 22 0 0 0 0 0 f f f _null_ ));
+DATA(insert OID = 1259 ( pg_class 83 PGUID 0 1259 0 0 0 0 f f r 23 0 0 0 0 0 t f f f _null_ ));
DESCR("");
-DATA(insert OID = 1260 ( pg_shadow 86 PGUID 0 1260 0 0 0 0 f t r 8 0 0 0 0 0 f f f _null_ ));
+DATA(insert OID = 1260 ( pg_shadow 86 PGUID 0 1260 0 0 0 0 f t r 8 0 0 0 0 0 f f f f _null_ ));
DESCR("");
-DATA(insert OID = 1261 ( pg_group 87 PGUID 0 1261 0 0 0 0 f t r 3 0 0 0 0 0 f f f _null_ ));
+DATA(insert OID = 1261 ( pg_group 87 PGUID 0 1261 0 0 0 0 f t r 3 0 0 0 0 0 f f f f _null_ ));
DESCR("");
-DATA(insert OID = 1262 ( pg_database 88 PGUID 0 1262 0 0 0 0 f t r 7 0 0 0 0 0 f f f _null_ ));
+DATA(insert OID = 1262 ( pg_database 88 PGUID 0 1262 0 0 0 0 f t r 7 0 0 0 0 0 t f f f _null_ ));
DESCR("");
-DATA(insert OID = 1269 ( pg_log 99 PGUID 0 1269 0 0 0 0 f t s 1 0 0 0 0 0 f f f _null_ ));
+DATA(insert OID = 1269 ( pg_log 99 PGUID 0 1269 0 0 0 0 f t s 1 0 0 0 0 0 f f f f _null_ ));
DESCR("");
-DATA(insert OID = 376 ( pg_xactlock 0 PGUID 0 0 0 0 0 0 f t s 1 0 0 0 0 0 f f f _null_ ));
+DATA(insert OID = 376 ( pg_xactlock 0 PGUID 0 0 0 0 0 0 f t s 1 0 0 0 0 0 f f f f _null_ ));
DESCR("");
#define RelOid_pg_type 1247
* pg_description.h
* definition of the system "description" relation (pg_description)
*
+ * NOTE: an object is identified by the OID of the row that primarily
+ * defines the object, plus the OID of the table that that row appears in.
+ * For example, a function is identified by the OID of its pg_proc row
+ * plus the pg_class OID of table pg_proc. This allows unique identification
+ * of objects without assuming that OIDs are unique across tables.
+ *
+ * Since attributes don't have OIDs of their own, we identify an attribute
+ * comment by the objoid+classoid of its parent table, plus an "objsubid"
+ * giving the attribute column number. "objsubid" must be zero in a comment
+ * for a table itself, so that it is distinct from any column comment.
+ * Currently, objsubid is unused and zero for all other kinds of objects,
+ * but perhaps it might be useful someday to associate comments with
+ * constituent elements of other kinds of objects (arguments of a function,
+ * for example).
+ *
*
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_description.h,v 1.12 2001/01/24 19:43:21 momjian Exp $
+ * $Id: pg_description.h,v 1.13 2001/08/10 18:57:40 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
* typedef struct FormData_pg_description
* ----------------
*/
-CATALOG(pg_description)
+CATALOG(pg_description) BKI_WITHOUT_OIDS
{
- Oid objoid;
- text description;
+ Oid objoid; /* OID of object itself */
+ Oid classoid; /* OID of table containing object */
+ int4 objsubid; /* column number, or 0 if not used */
+ text description; /* description of object */
} FormData_pg_description;
/* ----------------
* compiler constants for pg_descrpition
* ----------------
*/
-#define Natts_pg_description 2
+#define Natts_pg_description 4
#define Anum_pg_description_objoid 1
-#define Anum_pg_description_description 2
+#define Anum_pg_description_classoid 2
+#define Anum_pg_description_objsubid 3
+#define Anum_pg_description_description 4
/* ----------------
* initial contents of pg_description
/*
* Because the contents of this table are taken from the other *.h files,
- * there is no initialization. It is loaded from initdb using a COPY
- * statement.
+ * there is no initialization here. The initial contents are extracted
+ * by genbki.sh and loaded during initdb.
*/
#endif /* PG_DESCRIPTION_H */
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_group.h,v 1.9 2001/01/24 19:43:21 momjian Exp $
+ * $Id: pg_group.h,v 1.10 2001/08/10 18:57:40 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
* ----------------
*/
-CATALOG(pg_group) BOOTSTRAP
+CATALOG(pg_group) BOOTSTRAP BKI_WITHOUT_OIDS
{
NameData groname;
int4 grosysid;
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_index.h,v 1.22 2001/07/15 22:48:18 tgl Exp $
+ * $Id: pg_index.h,v 1.23 2001/08/10 18:57:40 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
* first variable length field. so I moved indislossy, indhaskeytype,
* and indisunique before indpred. --djm 8/20/96
*/
-CATALOG(pg_index)
+CATALOG(pg_index) BKI_WITHOUT_OIDS
{
- Oid indexrelid;
- Oid indrelid;
- Oid indproc; /* registered procedure for functional
- * index */
- int2vector indkey;
- oidvector indclass;
+ Oid indexrelid; /* OID of the index */
+ Oid indrelid; /* OID of the relation it indexes */
+ Oid indproc; /* OID of function for functional index */
+ int2vector indkey; /* column numbers of indexed attributes */
+ oidvector indclass; /* opclass identifiers */
bool indisclustered; /* unused */
bool indislossy; /* index hit must be reevaluated against heap
* value to make sure it really is match;
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_inherits.h,v 1.10 2001/01/24 19:43:21 momjian Exp $
+ * $Id: pg_inherits.h,v 1.11 2001/08/10 18:57:40 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
* typedef struct FormData_pg_inherits
* ----------------
*/
-CATALOG(pg_inherits)
+CATALOG(pg_inherits) BKI_WITHOUT_OIDS
{
Oid inhrelid;
Oid inhparent;
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_largeobject.h,v 1.7 2001/03/22 04:00:39 momjian Exp $
+ * $Id: pg_largeobject.h,v 1.8 2001/08/10 18:57:40 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
/* ----------------
* pg_largeobject definition. cpp turns this into
- * typedef struct FormData_pg_largeobject. Large object id
- * is stored in loid;
+ * typedef struct FormData_pg_largeobject
* ----------------
*/
-CATALOG(pg_largeobject)
+CATALOG(pg_largeobject) BKI_WITHOUT_OIDS
{
Oid loid; /* Identifier of large object */
int4 pageno; /* Page number (starting from 0) */
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_listener.h,v 1.9 2001/06/12 05:55:50 tgl Exp $
+ * $Id: pg_listener.h,v 1.10 2001/08/10 18:57:40 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
* ----------------------------------------------------------------
*/
-CATALOG(pg_listener)
+CATALOG(pg_listener) BKI_WITHOUT_OIDS
{
NameData relname;
int4 listenerpid;
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_log.h,v 1.8 2001/01/24 19:43:21 momjian Exp $
+ * $Id: pg_log.h,v 1.9 2001/08/10 18:57:40 tgl Exp $
*
* NOTES
* The structures and macros used by the transam/ code
* ----------------
*/
-CATALOG(pg_log) BOOTSTRAP
+CATALOG(pg_log) BOOTSTRAP BKI_WITHOUT_OIDS
{
Oid logfoo;
} FormData_pg_log;
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_proc.h,v 1.200 2001/08/06 01:25:32 tgl Exp $
+ * $Id: pg_proc.h,v 1.201 2001/08/10 18:57:40 tgl Exp $
*
* NOTES
* The script catalog/genbki.sh reads this file and generates .bki
DATA(insert OID = 1200 ( reltime PGUID 12 f t t t 1 f 703 "23" 100 0 0 100 int4reltime - ));
DESCR("convert int4 to reltime");
+DATA(insert OID = 1215 ( obj_description PGUID 14 f t f t 2 f 25 "26 19" 100 0 0 100 "select description from pg_description where objoid = $1 and classoid = (select oid from pg_class where relname = $2) and objsubid = 0" - ));
+DESCR("get description for object id and catalog name");
+DATA(insert OID = 1216 ( col_description PGUID 14 f t f t 2 f 25 "26 23" 100 0 0 100 "select description from pg_description where objoid = $1 and classoid = (select oid from pg_class where relname = 'pg_class') and objsubid = $2" - ));
+DESCR("get description for table column");
+
DATA(insert OID = 1217 ( date_trunc PGUID 12 f t f t 2 f 1184 "25 1184" 100 0 0 100 timestamp_trunc - ));
DESCR("truncate timestamp to specified units");
DATA(insert OID = 1218 ( date_trunc PGUID 12 f t f t 2 f 1186 "25 1186" 100 0 0 100 interval_trunc - ));
DATA(insert OID = 1347 ( exp PGUID 12 f t t t 1 f 701 "701" 100 0 0 100 dexp - ));
DESCR("exponential");
-DATA(insert OID = 1348 ( obj_description PGUID 14 f t f t 1 f 25 "26" 100 0 0 100 "select description from pg_description where objoid = $1" - ));
-DESCR("get description for object id");
+/*
+ * This form of obj_description is now deprecated, since it will fail if
+ * OIDs are not unique across system catalogs. Use the other forms instead.
+ */
+DATA(insert OID = 1348 ( obj_description PGUID 14 f t f t 1 f 25 "26" 100 0 0 100 "select description from pg_description where objoid = $1 and objsubid = 0" - ));
+DESCR("get description for object id (deprecated)");
DATA(insert OID = 1349 ( oidvectortypes PGUID 12 f t f t 1 f 25 "30" 100 0 0 100 oidvectortypes - ));
DESCR("print type names of oidvector field");
* typedef struct FormData_pg_relcheck
* ----------------
*/
-CATALOG(pg_relcheck)
+CATALOG(pg_relcheck) BKI_WITHOUT_OIDS
{
Oid rcrelid;
NameData rcname;
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_shadow.h,v 1.12 2001/06/13 21:44:41 tgl Exp $
+ * $Id: pg_shadow.h,v 1.13 2001/08/10 18:57:41 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
* typedef struct FormData_pg_shadow
* ----------------
*/
-CATALOG(pg_shadow) BOOTSTRAP
+CATALOG(pg_shadow) BOOTSTRAP BKI_WITHOUT_OIDS
{
NameData usename;
int4 usesysid;
* user choices.
* ----------------
*/
-DATA(insert OID = 0 ( "POSTGRES" PGUID t t t t _null_ _null_ ));
+DATA(insert ( "POSTGRES" PGUID t t t t _null_ _null_ ));
#endif /* PG_SHADOW_H */
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_statistic.h,v 1.11 2001/05/07 00:43:25 tgl Exp $
+ * $Id: pg_statistic.h,v 1.12 2001/08/10 18:57:41 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
* typedef struct FormData_pg_statistic
* ----------------
*/
-CATALOG(pg_statistic)
+CATALOG(pg_statistic) BKI_WITHOUT_OIDS
{
/* These fields form the unique key for the entry: */
Oid starelid; /* relation containing attribute */
#!/bin/sh
# unused_oids
#
-# $Header: /cvsroot/pgsql/src/include/catalog/unused_oids,v 1.3 2000/01/17 00:53:11 tgl Exp $
+# $Header: /cvsroot/pgsql/src/include/catalog/unused_oids,v 1.4 2001/08/10 18:57:41 tgl Exp $
#
# finds blocks of oids that have not already been claimed by
# post_hackers for internal purposes. primarily useful for
#
# run this script in src/include/catalog.
#
+
+
+AWK="awk"
+
+# Get FirstGenBKIObjectId from access/transam.h
+BKIOBJECTID=`grep '#define[ ]*FirstGenBKIObjectId' ../access/transam.h | $AWK '{ print $3 }'`
+export BKIOBJECTID
+
egrep '^DATA' pg_*.h | \
sed -e 's/^.*OID[^=]*=[^0-9]*//' -e 's/[^0-9].*$//' | \
sort -n | \
uniq | \
- awk '
+ $AWK '
BEGIN {
last = 0;
}
last = $1;
}
END {
-# 2^14-1 = current BootstrapObjectIdData value
- print last + 1, "-", 2^14-1;
+ print last + 1, "-", ENVIRON["BKIOBJECTID"]-1;
}'
* Function Prototypes --
*
* The following protoypes define the public functions of the comment
- * related routines. CreateComments() is used to create/drop a comment
- * for any object with a valid oid. DeleteComments() deletes, if any,
- * the comments associated with the object. CommentObject() is used to
- * create comments to be identified by the specific type.
+ * related routines. CommentObject() implements the SQL "COMMENT ON"
+ * command. DeleteComments() deletes all comments for an object.
+ * CreateComments creates (or deletes, if comment is NULL) a comment
+ * for a specific key.
*------------------------------------------------------------------
*/
-extern void DeleteComments(Oid oid);
extern void CommentObject(int objtype, char *objname, char *objproperty,
List *objlist, char *comment);
+extern void DeleteComments(Oid oid, Oid classoid);
+
+extern void CreateComments(Oid oid, Oid classoid, int32 subid, char *comment);
+
#endif /* COMMENT_H */
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: parsenodes.h,v 1.139 2001/08/10 14:30:15 momjian Exp $
+ * $Id: parsenodes.h,v 1.140 2001/08/10 18:57:41 tgl Exp $
*
*-------------------------------------------------------------------------
*/
typedef struct CreateStmt
{
NodeTag type;
- bool istemp; /* is this a temp table? */
char *relname; /* name of relation to create */
List *tableElts; /* column definitions (list of ColumnDef) */
List *inhRelnames; /* relations to inherit from (list of
* T_String Values) */
List *constraints; /* constraints (list of Constraint and
* FkConstraint nodes) */
+ bool istemp; /* is this a temp table? */
+ bool hasoids; /* should it have OIDs? */
} CreateStmt;
/* ----------
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: parse_relation.h,v 1.23 2001/03/22 04:00:58 momjian Exp $
+ * $Id: parse_relation.h,v 1.24 2001/08/10 18:57:41 tgl Exp $
*
*-------------------------------------------------------------------------
*/
extern List *expandJoinAttrs(ParseState *pstate, JoinExpr *join,
int sublevels_up);
extern int attnameAttNum(Relation rd, char *a);
-extern int specialAttNum(char *a);
extern Oid attnumTypeId(Relation rd, int attid);
#endif /* PARSE_RELATION_H */
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1995, Regents of the University of California
*
- * $Id: postgres.h,v 1.49 2001/06/12 05:55:50 tgl Exp $
+ * $Id: postgres.h,v 1.50 2001/08/10 18:57:41 tgl Exp $
*
*-------------------------------------------------------------------------
*/
*/
/* ----------------
- * struct varattrib is the header of a varlena object that may have been TOASTed.
+ * struct varattrib is the header of a varlena object that may have been TOASTed.
* ----------------
*/
#define TUPLE_TOASTER_ACTIVE
int32 va_extsize; /* External saved size */
Oid va_valueid; /* Unique identifier of value */
Oid va_toastrelid; /* RelID where to find chunks */
- Oid va_toastidxid; /* Main tables row Oid */
- Oid va_rowid; /* Referencing row Oid */
- int16 va_attno; /* Main tables attno */
} va_external;/* External stored attribute */
char va_data[1]; /* Plain stored attribute */
#define BOOTSTRAP
+#define BKI_WITHOUT_OIDS
+
/* these need to expand into some harmless, repeatable declaration */
#define DATA(x) extern int errno
#define DESCR(x) extern int errno
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: syscache.h,v 1.31 2001/06/12 05:55:50 tgl Exp $
+ * $Id: syscache.h,v 1.32 2001/08/10 18:57:41 tgl Exp $
*
*-------------------------------------------------------------------------
*/
/* convenience routines */
extern HeapTuple SearchSysCacheCopy(int cacheId,
Datum key1, Datum key2, Datum key3, Datum key4);
+extern bool SearchSysCacheExists(int cacheId,
+ Datum key1, Datum key2, Datum key3, Datum key4);
extern Oid GetSysCacheOid(int cacheId,
Datum key1, Datum key2, Datum key3, Datum key4);
-/* macro for just probing for existence of a tuple via the syscache */
-#define SearchSysCacheExists(c,k1,k2,k3,k4) \
- OidIsValid(GetSysCacheOid(c,k1,k2,k3,k4))
-
extern Datum SysCacheGetAttr(int cacheId, HeapTuple tup,
AttrNumber attributeNumber, bool *isNull);
%type copy_delimiter ListenStmt CopyStmt copy_file_name opt_binary
%type opt_with_copy FetchStmt direction fetch_how_many from_in
%type ClosePortalStmt DropStmt VacuumStmt AnalyzeStmt opt_verbose
-%type opt_full func_arg
+%type opt_full func_arg OptWithOids
%type analyze_keyword opt_name_list ExplainStmt index_params
%type index_list func_index index_elem opt_class access_method_clause
%type index_opt_unique IndexStmt func_return ConstInterval
*****************************************************************************/
CreateStmt: CREATE OptTemp TABLE relation_name '(' OptTableElementList ')'
- OptInherit
+ OptInherit OptWithOids
{
- $$ = cat_str(8, make_str("create"), $2, make_str("table"), $4, make_str("("), $6, make_str(")"), $8);
+ $$ = cat_str(9, make_str("create"), $2, make_str("table"), $4, make_str("("), $6, make_str(")"), $8, $9);
}
;
OptInherit: INHERITS '(' relation_name_list ')' { $$ = cat_str(3, make_str("inherits ("), $3, make_str(")")); }
| /*EMPTY*/ { $$ = EMPTY; }
- ;
+ ;
+
+OptWithOids: WITH OIDS { $$ = make_str("with oids"); }
+ | WITHOUT OIDS { $$ = make_str("without oids"); }
+ | /*EMPTY*/ { $$ = EMPTY; }
+ ;
+
/*
* Note: CREATE TABLE ... AS SELECT ... is just another spelling for
--
-- This is created by pgsql/contrib/findoidjoins/make_oidjoin_check
--
-SELECT oid, pg_aggregate.aggtransfn
+SELECT ctid, pg_aggregate.aggtransfn
FROM pg_aggregate
WHERE pg_aggregate.aggtransfn != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_aggregate.aggtransfn);
- oid | aggtransfn
------+------------
+ ctid | aggtransfn
+------+------------
(0 rows)
-SELECT oid, pg_aggregate.aggfinalfn
+SELECT ctid, pg_aggregate.aggfinalfn
FROM pg_aggregate
WHERE pg_aggregate.aggfinalfn != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_aggregate.aggfinalfn);
- oid | aggfinalfn
------+------------
+ ctid | aggfinalfn
+------+------------
(0 rows)
-SELECT oid, pg_aggregate.aggbasetype
+SELECT ctid, pg_aggregate.aggbasetype
FROM pg_aggregate
WHERE pg_aggregate.aggbasetype != 0 AND
NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_aggregate.aggbasetype);
- oid | aggbasetype
------+-------------
+ ctid | aggbasetype
+------+-------------
(0 rows)
-SELECT oid, pg_aggregate.aggtranstype
+SELECT ctid, pg_aggregate.aggtranstype
FROM pg_aggregate
WHERE pg_aggregate.aggtranstype != 0 AND
NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_aggregate.aggtranstype);
- oid | aggtranstype
------+--------------
+ ctid | aggtranstype
+------+--------------
(0 rows)
-SELECT oid, pg_aggregate.aggfinaltype
+SELECT ctid, pg_aggregate.aggfinaltype
FROM pg_aggregate
WHERE pg_aggregate.aggfinaltype != 0 AND
NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_aggregate.aggfinaltype);
- oid | aggfinaltype
------+--------------
+ ctid | aggfinaltype
+------+--------------
(0 rows)
-SELECT oid, pg_am.amgettuple
+SELECT ctid, pg_am.amgettuple
FROM pg_am
WHERE pg_am.amgettuple != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.amgettuple);
- oid | amgettuple
------+------------
+ ctid | amgettuple
+------+------------
(0 rows)
-SELECT oid, pg_am.aminsert
+SELECT ctid, pg_am.aminsert
FROM pg_am
WHERE pg_am.aminsert != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.aminsert);
- oid | aminsert
------+----------
+ ctid | aminsert
+------+----------
(0 rows)
-SELECT oid, pg_am.ambeginscan
+SELECT ctid, pg_am.ambeginscan
FROM pg_am
WHERE pg_am.ambeginscan != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.ambeginscan);
- oid | ambeginscan
------+-------------
+ ctid | ambeginscan
+------+-------------
(0 rows)
-SELECT oid, pg_am.amrescan
+SELECT ctid, pg_am.amrescan
FROM pg_am
WHERE pg_am.amrescan != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.amrescan);
- oid | amrescan
------+----------
+ ctid | amrescan
+------+----------
(0 rows)
-SELECT oid, pg_am.amendscan
+SELECT ctid, pg_am.amendscan
FROM pg_am
WHERE pg_am.amendscan != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.amendscan);
- oid | amendscan
------+-----------
+ ctid | amendscan
+------+-----------
(0 rows)
-SELECT oid, pg_am.ammarkpos
+SELECT ctid, pg_am.ammarkpos
FROM pg_am
WHERE pg_am.ammarkpos != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.ammarkpos);
- oid | ammarkpos
------+-----------
+ ctid | ammarkpos
+------+-----------
(0 rows)
-SELECT oid, pg_am.amrestrpos
+SELECT ctid, pg_am.amrestrpos
FROM pg_am
WHERE pg_am.amrestrpos != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.amrestrpos);
- oid | amrestrpos
------+------------
+ ctid | amrestrpos
+------+------------
(0 rows)
-SELECT oid, pg_am.ambuild
+SELECT ctid, pg_am.ambuild
FROM pg_am
WHERE pg_am.ambuild != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.ambuild);
- oid | ambuild
------+---------
+ ctid | ambuild
+------+---------
(0 rows)
-SELECT oid, pg_am.ambulkdelete
+SELECT ctid, pg_am.ambulkdelete
FROM pg_am
WHERE pg_am.ambulkdelete != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.ambulkdelete);
- oid | ambulkdelete
------+--------------
+ ctid | ambulkdelete
+------+--------------
(0 rows)
-SELECT oid, pg_am.amcostestimate
+SELECT ctid, pg_am.amcostestimate
FROM pg_am
WHERE pg_am.amcostestimate != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.amcostestimate);
- oid | amcostestimate
------+----------------
+ ctid | amcostestimate
+------+----------------
(0 rows)
-SELECT oid, pg_amop.amopid
+SELECT ctid, pg_amop.amopid
FROM pg_amop
WHERE pg_amop.amopid != 0 AND
NOT EXISTS(SELECT * FROM pg_am AS t1 WHERE t1.oid = pg_amop.amopid);
- oid | amopid
------+--------
+ ctid | amopid
+------+--------
(0 rows)
-SELECT oid, pg_amop.amopclaid
+SELECT ctid, pg_amop.amopclaid
FROM pg_amop
WHERE pg_amop.amopclaid != 0 AND
NOT EXISTS(SELECT * FROM pg_opclass AS t1 WHERE t1.oid = pg_amop.amopclaid);
- oid | amopclaid
------+-----------
+ ctid | amopclaid
+------+-----------
(0 rows)
-SELECT oid, pg_amop.amopopr
+SELECT ctid, pg_amop.amopopr
FROM pg_amop
WHERE pg_amop.amopopr != 0 AND
NOT EXISTS(SELECT * FROM pg_operator AS t1 WHERE t1.oid = pg_amop.amopopr);
- oid | amopopr
------+---------
+ ctid | amopopr
+------+---------
(0 rows)
-SELECT oid, pg_amproc.amid
+SELECT ctid, pg_amproc.amid
FROM pg_amproc
WHERE pg_amproc.amid != 0 AND
NOT EXISTS(SELECT * FROM pg_am AS t1 WHERE t1.oid = pg_amproc.amid);
- oid | amid
------+------
+ ctid | amid
+------+------
(0 rows)
-SELECT oid, pg_amproc.amopclaid
+SELECT ctid, pg_amproc.amopclaid
FROM pg_amproc
WHERE pg_amproc.amopclaid != 0 AND
NOT EXISTS(SELECT * FROM pg_opclass AS t1 WHERE t1.oid = pg_amproc.amopclaid);
- oid | amopclaid
------+-----------
+ ctid | amopclaid
+------+-----------
(0 rows)
-SELECT oid, pg_amproc.amproc
+SELECT ctid, pg_amproc.amproc
FROM pg_amproc
WHERE pg_amproc.amproc != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_amproc.amproc);
- oid | amproc
------+--------
+ ctid | amproc
+------+--------
(0 rows)
-SELECT oid, pg_attribute.attrelid
+SELECT ctid, pg_attribute.attrelid
FROM pg_attribute
WHERE pg_attribute.attrelid != 0 AND
NOT EXISTS(SELECT * FROM pg_class AS t1 WHERE t1.oid = pg_attribute.attrelid);
- oid | attrelid
------+----------
+ ctid | attrelid
+------+----------
(0 rows)
-SELECT oid, pg_attribute.atttypid
+SELECT ctid, pg_attribute.atttypid
FROM pg_attribute
WHERE pg_attribute.atttypid != 0 AND
NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_attribute.atttypid);
- oid | atttypid
------+----------
+ ctid | atttypid
+------+----------
(0 rows)
-SELECT oid, pg_class.reltype
+SELECT ctid, pg_class.reltype
FROM pg_class
WHERE pg_class.reltype != 0 AND
NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_class.reltype);
- oid | reltype
------+---------
+ ctid | reltype
+------+---------
(0 rows)
-SELECT oid, pg_class.relam
+SELECT ctid, pg_class.relam
FROM pg_class
WHERE pg_class.relam != 0 AND
NOT EXISTS(SELECT * FROM pg_am AS t1 WHERE t1.oid = pg_class.relam);
- oid | relam
------+-------
+ ctid | relam
+------+-------
(0 rows)
-SELECT oid, pg_class.reltoastrelid
+SELECT ctid, pg_class.reltoastrelid
FROM pg_class
WHERE pg_class.reltoastrelid != 0 AND
NOT EXISTS(SELECT * FROM pg_class AS t1 WHERE t1.oid = pg_class.reltoastrelid);
- oid | reltoastrelid
------+---------------
+ ctid | reltoastrelid
+------+---------------
(0 rows)
-SELECT oid, pg_class.reltoastidxid
+SELECT ctid, pg_class.reltoastidxid
FROM pg_class
WHERE pg_class.reltoastidxid != 0 AND
NOT EXISTS(SELECT * FROM pg_class AS t1 WHERE t1.oid = pg_class.reltoastidxid);
- oid | reltoastidxid
------+---------------
+ ctid | reltoastidxid
+------+---------------
(0 rows)
-SELECT oid, pg_index.indexrelid
+SELECT ctid, pg_description.classoid
+FROM pg_description
+WHERE pg_description.classoid != 0 AND
+ NOT EXISTS(SELECT * FROM pg_class AS t1 WHERE t1.oid = pg_description.classoid);
+ ctid | classoid
+------+----------
+(0 rows)
+
+SELECT ctid, pg_index.indexrelid
FROM pg_index
WHERE pg_index.indexrelid != 0 AND
NOT EXISTS(SELECT * FROM pg_class AS t1 WHERE t1.oid = pg_index.indexrelid);
- oid | indexrelid
------+------------
+ ctid | indexrelid
+------+------------
(0 rows)
-SELECT oid, pg_index.indrelid
+SELECT ctid, pg_index.indrelid
FROM pg_index
WHERE pg_index.indrelid != 0 AND
NOT EXISTS(SELECT * FROM pg_class AS t1 WHERE t1.oid = pg_index.indrelid);
- oid | indrelid
------+----------
+ ctid | indrelid
+------+----------
(0 rows)
-SELECT oid, pg_opclass.opcdeftype
+SELECT ctid, pg_opclass.opcdeftype
FROM pg_opclass
WHERE pg_opclass.opcdeftype != 0 AND
NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_opclass.opcdeftype);
- oid | opcdeftype
------+------------
+ ctid | opcdeftype
+------+------------
(0 rows)
-SELECT oid, pg_operator.oprleft
+SELECT ctid, pg_operator.oprleft
FROM pg_operator
WHERE pg_operator.oprleft != 0 AND
NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_operator.oprleft);
- oid | oprleft
------+---------
+ ctid | oprleft
+------+---------
(0 rows)
-SELECT oid, pg_operator.oprright
+SELECT ctid, pg_operator.oprright
FROM pg_operator
WHERE pg_operator.oprright != 0 AND
NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_operator.oprright);
- oid | oprright
------+----------
+ ctid | oprright
+------+----------
(0 rows)
-SELECT oid, pg_operator.oprresult
+SELECT ctid, pg_operator.oprresult
FROM pg_operator
WHERE pg_operator.oprresult != 0 AND
NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_operator.oprresult);
- oid | oprresult
------+-----------
+ ctid | oprresult
+------+-----------
(0 rows)
-SELECT oid, pg_operator.oprcom
+SELECT ctid, pg_operator.oprcom
FROM pg_operator
WHERE pg_operator.oprcom != 0 AND
NOT EXISTS(SELECT * FROM pg_operator AS t1 WHERE t1.oid = pg_operator.oprcom);
- oid | oprcom
------+--------
+ ctid | oprcom
+------+--------
(0 rows)
-SELECT oid, pg_operator.oprnegate
+SELECT ctid, pg_operator.oprnegate
FROM pg_operator
WHERE pg_operator.oprnegate != 0 AND
NOT EXISTS(SELECT * FROM pg_operator AS t1 WHERE t1.oid = pg_operator.oprnegate);
- oid | oprnegate
------+-----------
+ ctid | oprnegate
+------+-----------
(0 rows)
-SELECT oid, pg_operator.oprlsortop
+SELECT ctid, pg_operator.oprlsortop
FROM pg_operator
WHERE pg_operator.oprlsortop != 0 AND
NOT EXISTS(SELECT * FROM pg_operator AS t1 WHERE t1.oid = pg_operator.oprlsortop);
- oid | oprlsortop
------+------------
+ ctid | oprlsortop
+------+------------
(0 rows)
-SELECT oid, pg_operator.oprrsortop
+SELECT ctid, pg_operator.oprrsortop
FROM pg_operator
WHERE pg_operator.oprrsortop != 0 AND
NOT EXISTS(SELECT * FROM pg_operator AS t1 WHERE t1.oid = pg_operator.oprrsortop);
- oid | oprrsortop
------+------------
+ ctid | oprrsortop
+------+------------
(0 rows)
-SELECT oid, pg_operator.oprcode
+SELECT ctid, pg_operator.oprcode
FROM pg_operator
WHERE pg_operator.oprcode != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_operator.oprcode);
- oid | oprcode
------+---------
+ ctid | oprcode
+------+---------
(0 rows)
-SELECT oid, pg_operator.oprrest
+SELECT ctid, pg_operator.oprrest
FROM pg_operator
WHERE pg_operator.oprrest != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_operator.oprrest);
- oid | oprrest
------+---------
+ ctid | oprrest
+------+---------
(0 rows)
-SELECT oid, pg_operator.oprjoin
+SELECT ctid, pg_operator.oprjoin
FROM pg_operator
WHERE pg_operator.oprjoin != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_operator.oprjoin);
- oid | oprjoin
------+---------
+ ctid | oprjoin
+------+---------
(0 rows)
-SELECT oid, pg_proc.prolang
+SELECT ctid, pg_proc.prolang
FROM pg_proc
WHERE pg_proc.prolang != 0 AND
NOT EXISTS(SELECT * FROM pg_language AS t1 WHERE t1.oid = pg_proc.prolang);
- oid | prolang
------+---------
+ ctid | prolang
+------+---------
(0 rows)
-SELECT oid, pg_proc.prorettype
+SELECT ctid, pg_proc.prorettype
FROM pg_proc
WHERE pg_proc.prorettype != 0 AND
NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_proc.prorettype);
- oid | prorettype
------+------------
+ ctid | prorettype
+------+------------
(0 rows)
-SELECT oid, pg_rewrite.ev_class
+SELECT ctid, pg_rewrite.ev_class
FROM pg_rewrite
WHERE pg_rewrite.ev_class != 0 AND
NOT EXISTS(SELECT * FROM pg_class AS t1 WHERE t1.oid = pg_rewrite.ev_class);
- oid | ev_class
------+----------
+ ctid | ev_class
+------+----------
(0 rows)
-SELECT oid, pg_statistic.starelid
+SELECT ctid, pg_statistic.starelid
FROM pg_statistic
WHERE pg_statistic.starelid != 0 AND
NOT EXISTS(SELECT * FROM pg_class AS t1 WHERE t1.oid = pg_statistic.starelid);
- oid | starelid
------+----------
+ ctid | starelid
+------+----------
(0 rows)
-SELECT oid, pg_statistic.staop1
+SELECT ctid, pg_statistic.staop1
FROM pg_statistic
WHERE pg_statistic.staop1 != 0 AND
NOT EXISTS(SELECT * FROM pg_operator AS t1 WHERE t1.oid = pg_statistic.staop1);
- oid | staop1
------+--------
+ ctid | staop1
+------+--------
(0 rows)
-SELECT oid, pg_statistic.staop2
+SELECT ctid, pg_statistic.staop2
FROM pg_statistic
WHERE pg_statistic.staop2 != 0 AND
NOT EXISTS(SELECT * FROM pg_operator AS t1 WHERE t1.oid = pg_statistic.staop2);
- oid | staop2
------+--------
+ ctid | staop2
+------+--------
(0 rows)
-SELECT oid, pg_statistic.staop3
+SELECT ctid, pg_statistic.staop3
FROM pg_statistic
WHERE pg_statistic.staop3 != 0 AND
NOT EXISTS(SELECT * FROM pg_operator AS t1 WHERE t1.oid = pg_statistic.staop3);
- oid | staop3
------+--------
+ ctid | staop3
+------+--------
(0 rows)
-SELECT oid, pg_trigger.tgrelid
+SELECT ctid, pg_trigger.tgrelid
FROM pg_trigger
WHERE pg_trigger.tgrelid != 0 AND
NOT EXISTS(SELECT * FROM pg_class AS t1 WHERE t1.oid = pg_trigger.tgrelid);
- oid | tgrelid
------+---------
+ ctid | tgrelid
+------+---------
(0 rows)
-SELECT oid, pg_trigger.tgfoid
+SELECT ctid, pg_trigger.tgfoid
FROM pg_trigger
WHERE pg_trigger.tgfoid != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_trigger.tgfoid);
- oid | tgfoid
------+--------
+ ctid | tgfoid
+------+--------
(0 rows)
-SELECT oid, pg_type.typrelid
+SELECT ctid, pg_type.typrelid
FROM pg_type
WHERE pg_type.typrelid != 0 AND
NOT EXISTS(SELECT * FROM pg_class AS t1 WHERE t1.oid = pg_type.typrelid);
- oid | typrelid
------+----------
+ ctid | typrelid
+------+----------
(0 rows)
-SELECT oid, pg_type.typelem
+SELECT ctid, pg_type.typelem
FROM pg_type
WHERE pg_type.typelem != 0 AND
NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_type.typelem);
- oid | typelem
------+---------
+ ctid | typelem
+------+---------
(0 rows)
-SELECT oid, pg_type.typinput
+SELECT ctid, pg_type.typinput
FROM pg_type
WHERE pg_type.typinput != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_type.typinput);
- oid | typinput
------+----------
+ ctid | typinput
+------+----------
(0 rows)
-SELECT oid, pg_type.typoutput
+SELECT ctid, pg_type.typoutput
FROM pg_type
WHERE pg_type.typoutput != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_type.typoutput);
- oid | typoutput
------+-----------
+ ctid | typoutput
+------+-----------
(0 rows)
-SELECT oid, pg_type.typreceive
+SELECT ctid, pg_type.typreceive
FROM pg_type
WHERE pg_type.typreceive != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_type.typreceive);
- oid | typreceive
------+------------
+ ctid | typreceive
+------+------------
(0 rows)
-SELECT oid, pg_type.typsend
+SELECT ctid, pg_type.typsend
FROM pg_type
WHERE pg_type.typsend != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_type.typsend);
- oid | typsend
------+---------
+ ctid | typsend
+------+---------
(0 rows)
(p2.pronargs = 1 AND p1.aggbasetype = 0)));
oid | aggname | oid | proname
-------+---------+-----+-------------
- 16959 | max | 768 | int4larger
- 16973 | min | 769 | int4smaller
+ 10020 | max | 768 | int4larger
+ 10034 | min | 769 | int4smaller
(2 rows)
-- Cross-check finalfn (if present) against its entry in pg_proc.
-- **************** pg_amop ****************
-- Look for illegal values in pg_amop fields
-SELECT p1.oid
+SELECT p1.amopclaid, p1.amopopr, p1.amopid
FROM pg_amop as p1
WHERE p1.amopid = 0 OR p1.amopclaid = 0 OR p1.amopopr = 0 OR
p1.amopstrategy <= 0;
- oid
------
-(0 rows)
-
--- Look for duplicate pg_amop entries
-SELECT p1.oid, p2.oid
-FROM pg_amop AS p1, pg_amop AS p2
-WHERE p1.oid != p2.oid AND
- p1.amopid = p2.amopid AND
- p1.amopclaid = p2.amopclaid AND
- p1.amopstrategy = p2.amopstrategy;
- oid | oid
------+-----
+ amopclaid | amopopr | amopid
+-----------+---------+--------
(0 rows)
-- Cross-check amopstrategy index against parent AM
-SELECT p1.oid, p2.oid, p2.amname
+SELECT p1.amopclaid, p1.amopopr, p1.amopid, p2.oid, p2.amname
FROM pg_amop AS p1, pg_am AS p2
WHERE p1.amopid = p2.oid AND p1.amopstrategy > p2.amstrategies;
- oid | oid | amname
------+-----+--------
+ amopclaid | amopopr | amopid | oid | amname
+-----------+---------+--------+-----+--------
(0 rows)
-- Detect missing pg_amop entries: should have as many strategy functions
-- operator yielding boolean.
-- NOTE: for 7.1, add restriction that operator inputs are of same type.
-- We used to have opclasses like "int24_ops" but these were broken.
-SELECT p1.oid, p2.oid, p2.oprname
+SELECT p1.amopclaid, p1.amopopr, p1.amopid, p2.oid, p2.oprname
FROM pg_amop AS p1, pg_operator AS p2
WHERE p1.amopopr = p2.oid AND
(p2.oprkind != 'b' OR p2.oprresult != 16 OR p2.oprleft != p2.oprright);
- oid | oid | oprname
------+-----+---------
+ amopclaid | amopopr | amopid | oid | oprname
+-----------+---------+--------+-----+---------
(0 rows)
-- If opclass is for a specific type, operator inputs should be of that type
-SELECT p1.oid, p2.oid, p2.oprname, p3.oid, p3.opcname
+SELECT p1.amopclaid, p1.amopopr, p1.amopid, p2.oid, p2.oprname, p3.oid, p3.opcname
FROM pg_amop AS p1, pg_operator AS p2, pg_opclass AS p3
WHERE p1.amopopr = p2.oid AND p1.amopclaid = p3.oid AND
p3.opcdeftype != 0 AND
(p3.opcdeftype != p2.oprleft OR p3.opcdeftype != p2.oprright);
- oid | oid | oprname | oid | opcname
------+-----+---------+-----+---------
+ amopclaid | amopopr | amopid | oid | oprname | oid | opcname
+-----------+---------+--------+-----+---------+-----+---------
(0 rows)
-- **************** pg_amproc ****************
-- Look for illegal values in pg_amproc fields
-SELECT p1.oid
+SELECT p1.amid, p1.amopclaid, p1.amprocnum
FROM pg_amproc as p1
WHERE p1.amid = 0 OR p1.amopclaid = 0 OR p1.amproc = 0 OR
p1.amprocnum <= 0;
- oid
------
-(0 rows)
-
--- Look for duplicate pg_amproc entries
-SELECT p1.oid, p2.oid
-FROM pg_amproc AS p1, pg_amproc AS p2
-WHERE p1.oid != p2.oid AND
- p1.amid = p2.amid AND
- p1.amopclaid = p2.amopclaid AND
- p1.amprocnum = p2.amprocnum;
- oid | oid
------+-----
+ amid | amopclaid | amprocnum
+------+-----------+-----------
(0 rows)
-- Cross-check amprocnum index against parent AM
-SELECT p1.oid, p2.oid, p2.amname
+SELECT p1.amid, p1.amopclaid, p1.amprocnum, p2.oid, p2.amname
FROM pg_amproc AS p1, pg_am AS p2
WHERE p1.amid = p2.oid AND p1.amprocnum > p2.amsupport;
- oid | oid | amname
------+-----+--------
+ amid | amopclaid | amprocnum | oid | amname
+------+-----------+-----------+-----+--------
(0 rows)
-- Detect missing pg_amproc entries: should have as many support functions
-- or different base data types.
-- We can check that all the referenced instances of the same support
-- routine number take the same number of parameters, but that's about it...
-SELECT p1.oid, p2.oid, p2.proname, p3.oid, p4.oid, p4.proname
+SELECT p1.amid, p1.amopclaid, p1.amprocnum,
+ p2.oid, p2.proname,
+ p3.amid, p3.amopclaid, p3.amprocnum,
+ p4.oid, p4.proname
FROM pg_amproc AS p1, pg_proc AS p2, pg_amproc AS p3, pg_proc AS p4
-WHERE p1.oid != p3.oid AND
- p1.amid = p3.amid AND p1.amprocnum = p3.amprocnum AND
+WHERE p1.amid = p3.amid AND p1.amprocnum = p3.amprocnum AND
p1.amproc = p2.oid AND p3.amproc = p4.oid AND
(p2.proretset OR p4.proretset OR p2.pronargs != p4.pronargs);
- oid | oid | proname | oid | oid | proname
------+-----+---------+-----+-----+---------
+ amid | amopclaid | amprocnum | oid | proname | amid | amopclaid | amprocnum | oid | proname
+------+-----------+-----------+-----+---------+------+-----------+-----------+-----+---------
(0 rows)
-- Cross-check that each opclass that has any entries for a given AM
pg_stat_user_tables | SELECT pg_stat_all_tables.relid, pg_stat_all_tables.relname, pg_stat_all_tables.seq_scan, pg_stat_all_tables.seq_tup_read, pg_stat_all_tables.idx_scan, pg_stat_all_tables.idx_tup_fetch, pg_stat_all_tables.n_tup_ins, pg_stat_all_tables.n_tup_upd, pg_stat_all_tables.n_tup_del FROM pg_stat_all_tables WHERE (pg_stat_all_tables.relname !~ '^pg_'::text);
pg_statio_all_indexes | SELECT c.oid AS relid, i.oid AS indexrelid, c.relname, i.relname AS indexrelname, (pg_stat_get_blocks_fetched(i.oid) - pg_stat_get_blocks_hit(i.oid)) AS idx_blks_read, pg_stat_get_blocks_hit(i.oid) AS idx_blks_hit FROM pg_class c, pg_class i, pg_index x WHERE (((c.relkind = 'r'::"char") AND (x.indrelid = c.oid)) AND (x.indexrelid = i.oid));
pg_statio_all_sequences | SELECT c.oid AS relid, c.relname, (pg_stat_get_blocks_fetched(c.oid) - pg_stat_get_blocks_hit(c.oid)) AS blks_read, pg_stat_get_blocks_hit(c.oid) AS blks_hit FROM pg_class c WHERE (c.relkind = 'S'::"char");
- pg_statio_all_tables | SELECT c.oid AS relid, c.relname, (pg_stat_get_blocks_fetched(c.oid) - pg_stat_get_blocks_hit(c.oid)) AS heap_blks_read, pg_stat_get_blocks_hit(c.oid) AS heap_blks_hit, sum((pg_stat_get_blocks_fetched(i.indexrelid) - pg_stat_get_blocks_hit(i.indexrelid))) AS idx_blks_read, sum(pg_stat_get_blocks_hit(i.indexrelid)) AS idx_blks_hit, (pg_stat_get_blocks_fetched(t.oid) - pg_stat_get_blocks_hit(t.oid)) AS toast_blks_read, pg_stat_get_blocks_hit(t.oid) AS toast_blks_hit, (pg_stat_get_blocks_fetched(x.oid) - pg_stat_get_blocks_hit(x.oid)) AS tidx_blks_read, pg_stat_get_blocks_hit(x.oid) AS tidx_blks_hit FROM (((pg_class c FULL JOIN pg_index i ON ((c.oid = i.indrelid))) FULL JOIN pg_class t ON ((c.reltoastrelid = t.oid))) FULL JOIN pg_class x ON ((c.reltoastidxid = x.oid))) WHERE (c.relkind = 'r'::"char") GROUP BY c.oid, c.relname, t.oid, x.oid;
+ pg_statio_all_tables | SELECT c.oid AS relid, c.relname, (pg_stat_get_blocks_fetched(c.oid) - pg_stat_get_blocks_hit(c.oid)) AS heap_blks_read, pg_stat_get_blocks_hit(c.oid) AS heap_blks_hit, sum((pg_stat_get_blocks_fetched(i.indexrelid) - pg_stat_get_blocks_hit(i.indexrelid))) AS idx_blks_read, sum(pg_stat_get_blocks_hit(i.indexrelid)) AS idx_blks_hit, (pg_stat_get_blocks_fetched(t.oid) - pg_stat_get_blocks_hit(t.oid)) AS toast_blks_read, pg_stat_get_blocks_hit(t.oid) AS toast_blks_hit, (pg_stat_get_blocks_fetched(x.oid) - pg_stat_get_blocks_hit(x.oid)) AS tidx_blks_read, pg_stat_get_blocks_hit(x.oid) AS tidx_blks_hit FROM (((pg_class c FULL JOIN pg_index i ON ((c.oid = i.indrelid))) FULL JOIN pg_class t ON ((c.reltoastrelid = t.oid))) FULL JOIN pg_class x ON ((t.reltoastidxid = x.oid))) WHERE (c.relkind = 'r'::"char") GROUP BY c.oid, c.relname, t.oid, x.oid;
pg_statio_sys_indexes | SELECT pg_statio_all_indexes.relid, pg_statio_all_indexes.indexrelid, pg_statio_all_indexes.relname, pg_statio_all_indexes.indexrelname, pg_statio_all_indexes.idx_blks_read, pg_statio_all_indexes.idx_blks_hit FROM pg_statio_all_indexes WHERE (pg_statio_all_indexes.relname ~ '^pg_'::text);
pg_statio_sys_sequences | SELECT pg_statio_all_sequences.relid, pg_statio_all_sequences.relname, pg_statio_all_sequences.blks_read, pg_statio_all_sequences.blks_hit FROM pg_statio_all_sequences WHERE (pg_statio_all_sequences.relname ~ '^pg_'::text);
pg_statio_sys_tables | SELECT pg_statio_all_tables.relid, pg_statio_all_tables.relname, pg_statio_all_tables.heap_blks_read, pg_statio_all_tables.heap_blks_hit, pg_statio_all_tables.idx_blks_read, pg_statio_all_tables.idx_blks_hit, pg_statio_all_tables.toast_blks_read, pg_statio_all_tables.toast_blks_hit, pg_statio_all_tables.tidx_blks_read, pg_statio_all_tables.tidx_blks_hit FROM pg_statio_all_tables WHERE (pg_statio_all_tables.relname ~ '^pg_'::text);
-- **************** pg_attribute ****************
-- Look for illegal values in pg_attribute fields
-SELECT p1.oid, p1.attrelid, p1.attname
+SELECT p1.attrelid, p1.attname
FROM pg_attribute as p1
WHERE p1.attrelid = 0 OR p1.atttypid = 0 OR p1.attnum = 0 OR
p1.attcacheoff != -1;
- oid | attrelid | attname
------+----------+---------
-(0 rows)
-
--- Look for duplicate pg_attribute entries
--- (This would not be necessary if the indexes on pg_attribute were UNIQUE?)
-SELECT p1.oid, p1.attname, p2.oid, p2.attname
-FROM pg_attribute AS p1, pg_attribute AS p2
-WHERE p1.oid != p2.oid AND
- p1.attrelid = p2.attrelid AND
- (p1.attname = p2.attname OR p1.attnum = p2.attnum);
- oid | attname | oid | attname
------+---------+-----+---------
+ attrelid | attname
+----------+---------
(0 rows)
-- Cross-check attnum against parent relation
-SELECT p1.oid, p1.attname, p2.oid, p2.relname
+SELECT p1.attrelid, p1.attname, p2.oid, p2.relname
FROM pg_attribute AS p1, pg_class AS p2
WHERE p1.attrelid = p2.oid AND p1.attnum > p2.relnatts;
- oid | attname | oid | relname
------+---------+-----+---------
+ attrelid | attname | oid | relname
+----------+---------+-----+---------
(0 rows)
-- Detect missing pg_attribute entries: should have as many non-system
(0 rows)
-- Cross-check against pg_type entry
-SELECT p1.oid, p1.attname, p2.oid, p2.typname
+SELECT p1.attrelid, p1.attname, p2.oid, p2.typname
FROM pg_attribute AS p1, pg_type AS p2
WHERE p1.atttypid = p2.oid AND
(p1.attlen != p2.typlen OR
p1.attalign != p2.typalign OR
p1.attbyval != p2.typbyval);
- oid | attname | oid | typname
------+---------+-----+---------
+ attrelid | attname | oid | typname
+----------+---------+-----+---------
(0 rows)
--
-- This is created by pgsql/contrib/findoidjoins/make_oidjoin_check
--
-SELECT oid, pg_aggregate.aggtransfn
+SELECT ctid, pg_aggregate.aggtransfn
FROM pg_aggregate
WHERE pg_aggregate.aggtransfn != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_aggregate.aggtransfn);
-SELECT oid, pg_aggregate.aggfinalfn
+SELECT ctid, pg_aggregate.aggfinalfn
FROM pg_aggregate
WHERE pg_aggregate.aggfinalfn != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_aggregate.aggfinalfn);
-SELECT oid, pg_aggregate.aggbasetype
+SELECT ctid, pg_aggregate.aggbasetype
FROM pg_aggregate
WHERE pg_aggregate.aggbasetype != 0 AND
NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_aggregate.aggbasetype);
-SELECT oid, pg_aggregate.aggtranstype
+SELECT ctid, pg_aggregate.aggtranstype
FROM pg_aggregate
WHERE pg_aggregate.aggtranstype != 0 AND
NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_aggregate.aggtranstype);
-SELECT oid, pg_aggregate.aggfinaltype
+SELECT ctid, pg_aggregate.aggfinaltype
FROM pg_aggregate
WHERE pg_aggregate.aggfinaltype != 0 AND
NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_aggregate.aggfinaltype);
-SELECT oid, pg_am.amgettuple
+SELECT ctid, pg_am.amgettuple
FROM pg_am
WHERE pg_am.amgettuple != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.amgettuple);
-SELECT oid, pg_am.aminsert
+SELECT ctid, pg_am.aminsert
FROM pg_am
WHERE pg_am.aminsert != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.aminsert);
-SELECT oid, pg_am.ambeginscan
+SELECT ctid, pg_am.ambeginscan
FROM pg_am
WHERE pg_am.ambeginscan != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.ambeginscan);
-SELECT oid, pg_am.amrescan
+SELECT ctid, pg_am.amrescan
FROM pg_am
WHERE pg_am.amrescan != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.amrescan);
-SELECT oid, pg_am.amendscan
+SELECT ctid, pg_am.amendscan
FROM pg_am
WHERE pg_am.amendscan != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.amendscan);
-SELECT oid, pg_am.ammarkpos
+SELECT ctid, pg_am.ammarkpos
FROM pg_am
WHERE pg_am.ammarkpos != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.ammarkpos);
-SELECT oid, pg_am.amrestrpos
+SELECT ctid, pg_am.amrestrpos
FROM pg_am
WHERE pg_am.amrestrpos != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.amrestrpos);
-SELECT oid, pg_am.ambuild
+SELECT ctid, pg_am.ambuild
FROM pg_am
WHERE pg_am.ambuild != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.ambuild);
-SELECT oid, pg_am.ambulkdelete
+SELECT ctid, pg_am.ambulkdelete
FROM pg_am
WHERE pg_am.ambulkdelete != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.ambulkdelete);
-SELECT oid, pg_am.amcostestimate
+SELECT ctid, pg_am.amcostestimate
FROM pg_am
WHERE pg_am.amcostestimate != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_am.amcostestimate);
-SELECT oid, pg_amop.amopid
+SELECT ctid, pg_amop.amopid
FROM pg_amop
WHERE pg_amop.amopid != 0 AND
NOT EXISTS(SELECT * FROM pg_am AS t1 WHERE t1.oid = pg_amop.amopid);
-SELECT oid, pg_amop.amopclaid
+SELECT ctid, pg_amop.amopclaid
FROM pg_amop
WHERE pg_amop.amopclaid != 0 AND
NOT EXISTS(SELECT * FROM pg_opclass AS t1 WHERE t1.oid = pg_amop.amopclaid);
-SELECT oid, pg_amop.amopopr
+SELECT ctid, pg_amop.amopopr
FROM pg_amop
WHERE pg_amop.amopopr != 0 AND
NOT EXISTS(SELECT * FROM pg_operator AS t1 WHERE t1.oid = pg_amop.amopopr);
-SELECT oid, pg_amproc.amid
+SELECT ctid, pg_amproc.amid
FROM pg_amproc
WHERE pg_amproc.amid != 0 AND
NOT EXISTS(SELECT * FROM pg_am AS t1 WHERE t1.oid = pg_amproc.amid);
-SELECT oid, pg_amproc.amopclaid
+SELECT ctid, pg_amproc.amopclaid
FROM pg_amproc
WHERE pg_amproc.amopclaid != 0 AND
NOT EXISTS(SELECT * FROM pg_opclass AS t1 WHERE t1.oid = pg_amproc.amopclaid);
-SELECT oid, pg_amproc.amproc
+SELECT ctid, pg_amproc.amproc
FROM pg_amproc
WHERE pg_amproc.amproc != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_amproc.amproc);
-SELECT oid, pg_attribute.attrelid
+SELECT ctid, pg_attribute.attrelid
FROM pg_attribute
WHERE pg_attribute.attrelid != 0 AND
NOT EXISTS(SELECT * FROM pg_class AS t1 WHERE t1.oid = pg_attribute.attrelid);
-SELECT oid, pg_attribute.atttypid
+SELECT ctid, pg_attribute.atttypid
FROM pg_attribute
WHERE pg_attribute.atttypid != 0 AND
NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_attribute.atttypid);
-SELECT oid, pg_class.reltype
+SELECT ctid, pg_class.reltype
FROM pg_class
WHERE pg_class.reltype != 0 AND
NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_class.reltype);
-SELECT oid, pg_class.relam
+SELECT ctid, pg_class.relam
FROM pg_class
WHERE pg_class.relam != 0 AND
NOT EXISTS(SELECT * FROM pg_am AS t1 WHERE t1.oid = pg_class.relam);
-SELECT oid, pg_class.reltoastrelid
+SELECT ctid, pg_class.reltoastrelid
FROM pg_class
WHERE pg_class.reltoastrelid != 0 AND
NOT EXISTS(SELECT * FROM pg_class AS t1 WHERE t1.oid = pg_class.reltoastrelid);
-SELECT oid, pg_class.reltoastidxid
+SELECT ctid, pg_class.reltoastidxid
FROM pg_class
WHERE pg_class.reltoastidxid != 0 AND
NOT EXISTS(SELECT * FROM pg_class AS t1 WHERE t1.oid = pg_class.reltoastidxid);
-SELECT oid, pg_index.indexrelid
+SELECT ctid, pg_description.classoid
+FROM pg_description
+WHERE pg_description.classoid != 0 AND
+ NOT EXISTS(SELECT * FROM pg_class AS t1 WHERE t1.oid = pg_description.classoid);
+SELECT ctid, pg_index.indexrelid
FROM pg_index
WHERE pg_index.indexrelid != 0 AND
NOT EXISTS(SELECT * FROM pg_class AS t1 WHERE t1.oid = pg_index.indexrelid);
-SELECT oid, pg_index.indrelid
+SELECT ctid, pg_index.indrelid
FROM pg_index
WHERE pg_index.indrelid != 0 AND
NOT EXISTS(SELECT * FROM pg_class AS t1 WHERE t1.oid = pg_index.indrelid);
-SELECT oid, pg_opclass.opcdeftype
+SELECT ctid, pg_opclass.opcdeftype
FROM pg_opclass
WHERE pg_opclass.opcdeftype != 0 AND
NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_opclass.opcdeftype);
-SELECT oid, pg_operator.oprleft
+SELECT ctid, pg_operator.oprleft
FROM pg_operator
WHERE pg_operator.oprleft != 0 AND
NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_operator.oprleft);
-SELECT oid, pg_operator.oprright
+SELECT ctid, pg_operator.oprright
FROM pg_operator
WHERE pg_operator.oprright != 0 AND
NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_operator.oprright);
-SELECT oid, pg_operator.oprresult
+SELECT ctid, pg_operator.oprresult
FROM pg_operator
WHERE pg_operator.oprresult != 0 AND
NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_operator.oprresult);
-SELECT oid, pg_operator.oprcom
+SELECT ctid, pg_operator.oprcom
FROM pg_operator
WHERE pg_operator.oprcom != 0 AND
NOT EXISTS(SELECT * FROM pg_operator AS t1 WHERE t1.oid = pg_operator.oprcom);
-SELECT oid, pg_operator.oprnegate
+SELECT ctid, pg_operator.oprnegate
FROM pg_operator
WHERE pg_operator.oprnegate != 0 AND
NOT EXISTS(SELECT * FROM pg_operator AS t1 WHERE t1.oid = pg_operator.oprnegate);
-SELECT oid, pg_operator.oprlsortop
+SELECT ctid, pg_operator.oprlsortop
FROM pg_operator
WHERE pg_operator.oprlsortop != 0 AND
NOT EXISTS(SELECT * FROM pg_operator AS t1 WHERE t1.oid = pg_operator.oprlsortop);
-SELECT oid, pg_operator.oprrsortop
+SELECT ctid, pg_operator.oprrsortop
FROM pg_operator
WHERE pg_operator.oprrsortop != 0 AND
NOT EXISTS(SELECT * FROM pg_operator AS t1 WHERE t1.oid = pg_operator.oprrsortop);
-SELECT oid, pg_operator.oprcode
+SELECT ctid, pg_operator.oprcode
FROM pg_operator
WHERE pg_operator.oprcode != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_operator.oprcode);
-SELECT oid, pg_operator.oprrest
+SELECT ctid, pg_operator.oprrest
FROM pg_operator
WHERE pg_operator.oprrest != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_operator.oprrest);
-SELECT oid, pg_operator.oprjoin
+SELECT ctid, pg_operator.oprjoin
FROM pg_operator
WHERE pg_operator.oprjoin != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_operator.oprjoin);
-SELECT oid, pg_proc.prolang
+SELECT ctid, pg_proc.prolang
FROM pg_proc
WHERE pg_proc.prolang != 0 AND
NOT EXISTS(SELECT * FROM pg_language AS t1 WHERE t1.oid = pg_proc.prolang);
-SELECT oid, pg_proc.prorettype
+SELECT ctid, pg_proc.prorettype
FROM pg_proc
WHERE pg_proc.prorettype != 0 AND
NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_proc.prorettype);
-SELECT oid, pg_rewrite.ev_class
+SELECT ctid, pg_rewrite.ev_class
FROM pg_rewrite
WHERE pg_rewrite.ev_class != 0 AND
NOT EXISTS(SELECT * FROM pg_class AS t1 WHERE t1.oid = pg_rewrite.ev_class);
-SELECT oid, pg_statistic.starelid
+SELECT ctid, pg_statistic.starelid
FROM pg_statistic
WHERE pg_statistic.starelid != 0 AND
NOT EXISTS(SELECT * FROM pg_class AS t1 WHERE t1.oid = pg_statistic.starelid);
-SELECT oid, pg_statistic.staop1
+SELECT ctid, pg_statistic.staop1
FROM pg_statistic
WHERE pg_statistic.staop1 != 0 AND
NOT EXISTS(SELECT * FROM pg_operator AS t1 WHERE t1.oid = pg_statistic.staop1);
-SELECT oid, pg_statistic.staop2
+SELECT ctid, pg_statistic.staop2
FROM pg_statistic
WHERE pg_statistic.staop2 != 0 AND
NOT EXISTS(SELECT * FROM pg_operator AS t1 WHERE t1.oid = pg_statistic.staop2);
-SELECT oid, pg_statistic.staop3
+SELECT ctid, pg_statistic.staop3
FROM pg_statistic
WHERE pg_statistic.staop3 != 0 AND
NOT EXISTS(SELECT * FROM pg_operator AS t1 WHERE t1.oid = pg_statistic.staop3);
-SELECT oid, pg_trigger.tgrelid
+SELECT ctid, pg_trigger.tgrelid
FROM pg_trigger
WHERE pg_trigger.tgrelid != 0 AND
NOT EXISTS(SELECT * FROM pg_class AS t1 WHERE t1.oid = pg_trigger.tgrelid);
-SELECT oid, pg_trigger.tgfoid
+SELECT ctid, pg_trigger.tgfoid
FROM pg_trigger
WHERE pg_trigger.tgfoid != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_trigger.tgfoid);
-SELECT oid, pg_type.typrelid
+SELECT ctid, pg_type.typrelid
FROM pg_type
WHERE pg_type.typrelid != 0 AND
NOT EXISTS(SELECT * FROM pg_class AS t1 WHERE t1.oid = pg_type.typrelid);
-SELECT oid, pg_type.typelem
+SELECT ctid, pg_type.typelem
FROM pg_type
WHERE pg_type.typelem != 0 AND
NOT EXISTS(SELECT * FROM pg_type AS t1 WHERE t1.oid = pg_type.typelem);
-SELECT oid, pg_type.typinput
+SELECT ctid, pg_type.typinput
FROM pg_type
WHERE pg_type.typinput != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_type.typinput);
-SELECT oid, pg_type.typoutput
+SELECT ctid, pg_type.typoutput
FROM pg_type
WHERE pg_type.typoutput != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_type.typoutput);
-SELECT oid, pg_type.typreceive
+SELECT ctid, pg_type.typreceive
FROM pg_type
WHERE pg_type.typreceive != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_type.typreceive);
-SELECT oid, pg_type.typsend
+SELECT ctid, pg_type.typsend
FROM pg_type
WHERE pg_type.typsend != 0 AND
NOT EXISTS(SELECT * FROM pg_proc AS t1 WHERE t1.oid = pg_type.typsend);
-- Look for illegal values in pg_amop fields
-SELECT p1.oid
+SELECT p1.amopclaid, p1.amopopr, p1.amopid
FROM pg_amop as p1
WHERE p1.amopid = 0 OR p1.amopclaid = 0 OR p1.amopopr = 0 OR
p1.amopstrategy <= 0;
--- Look for duplicate pg_amop entries
-
-SELECT p1.oid, p2.oid
-FROM pg_amop AS p1, pg_amop AS p2
-WHERE p1.oid != p2.oid AND
- p1.amopid = p2.amopid AND
- p1.amopclaid = p2.amopclaid AND
- p1.amopstrategy = p2.amopstrategy;
-
-- Cross-check amopstrategy index against parent AM
-SELECT p1.oid, p2.oid, p2.amname
+SELECT p1.amopclaid, p1.amopopr, p1.amopid, p2.oid, p2.amname
FROM pg_amop AS p1, pg_am AS p2
WHERE p1.amopid = p2.oid AND p1.amopstrategy > p2.amstrategies;
-- NOTE: for 7.1, add restriction that operator inputs are of same type.
-- We used to have opclasses like "int24_ops" but these were broken.
-SELECT p1.oid, p2.oid, p2.oprname
+SELECT p1.amopclaid, p1.amopopr, p1.amopid, p2.oid, p2.oprname
FROM pg_amop AS p1, pg_operator AS p2
WHERE p1.amopopr = p2.oid AND
(p2.oprkind != 'b' OR p2.oprresult != 16 OR p2.oprleft != p2.oprright);
-- If opclass is for a specific type, operator inputs should be of that type
-SELECT p1.oid, p2.oid, p2.oprname, p3.oid, p3.opcname
+SELECT p1.amopclaid, p1.amopopr, p1.amopid, p2.oid, p2.oprname, p3.oid, p3.opcname
FROM pg_amop AS p1, pg_operator AS p2, pg_opclass AS p3
WHERE p1.amopopr = p2.oid AND p1.amopclaid = p3.oid AND
p3.opcdeftype != 0 AND
-- Look for illegal values in pg_amproc fields
-SELECT p1.oid
+SELECT p1.amid, p1.amopclaid, p1.amprocnum
FROM pg_amproc as p1
WHERE p1.amid = 0 OR p1.amopclaid = 0 OR p1.amproc = 0 OR
p1.amprocnum <= 0;
--- Look for duplicate pg_amproc entries
-
-SELECT p1.oid, p2.oid
-FROM pg_amproc AS p1, pg_amproc AS p2
-WHERE p1.oid != p2.oid AND
- p1.amid = p2.amid AND
- p1.amopclaid = p2.amopclaid AND
- p1.amprocnum = p2.amprocnum;
-
-- Cross-check amprocnum index against parent AM
-SELECT p1.oid, p2.oid, p2.amname
+SELECT p1.amid, p1.amopclaid, p1.amprocnum, p2.oid, p2.amname
FROM pg_amproc AS p1, pg_am AS p2
WHERE p1.amid = p2.oid AND p1.amprocnum > p2.amsupport;
-- We can check that all the referenced instances of the same support
-- routine number take the same number of parameters, but that's about it...
-SELECT p1.oid, p2.oid, p2.proname, p3.oid, p4.oid, p4.proname
+SELECT p1.amid, p1.amopclaid, p1.amprocnum,
+ p2.oid, p2.proname,
+ p3.amid, p3.amopclaid, p3.amprocnum,
+ p4.oid, p4.proname
FROM pg_amproc AS p1, pg_proc AS p2, pg_amproc AS p3, pg_proc AS p4
-WHERE p1.oid != p3.oid AND
- p1.amid = p3.amid AND p1.amprocnum = p3.amprocnum AND
+WHERE p1.amid = p3.amid AND p1.amprocnum = p3.amprocnum AND
p1.amproc = p2.oid AND p3.amproc = p4.oid AND
(p2.proretset OR p4.proretset OR p2.pronargs != p4.pronargs);
-- Look for illegal values in pg_attribute fields
-SELECT p1.oid, p1.attrelid, p1.attname
+SELECT p1.attrelid, p1.attname
FROM pg_attribute as p1
WHERE p1.attrelid = 0 OR p1.atttypid = 0 OR p1.attnum = 0 OR
p1.attcacheoff != -1;
--- Look for duplicate pg_attribute entries
--- (This would not be necessary if the indexes on pg_attribute were UNIQUE?)
-
-SELECT p1.oid, p1.attname, p2.oid, p2.attname
-FROM pg_attribute AS p1, pg_attribute AS p2
-WHERE p1.oid != p2.oid AND
- p1.attrelid = p2.attrelid AND
- (p1.attname = p2.attname OR p1.attnum = p2.attnum);
-
-- Cross-check attnum against parent relation
-SELECT p1.oid, p1.attname, p2.oid, p2.relname
+SELECT p1.attrelid, p1.attname, p2.oid, p2.relname
FROM pg_attribute AS p1, pg_class AS p2
WHERE p1.attrelid = p2.oid AND p1.attnum > p2.relnatts;
-- Cross-check against pg_type entry
-SELECT p1.oid, p1.attname, p2.oid, p2.typname
+SELECT p1.attrelid, p1.attname, p2.oid, p2.typname
FROM pg_attribute AS p1, pg_type AS p2
WHERE p1.atttypid = p2.oid AND
(p1.attlen != p2.typlen OR