Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc74dc12

Browse files
committed
Update some obsolete examples.
1 parentbbb7b6f commitc74dc12

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

‎src/tutorial/syscat.source

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
-- sample queries to the system catalogs
55
--
66
--
7-
-- Copyright (c) 1994, Regents of the University of California
7+
-- Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
8+
-- Portions Copyright (c) 1994, Regents of the University of California
89
--
9-
-- $Id: syscat.source,v 1.3 1998/03/20 04:12:25 momjian Exp $
10+
-- $Id: syscat.source,v 1.4 2001/06/13 19:31:56 tgl Exp $
1011
--
1112
---------------------------------------------------------------------------
1213

@@ -16,22 +17,21 @@
1617
--
1718
SELECT usename, datname
1819
FROM pg_user, pg_database
19-
WHERE usesysid =int2in(int4out(datdba))
20+
WHERE usesysid = datdba
2021
ORDER BY usename, datname;
2122

2223
--
2324
-- lists all user-defined classes
2425
--
2526
SELECT relname
2627
FROM pg_class
27-
WHERE relkind = 'r' -- not indices
28+
WHERE relkind = 'r' -- not indices, views, etc
2829
and relname !~ '^pg_' -- not catalogs
29-
and relname !~ '^Inv' -- not large objects
3030
ORDER BY relname;
3131

3232

3333
--
34-
-- lists all simpleindicies (ie. those that are not defined over a function
34+
-- lists all simpleindices (ie. those that are not defined over a function
3535
-- of several attributes)
3636
--
3737
SELECT bc.relname AS class_name,
@@ -57,7 +57,6 @@ SELECT c.relname, a.attname, t.typname
5757
FROM pg_class c, pg_attribute a, pg_type t
5858
WHERE c.relkind = 'r' -- no indices
5959
and c.relname !~ '^pg_' -- no catalogs
60-
and c.relname !~ '^Inv' -- no large objects
6160
and a.attnum > 0 -- no system att's
6261
and a.attrelid = c.oid
6362
and a.atttypid = t.oid
@@ -69,7 +68,7 @@ SELECT c.relname, a.attname, t.typname
6968
--
7069
SELECT u.usename, t.typname
7170
FROM pg_type t, pg_user u
72-
WHERE u.usesysid =int2in(int4out(t.typowner))
71+
WHERE u.usesysid = t.typowner
7372
and t.typrelid = '0'::oid -- no complex types
7473
and t.typelem = '0'::oid -- no arrays
7574
and u.usename <> 'postgres'
@@ -147,5 +146,3 @@ SELECT am.amname, opc.opcname, opr.oprname
147146
and amop.amopclaid = opc.oid
148147
and amop.amopopr = opr.oid
149148
ORDER BY amname, opcname, oprname;
150-
151-

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp