Commit 5071ae29 authored by Bruce Momjian's avatar Bruce Momjian

Add pg_description table for info on tables, columns, operators, types, and...

Add pg_description table for info on tables, columns, operators, types, and aggregates.  Modify psql with new \dd operator to access description
parent 7e48d427
......@@ -34,7 +34,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.26 1997/09/20 16:08:24 thomas Exp $
# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.27 1997/11/13 03:22:10 momjian Exp $
#
#-------------------------------------------------------------------------
......@@ -51,7 +51,8 @@ endif
OBJS = $(DIRS:%=%/SUBSYS.o)
all: postgres $(POSTGRES_IMP) global1.bki.source local1_template1.bki.source
all: postgres $(POSTGRES_IMP) global1.bki.source local1_template1.bki.source \
global1.description local1_template1.description
postgres: $(OBJS) ../utils/version.o
$(CC) -o postgres $(OBJS) ../utils/version.o $(LDFLAGS)
......@@ -64,10 +65,12 @@ $(DIRS:%=%.dir):
../utils/version.o:
$(MAKE) -C ../utils version.o
global1.bki.source local1_template1.bki.source: catalog/$@
global1.bki.source local1_template1.bki.source \
global1.description local1_template1.description: catalog/$@
cp catalog/$@ .
catalog/global1.bki.source catalog/local1_template1.bki.source:
catalog/global1.bki.source catalog/local1_template1.bki.source \
catalog/global1.description catalog/local1_template1.description:
$(MAKE) -C catalog $@
# The postgres.o target is needed by the rule in Makefile.global that
......@@ -91,7 +94,8 @@ fmgr.h:
#############################################################################
clean:
rm -f postgres $(POSTGRES_IMP) fmgr.h parse.h \
global1.bki.source local1_template1.bki.source
global1.bki.source local1_template1.bki.source \
global1.description local1_template1.description
for i in $(DIRS); do $(MAKE) -C $$i clean PORTNAME=$(PORTNAME); done
.DEFAULT:
......@@ -115,6 +119,7 @@ clean:
install: $(LIBDIR) $(BINDIR) $(HEADERDIR) postgres $(POSTGRES_IMP) fmgr.h\
global1.bki.source local1_template1.bki.source \
global1.description local1_template1.description \
libpq/pg_hba.conf.sample optimizer/geqo/pg_geqo.sample
$(INSTALL) $(INSTL_EXE_OPTS) postgres $(BINDIR)/postgres
......@@ -126,8 +131,12 @@ endif
$(INSTALL) $(INSTLOPTS) fmgr.h $(HEADERDIR)/fmgr.h
$(INSTALL) $(INSTLOPTS) global1.bki.source \
$(LIBDIR)/global1.bki.source
$(INSTALL) $(INSTLOPTS) global1.description \
$(LIBDIR)/global1.description
$(INSTALL) $(INSTLOPTS) local1_template1.bki.source \
$(LIBDIR)/local1_template1.bki.source
$(INSTALL) $(INSTLOPTS) local1_template1.description \
$(LIBDIR)/local1_template1.description
$(INSTALL) $(INSTLOPTS) libpq/pg_hba.conf.sample \
$(LIBDIR)/pg_hba.conf.sample
$(INSTALL) $(INSTLOPTS) optimizer/geqo/pg_geqo.sample \
......
......@@ -4,7 +4,7 @@
# Makefile for catalog
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/backend/catalog/Makefile,v 1.3 1997/11/02 15:24:52 vadim Exp $
# $Header: /cvsroot/pgsql/src/backend/catalog/Makefile,v 1.4 1997/11/13 03:22:18 momjian Exp $
#
#-------------------------------------------------------------------------
......@@ -20,7 +20,8 @@ CFLAGS+=$(INCLUDE_OPT)
OBJS = catalog.o heap.o index.o indexing.o \
pg_aggregate.o pg_operator.o pg_proc.o pg_type.o
all: SUBSYS.o global1.bki.source local1_template1.bki.source
all: SUBSYS.o global1.bki.source local1_template1.bki.source \
global1.description local1_template1.description
SUBSYS.o: $(OBJS)
$(LD) -r -o SUBSYS.o $(OBJS)
......@@ -39,21 +40,21 @@ LOCALBKI_SRCS= $(addprefix ../../include/catalog/, \
pg_operator.h pg_opclass.h pg_am.h pg_amop.h pg_amproc.h \
pg_language.h pg_parg.h \
pg_aggregate.h pg_ipl.h pg_inheritproc.h \
pg_rewrite.h pg_listener.h indexing.h \
pg_rewrite.h pg_listener.h pg_description.h indexing.h \
)
global1.bki.source: $(GENBKI) $(GLOBALBKI_SRCS)
sh $(SHOPTS) $(GENBKI) $(BKIOPTS) $(GLOBALBKI_SRCS) > $@
sh $(SHOPTS) $(GENBKI) $(BKIOPTS) $(GLOBALBKI_SRCS) > $@ 2>global1.description
local1_template1.bki.source: $(GENBKI) $(LOCALBKI_SRCS)
sh $(SHOPTS) $(GENBKI) $(BKIOPTS) $(LOCALBKI_SRCS) > $@
sh $(SHOPTS) $(GENBKI) $(BKIOPTS) $(LOCALBKI_SRCS) > $@ 2>local1_template1.description
depend dep:
$(CC) -MM $(INCLUDE_OPT) *.c >depend
clean:
rm -f SUBSYS.o $(OBJS) global1.bki.source local1_template1.bki.source
rm -f SUBSYS.o $(OBJS) global1.bki.source local1_template1.bki.source \
global1.description local1_template1.description
ifeq (depend,$(wildcard depend))
include depend
......
......@@ -10,7 +10,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/backend/catalog/Attic/genbki.sh,v 1.8 1997/09/06 18:27:11 momjian Exp $
# $Header: /cvsroot/pgsql/src/backend/catalog/Attic/genbki.sh,v 1.9 1997/11/13 03:22:20 momjian Exp $
#
# NOTES
# non-essential whitespace is removed from the generated file.
......@@ -18,6 +18,10 @@
# end can be changed into another awk script or something smarter..
#
#-------------------------------------------------------------------------
trap "rm -f /tmp/genbki.tmp" 0 1 2 3 15
# make sure it is empty
>/tmp/genbki.tmp
PATH=$PATH:/lib:/usr/ccs/lib # to find cpp
BKIOPTS=''
......@@ -118,6 +122,27 @@ raw == 1 { print; next; }
/^DATA\(/ {
data = substr($0, 6, length($0) - 6);
print data;
nf = 1;
oid = 0;
while (nf <= NF-3)
{
if ($nf == "OID" && $(nf+1) == "=")
{
oid = $(nf+2);
break;
}
nf++;
}
next;
}
/^DESCR\(/ {
if (oid != 0)
{
data = substr($0, 8, length($0) - 9);
if (data != "")
printf "%d %s\n", oid, data >> "/tmp/genbki.tmp";
}
next;
}
......@@ -235,6 +260,9 @@ cpp $BKIOPTS | \
sed -e '/^[ ]*$/d' \
-e 's/[ ][ ]*/ /g'
# send pg_description file contents to standard error
cat /tmp/genbki.tmp 1>&2
# ----------------
# all done
# ----------------
......
......@@ -26,7 +26,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.24 1997/02/19 13:11:58 scrappy Exp $
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.25 1997/11/13 03:22:34 momjian Exp $
#
#-------------------------------------------------------------------------
......@@ -152,6 +152,8 @@ fi
TEMPLATE=$PGLIB/local1_template1.bki.source
GLOBAL=$PGLIB/global1.bki.source
TEMPLATE_DESCR=$PGLIB/local1_template1.description
GLOBAL_DESCR=$PGLIB/global1.description
PG_HBA_SAMPLE=$PGLIB/pg_hba.conf.sample
PG_GEQO_SAMPLE=$PGLIB/pg_geqo.sample
......@@ -344,8 +346,11 @@ fi
echo
if [ $debug -eq 0 ]; then
echo "vacuuming template1"
echo "vacuum" | postgres -F -Q -D$PGDATA template1 2>&1 > /dev/null |\
grep -v "^DEBUG:"
fi
echo "vacuuming template1"
echo "vacuum" | postgres -F -Q -D$PGDATA template1 2>&1 > /dev/null |\
grep -v "^DEBUG:"
echo "loading pg_description"
echo "copy pg_description from '$TEMPLATE_DESCR'" | postgres -F -Q -D$PGDATA template1 > /dev/null
echo "copy pg_description from '$GLOBAL_DESCR'" | postgres -F -Q -D$PGDATA template1 > /dev/null
......@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.101 1997/11/07 06:27:52 thomas Exp $
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.102 1997/11/13 03:22:42 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -116,6 +116,7 @@ handleCopyIn(PGresult *res, const bool mustprompt,
FILE *copystream);
static int tableList(PsqlSettings *pset, bool deep_tablelist, char info_type);
static int tableDesc(PsqlSettings *pset, char *table, FILE *fout);
static int objectDescription(PsqlSettings *pset, char *object, FILE *fout);
static int rightsList(PsqlSettings *pset);
static void prompt_for_password(char *username, char *password);
static char *
......@@ -224,6 +225,7 @@ slashUsage(PsqlSettings *pset)
fprintf(fout, " \\connect <dbname|-> <user> -- connect to new database (currently '%s')\n", PQdb(pset->db));
fprintf(fout, " \\copy table {from | to} <fname>\n");
fprintf(fout, " \\d [<table>] -- list tables and indices in database or columns in <table>, * for all\n");
fprintf(fout, " \\dc [<object>]- list comment for table, field, type, function, or operator.\n");
fprintf(fout, " \\di -- list only indices in database\n");
fprintf(fout, " \\ds -- list only sequences in database\n");
fprintf(fout, " \\dt -- list only tables in database\n");
......@@ -331,8 +333,8 @@ tableList(PsqlSettings *pset, bool deep_tablelist, char info_type)
#endif
listbuf[0] = '\0';
strcat(listbuf, "SELECT usename, relname, relkind, relhasrules");
strcat(listbuf, " FROM pg_class, pg_user ");
strcat(listbuf, "SELECT usename, relname, relkind, relhasrules ");
strcat(listbuf, "FROM pg_class, pg_user ");
switch (info_type)
{
case 't':
......@@ -356,8 +358,8 @@ tableList(PsqlSettings *pset, bool deep_tablelist, char info_type)
* the usesysid = relowner won't work on stock 1.0 dbs, need to add in
* the int4oideq function
*/
strcat(listbuf, " and usesysid = relowner");
strcat(listbuf, " ORDER BY relname ");
strcat(listbuf, " and usesysid = relowner");
strcat(listbuf, " ORDER BY relname ");
if (!(res = PSQLexec(pset, listbuf)))
return -1;
/* first, print out the attribute names */
......@@ -472,8 +474,8 @@ rightsList(PsqlSettings *pset)
PGresult *res;
listbuf[0] = '\0';
strcat(listbuf, "SELECT relname, relacl");
strcat(listbuf, " FROM pg_class, pg_user ");
strcat(listbuf, "SELECT relname, relacl ");
strcat(listbuf, "FROM pg_class, pg_user ");
strcat(listbuf, "WHERE ( relkind = 'r' OR relkind = 'i') ");
strcat(listbuf, " and relname !~ '^pg_'");
strcat(listbuf, " and relname !~ '^xin[vx][0-9]+'");
......@@ -560,9 +562,9 @@ tableDesc(PsqlSettings *pset, char *table, FILE *fout)
}
descbuf[0] = '\0';
strcat(descbuf, "SELECT a.attnum, a.attname, t.typname, a.attlen, a.attnotnull");
strcat(descbuf, " FROM pg_class c, pg_attribute a, pg_type t ");
strcat(descbuf, " WHERE c.relname = '");
strcat(descbuf, "SELECT a.attnum, a.attname, t.typname, a.attlen, a.attnotnull ");
strcat(descbuf, "FROM pg_class c, pg_attribute a, pg_type t ");
strcat(descbuf, "WHERE c.relname = '");
strcat(descbuf, table);
strcat(descbuf, "'");
strcat(descbuf, " and a.attnum > 0 ");
......@@ -659,6 +661,197 @@ tableDesc(PsqlSettings *pset, char *table, FILE *fout)
}
}
/*
* Get object comments
*
* Describe the columns in a database table. returns 0 if all went well
*
*
*/
int
objectDescription(PsqlSettings *pset, char *object, FILE *fout)
{
char descbuf[256];
int nDescriptions;
int i;
PGresult *res;
int usePipe = 0;
char *pagerenv;
#ifdef TIOCGWINSZ
if (fout == NULL &&
pset->notty == 0 &&
(ioctl(fileno(stdout), TIOCGWINSZ, &screen_size) == -1 ||
screen_size.ws_col == 0 ||
screen_size.ws_row == 0))
{
#endif
screen_size.ws_row = 24;
screen_size.ws_col = 80;
#ifdef TIOCGWINSZ
}
#endif
/* Build the query */
while (isspace(*object))
object++;
/* if the object name is surrounded by double-quotes, then don't convert case */
if (*object == '"')
{
object++;
if (*(object+strlen(object)-1) == '"')
*(object+strlen(object)-1) = '\0';
}
else
{
for (i = strlen(object); i >= 0; i--)
if (isupper(object[i]))
object[i] = tolower(object[i]);
}
descbuf[0] = '\0';
if (strchr(object,'.') != NULL)
{
char table[NAMEDATALEN],column[NAMEDATALEN];
StrNCpy(table,object,
((strchr(object,'.')-object+1) < NAMEDATALEN) ?
(strchr(object,'.')-object+1) : NAMEDATALEN);
StrNCpy(column,strchr(object,'.')+1,NAMEDATALEN);
strcat(descbuf, "SELECT DISTINCT description ");
strcat(descbuf, "FROM pg_class, pg_attribute, pg_description ");
strcat(descbuf, "WHERE pg_class.relname = '");
strcat(descbuf, table);
strcat(descbuf, "' and ");
strcat(descbuf, "pg_class.oid = pg_attribute.attrelid and ");
strcat(descbuf, "pg_attribute.attname = '");
strcat(descbuf, column);
strcat(descbuf, "' and ");
strcat(descbuf, " pg_attribute.oid = pg_description.rowoid " );
if (!(res = PSQLexec(pset, descbuf)))
return -1;
}
else
{
strcat(descbuf, "SELECT DISTINCT description ");
strcat(descbuf, "FROM pg_class, pg_description ");
strcat(descbuf, "WHERE pg_class.relname = '");
strcat(descbuf, object);
strcat(descbuf, "'" );
strcat(descbuf, " and pg_class.oid = pg_description.rowoid " );
if (!(res = PSQLexec(pset, descbuf)))
return -1;
else if (PQntuples(res) <= 0)
{
PQclear(res);
descbuf[0] = '\0';
strcat(descbuf, "SELECT DISTINCT description ");
strcat(descbuf, "FROM pg_type, pg_description ");
strcat(descbuf, "WHERE pg_type.typname = '");
strcat(descbuf, object);
strcat(descbuf, "'" );
strcat(descbuf, " and pg_type.oid = pg_description.rowoid " );
if (!(res = PSQLexec(pset, descbuf)))
return -1;
else if (PQntuples(res) <= 0)
{
PQclear(res);
descbuf[0] = '\0';
strcat(descbuf, "SELECT DISTINCT description ");
strcat(descbuf, "FROM pg_type, pg_description ");
strcat(descbuf, "WHERE pg_type.typname = '");
strcat(descbuf, object);
strcat(descbuf, "'" );
strcat(descbuf, " and pg_type.oid = pg_description.rowoid " );
if (!(res = PSQLexec(pset, descbuf)))
return -1;
else if (PQntuples(res) <= 0)
{
PQclear(res);
descbuf[0] = '\0';
strcat(descbuf, "SELECT DISTINCT description ");
strcat(descbuf, "FROM pg_proc, pg_description ");
strcat(descbuf, "WHERE pg_proc.proname = '");
strcat(descbuf, object);
strcat(descbuf, "'" );
strcat(descbuf, " and pg_proc.oid = pg_description.rowoid " );
if (!(res = PSQLexec(pset, descbuf)))
return -1;
else if (PQntuples(res) <= 0)
{
PQclear(res);
descbuf[0] = '\0';
strcat(descbuf, "SELECT DISTINCT description ");
strcat(descbuf, "FROM pg_operator, pg_description ");
strcat(descbuf, "WHERE pg_operator.oprname = '");
strcat(descbuf, object);
strcat(descbuf, "'" );
strcat(descbuf, " and pg_operator.oid = pg_description.rowoid " );
if (!(res = PSQLexec(pset, descbuf)))
return -1;
else if (PQntuples(res) <= 0)
{
PQclear(res);
descbuf[0] = '\0';
strcat(descbuf, "SELECT DISTINCT description ");
strcat(descbuf, "FROM pg_aggregate, pg_description ");
strcat(descbuf, "WHERE pg_aggregate.aggname = '");
strcat(descbuf, object);
strcat(descbuf, "'" );
strcat(descbuf, " and pg_aggregate.oid = pg_description.rowoid " );
if (!(res = PSQLexec(pset, descbuf)))
return -1;
}
}
}
}
}
}
nDescriptions = PQntuples(res);
if (nDescriptions > 0)
{
if (fout == NULL)
{
if (pset->notty == 0 &&
(pagerenv = getenv("PAGER")) &&
pagerenv[0] != '\0' &&
screen_size.ws_row <= nDescriptions + 1 &&
(fout = popen(pagerenv, "w")))
{
usePipe = 1;
pqsignal(SIGPIPE, SIG_IGN);
}
else
fout = stdout;
}
/*
* * Display the information
*/
fprintf(fout,"\nObject = %s\n", object);
/* next, print out the instances */
for (i = 0; i < PQntuples(res); i++)
fprintf(fout,"%s\n",PQgetvalue(res, i, 0));
PQclear(res);
if (usePipe)
{
pclose(fout);
pqsignal(SIGPIPE, SIG_DFL);
}
return (0);
}
else
{
fprintf(stderr, "Couldn't find comments for object %s!\n", object);
return (-1);
}
}
typedef char *(*READ_ROUTINE) (char *prompt, FILE *source);
/*
......@@ -1505,31 +1698,29 @@ HandleSlashCmds(PsqlSettings *pset,
break;
case 'd': /* \d describe tables or columns in a
* table */
if (strncmp(cmd, "dt", 2) == 0)
{ /* only tables */
tableList(pset, false, 't');
}
if (strncmp(cmd, "dc", 2) == 0)
/* descriptions */
objectDescription(pset, optarg+1, NULL);
else if (strncmp(cmd, "di", 2) == 0)
{ /* only indices */
/* only indices */
tableList(pset, false, 'i');
}
else if (strncmp(cmd, "ds", 2) == 0)
{ /* only sequences */
/* only sequences */
tableList(pset, false, 'S');
}
else if (strncmp(cmd, "dt", 2) == 0)
/* only tables */
tableList(pset, false, 't');
else if (!optarg)
{ /* show tables, sequences and indices */
/* show tables, sequences and indices */
tableList(pset, false, 'b');
}
else if (strcmp(optarg, "*") == 0)
{ /* show everything */
if (tableList(pset, false, 'b') == 0)
tableList(pset, true, 'b');
}
else
{ /* describe the specified table */
/* describe the specified table */
tableDesc(pset, optarg, NULL);
}
break;
case 'e': /* edit */
{
......
......@@ -7,7 +7,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: indexing.h,v 1.7 1997/09/08 21:51:25 momjian Exp $
* $Id: indexing.h,v 1.8 1997/11/13 03:22:54 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -27,6 +27,7 @@
#define Num_pg_attrdef_indices 1
#define Num_pg_relcheck_indices 1
#define Num_pg_trigger_indices 1
#define Num_pg_description_indices 1
/*
......@@ -45,6 +46,7 @@
#define AttrDefaultIndex "pg_attrdefind"
#define RelCheckIndex "pg_relcheckind"
#define TriggerRelidIndex "pg_trigrelidind"
#define DescriptionRowOidIndex "pg_descrrowoidind"
extern char *Name_pg_attr_indices[];
extern char *Name_pg_proc_indices[];
......@@ -53,6 +55,7 @@ extern char *Name_pg_class_indices[];
extern char *Name_pg_attrdef_indices[];
extern char *Name_pg_relcheck_indices[];
extern char *Name_pg_trigger_indices[];
extern char *Name_pg_rowoid_indices[];
extern char *IndexedCatalogNames[];
......@@ -116,6 +119,8 @@ DECLARE_INDEX(pg_relcheckind on pg_relcheck using btree(rcrelid oid_ops));
DECLARE_INDEX(pg_trigrelidind on pg_trigger using btree(tgrelid oid_ops));
DECLARE_INDEX(pg_descrrowoidind on pg_description using btree(rowoid oid_ops));
/* now build indices in the initialization scripts */
BUILD_INDICES
......
......@@ -7,7 +7,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_am.h,v 1.4 1997/09/08 02:34:55 momjian Exp $
* $Id: pg_am.h,v 1.5 1997/11/13 03:22:57 momjian Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
......@@ -100,15 +100,20 @@ typedef FormData_pg_am *Form_pg_am;
*/
DATA(insert OID = 405 ( hash PGUID "o" 1 1 hashgettuple hashinsert hashdelete - - - - hashbeginscan hashrescan hashendscan hashmarkpos hashrestrpos - - hashbuild - - ));
DESCR("");
DATA(insert OID = 402 ( rtree PGUID "o" 8 3 rtgettuple rtinsert rtdelete - - - - rtbeginscan rtrescan rtendscan rtmarkpos rtrestrpos - - rtbuild - - ));
DESCR("");
DATA(insert OID = 403 ( btree PGUID "o" 5 1 btgettuple btinsert btdelete - - - - btbeginscan btrescan btendscan btmarkpos btrestrpos - - btbuild - - ));
DESCR("");
#define BTREE_AM_OID 403
DATA(insert OID = 783 ( gist PGUID "o" 100 7 gistgettuple gistinsert gistdelete - - - - gistbeginscan gistrescan gistendscan gistmarkpos gistrestrpos - - gistbuild - - ));
DESCR("");
BKI_BEGIN
#ifdef NOBTREE
BKI_END
DATA(insert OID = 404 ( nobtree PGUID "o" 5 1 nobtgettuple nobtinsert nobtdelete - - - - nobtbeginscan nobtrescan nobtendscan nobtmarkpos nobtrestrpos - - nobtbuild - - ));
DESCR("");
BKI_BEGIN
#endif /* NOBTREE */
BKI_END
......
......@@ -7,7 +7,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_class.h,v 1.12 1997/11/02 15:26:59 vadim Exp $
* $Id: pg_class.h,v 1.13 1997/11/13 03:22:58 momjian Exp $
*
* NOTES
* ``pg_relation'' is being replaced by ``pg_class''. currently
......@@ -129,22 +129,39 @@ typedef FormData_pg_class *Form_pg_class;
*/
DATA(insert OID = 1247 ( pg_type 71 PGUID 0 0 0 0 0 f f r n 16 0 0 0 f _null_ ));
DESCR("");
DATA(insert OID = 1249 ( pg_attribute 75 PGUID 0 0 0 0 0 f f r n 16 0 0 0 f _null_ ));
DESCR("");
DATA(insert OID = 1251 ( pg_demon 76 PGUID 0 0 0 0 0 f t r n 4 0 0 0 f _null_ ));
DESCR("");
DATA(insert OID = 1253 ( pg_magic 80 PGUID 0 0 0 0 0 f t r n 2 0 0 0 f _null_ ));
DESCR("");
DATA(insert OID = 1255 ( pg_proc 81 PGUID 0 0 0 0 0 f f r n 16 0 0 0 f _null_ ));
DESCR("");
DATA(insert OID = 1257 ( pg_server 82 PGUID 0 0 0 0 0 f t r n 3 0 0 0 f _null_ ));
DESCR("");
DATA(insert OID = 1259 ( pg_class 83 PGUID 0 0 0 0 0 f f r n 18 0 0 0 f _null_ ));
DESCR("");
DATA(insert OID = 1260 ( pg_user 86 PGUID 0 0 0 0 0 f t r n 6 0 0 0 f _null_ ));
DESCR("");
DATA(insert OID = 1261 ( pg_group 87 PGUID 0 0 0 0 0 f t s n 3 0 0 0 f _null_ ));
DESCR("");
DATA(insert OID = 1262 ( pg_database 88 PGUID 0 0 0 0 0 f t r n 3 0 0 0 f _null_ ));
DESCR("");
DATA(insert OID = 1263 ( pg_defaults 89 PGUID 0 0 0 0 0 f t r n 2 0 0 0 f _null_ ));
DESCR("");
DATA(insert OID = 1264 ( pg_variable 90 PGUID 0 0 0 0 0 f t s n 2 0 0 0 f _null_ ));
DESCR("");
DATA(insert OID = 1269 ( pg_log 99 PGUID 0 0 0 0 0 f t s n 1 0 0 0 f _null_ ));
DESCR("");
DATA(insert OID = 1273 ( pg_hosts 101 PGUID 0 0 0 0 0 f t s n 3 0 0 0 f _null_ ));
DESCR("");
DATA(insert OID = 1215 ( pg_attrdef 109 PGUID 0 0 0 0 0 t t r n 4 0 0 0 f _null_ ));
DESCR("");
DATA(insert OID = 1216 ( pg_relcheck 110 PGUID 0 0 0 0 0 t t r n 4 0 0 0 f _null_ ));
DESCR("");
DATA(insert OID = 1219 ( pg_trigger 111 PGUID 0 0 0 0 0 t t r n 7 0 0 0 f _null_ ));
DESCR("");
#define RelOid_pg_type 1247
#define RelOid_pg_demon 1251
......
/*-------------------------------------------------------------------------
*
* pg_description.h--
* definition of the system "description" relation (pg_description)
*
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_description.h,v 1.1 1997/11/13 03:22:59 momjian Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
* XXX do NOT break up DATA() statements into multiple lines!
* the scripts are not as smart as you might think...
*
*-------------------------------------------------------------------------
*/
#ifndef PG_DESCRIPTION_H
#define PG_DESCRIPTION_H
/* ----------------
* postgres.h contains the system type definintions and the
* CATALOG(), BOOTSTRAP and DATA() sugar words so this file
* can be read by both genbki.sh and the C compiler.
* ----------------
*/
/* ----------------
* pg_description definition. cpp turns this into
* typedef struct FormData_pg_description
* ----------------
*/
CATALOG(pg_description)
{
Oid rowoid;
text description;
} FormData_pg_description;
/* ----------------
* Form_pg_description corresponds to a pointer to a tuple with
* the format of pg_description relation.
* ----------------
*/
typedef FormData_pg_description *Form_pg_description;
/* ----------------
* compiler constants for pg_descrpition
* ----------------
*/
#define Natts_pg_description 2
#define Anum_pg_description_rowoid 1
#define Anum_pg_description_description 2
/* ----------------
* initial contents of pg_description
* ----------------
*/
/* Because the contents of this table are taken from the other *.h files,
there is no initialization.
*/
#endif /* PG_DESCRIPTION_H */
......@@ -7,7 +7,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_language.h,v 1.5 1997/10/28 15:08:05 vadim Exp $
* $Id: pg_language.h,v 1.6 1997/11/13 03:23:02 momjian Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
......@@ -63,11 +63,15 @@ typedef FormData_pg_language *Form_pg_language;
*/
DATA(insert OID = 11 ( internal f 0 0 "n/a" ));
DESCR("");
#define INTERNALlanguageId 11
DATA(insert OID = 12 ( lisp f 0 0 "/usr/ucb/liszt" ));
DESCR("");
DATA(insert OID = 13 ( "C" f 0 0 "/bin/cc" ));
DESCR("");
#define ClanguageId 13
DATA(insert OID = 14 ( "sql" f 0 0 "postgres"));
DESCR("");
#define SQLlanguageId 14
......
......@@ -7,7 +7,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_opclass.h,v 1.5 1997/09/08 02:35:19 momjian Exp $
* $Id: pg_opclass.h,v 1.6 1997/11/13 03:23:03 momjian Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
......@@ -63,33 +63,61 @@ typedef FormData_pg_opclass *Form_pg_opclass;
* in, which are invalid OID's anyway. --djm
*/
DATA(insert OID = 406 ( char2_ops 409 ));
DESCR("");
DATA(insert OID = 407 ( char4_ops 410 ));
DESCR("");
DATA(insert OID = 408 ( char8_ops 411 ));
DESCR("");
DATA(insert OID = 1181 ( name_ops 19 ));
DESCR("");
DATA(insert OID = 421 ( int2_ops 21 ));
DESCR("");
DATA(insert OID = 422 ( box_ops 603 ));
DESCR("");
DATA(insert OID = 423 ( float8_ops 701 ));
DESCR("");
DATA(insert OID = 424 ( int24_ops 0 ));
DESCR("");
DATA(insert OID = 425 ( int42_ops 0 ));
DESCR("");
DATA(insert OID = 426 ( int4_ops 23 ));
DESCR("");
#define INT4_OPS_OID 426
DATA(insert OID = 427 ( oid_ops 26 ));
DESCR("");
DATA(insert OID = 428 ( float4_ops 700 ));
DESCR("");
DATA(insert OID = 429 ( char_ops 18 ));
DESCR("");
DATA(insert OID = 430 ( char16_ops 20 ));
DESCR("");
DATA(insert OID = 431 ( text_ops 25 ));
DESCR("");
DATA(insert OID = 432 ( abstime_ops 702 ));
DESCR("");
DATA(insert OID = 433 ( bigbox_ops 0 ));
DESCR("");
DATA(insert OID = 434 ( poly_ops 604 ));
DESCR("");
DATA(insert OID = 435 ( oidint4_ops 910 ));
DESCR("");
DATA(insert OID = 436 ( oidname_ops 911 ));
DESCR("");
DATA(insert OID = 437 ( oidint2_ops 810 ));
DESCR("");
DATA(insert OID = 714 ( circle_ops 718 ));
DESCR("");
DATA(insert OID = 1076 ( bpchar_ops 1042 ));
DESCR("");
DATA(insert OID = 1077 ( varchar_ops 1043 ));
DESCR("");
DATA(insert OID = 1114 ( date_ops 1082 ));
DESCR("");
DATA(insert OID = 1115 ( time_ops 1083 ));
DESCR("");
DATA(insert OID = 1312 ( datetime_ops 1184 ));
DESCR("");
DATA(insert OID = 1313 ( timespan_ops 1186 ));
DESCR("");
#endif /* PG_OPCLASS_H */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -6,7 +6,7 @@
*
* Copyright (c) 1995, Regents of the University of California
*
* $Id: postgres.h,v 1.10 1997/11/02 15:26:28 vadim Exp $
* $Id: postgres.h,v 1.11 1997/11/13 03:22:46 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -176,6 +176,7 @@ typedef uint32 CommandId;
typedef struct CppConcat(FormData_,x)
#define DATA(x) extern int errno
#define DESCR(x) extern int errno
#define DECLARE_INDEX(x) extern int errno
#define BUILD_INDICES
......
.\" This is -*-nroff-*-
.\" XXX standard disclaimer belongs here....
.\" $Header: /cvsroot/pgsql/src/man/Attic/psql.1,v 1.12 1997/08/26 17:30:08 momjian Exp $
.\" $Header: /cvsroot/pgsql/src/man/Attic/psql.1,v 1.13 1997/11/13 03:23:18 momjian Exp $
.TH PSQL UNIX 1/20/96 PostgreSQL PostgreSQL
.SH NAME
psql \(em run the interactive query front-end
......@@ -292,10 +292,14 @@ is specified, list the columns in
If table name is
.IR *,
list all tables and column information for each tables.
.IP "\edc object"
List the description of the table, table.column, type, operator, or aggregate.
.IP "\edi"
List only indexes.
.IP "\edt"
List only tables.
.IP "\eds"
List only sequences.
.IP "\ee [\fIfilename\fR]"
Edit the current query buffer or \fIfile\fR.
.IP "\eE [\fIfilename\fR]"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment