aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2001-06-13 19:31:56 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2001-06-13 19:31:56 +0000
commitc74dc1281f821cf7390b8bd3835fb9c800e2a185 (patch)
tree5c2ee97babcab69e6ecb3058de31439d4a03e67a /src
parentbbb7b6f699492b00c2cecae7ecd60e14b68dbdd8 (diff)
downloadpostgresql-c74dc1281f821cf7390b8bd3835fb9c800e2a185.tar.gz
postgresql-c74dc1281f821cf7390b8bd3835fb9c800e2a185.zip
Update some obsolete examples.
Diffstat (limited to 'src')
-rw-r--r--src/tutorial/syscat.source17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/tutorial/syscat.source b/src/tutorial/syscat.source
index c674486a504..35a4d28db9a 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;
-
-