From c74dc1281f821cf7390b8bd3835fb9c800e2a185 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 13 Jun 2001 19:31:56 +0000 Subject: [PATCH] Update some obsolete examples. --- src/tutorial/syscat.source | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/tutorial/syscat.source b/src/tutorial/syscat.source index c674486a50..35a4d28db9 100644 --- a/src/tutorial/syscat.source +++ b/src/tutorial/syscat.source @@ -4,9 +4,10 @@ -- sample queries to the system catalogs -- -- --- Copyright (c) 1994, Regents of the University of California +-- Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group +-- Portions Copyright (c) 1994, Regents of the University of California -- --- $Id: syscat.source,v 1.3 1998/03/20 04:12:25 momjian Exp $ +-- $Id: syscat.source,v 1.4 2001/06/13 19:31:56 tgl Exp $ -- --------------------------------------------------------------------------- @@ -16,7 +17,7 @@ -- SELECT usename, datname FROM pg_user, pg_database - WHERE usesysid = int2in(int4out(datdba)) + WHERE usesysid = datdba ORDER BY usename, datname; -- @@ -24,14 +25,13 @@ SELECT usename, datname -- SELECT relname FROM pg_class - WHERE relkind = 'r' -- not indices + WHERE relkind = 'r' -- not indices, views, etc and relname !~ '^pg_' -- not catalogs - and relname !~ '^Inv' -- not large objects ORDER BY relname; -- --- lists all simple indicies (ie. those that are not defined over a function +-- lists all simple indices (ie. those that are not defined over a function -- of several attributes) -- SELECT bc.relname AS class_name, @@ -57,7 +57,6 @@ SELECT c.relname, a.attname, t.typname FROM pg_class c, pg_attribute a, pg_type t WHERE c.relkind = 'r' -- no indices and c.relname !~ '^pg_' -- no catalogs - and c.relname !~ '^Inv' -- no large objects and a.attnum > 0 -- no system att's and a.attrelid = c.oid and a.atttypid = t.oid @@ -69,7 +68,7 @@ SELECT c.relname, a.attname, t.typname -- SELECT u.usename, t.typname FROM pg_type t, pg_user u - WHERE u.usesysid = int2in(int4out(t.typowner)) + WHERE u.usesysid = t.typowner and t.typrelid = '0'::oid -- no complex types and t.typelem = '0'::oid -- no arrays and u.usename <> 'postgres' @@ -147,5 +146,3 @@ SELECT am.amname, opc.opcname, opr.oprname and amop.amopclaid = opc.oid and amop.amopopr = opr.oid ORDER BY amname, opcname, oprname; - - -- 2.40.0