Skip to content

Commit e181001

Browse files
committed
Small fix to Christopher's recent improvements --- underscore is not
a special character in regexes, but it is for LIKE, so NOT LIKE 'pg_%' is incorrect. Need NOT LIKE 'pg\_%'.
1 parent ede9b68 commit e181001

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/tutorial/syscat.source

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-- Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
88
-- Portions Copyright (c) 1994, Regents of the University of California
99
--
10-
-- $Id: syscat.source,v 1.10 2003/10/26 04:51:51 momjian Exp $
10+
-- $Id: syscat.source,v 1.11 2003/10/31 03:58:15 tgl Exp $
1111
--
1212
---------------------------------------------------------------------------
1313

@@ -29,12 +29,12 @@ SELECT usename, datname
2929
--
3030
-- lists all user-defined classes
3131
--
32-
SELECT pgn.nspname, pgc.relname
33-
FROM pg_class pgc, pg_namespace pgn
34-
WHERE pgc.relnamespace=pgn.oid
35-
and pgc.relkind = 'r' -- not indices, views, etc
36-
and pgn.nspname not like 'pg_%' -- not catalogs
37-
and pgn.nspname != 'information_schema' -- not information_schema
32+
SELECT n.nspname, c.relname
33+
FROM pg_class c, pg_namespace n
34+
WHERE c.relnamespace=n.oid
35+
and c.relkind = 'r' -- not indices, views, etc
36+
and n.nspname not like 'pg\\_%' -- not catalogs
37+
and n.nspname != 'information_schema' -- not information_schema
3838
ORDER BY nspname, relname;
3939

4040

@@ -69,7 +69,7 @@ SELECT n.nspname, c.relname, a.attname, format_type(t.oid, null) as typname
6969
pg_attribute a, pg_type t
7070
WHERE n.oid = c.relnamespace
7171
and c.relkind = 'r' -- no indices
72-
and n.nspname not like 'pg_%' -- no catalogs
72+
and n.nspname not like 'pg\\_%' -- no catalogs
7373
and n.nspname != 'information_schema' -- no information_schema
7474
and a.attnum > 0 -- no system att's
7575
and not a.attisdropped -- no dropped columns
@@ -87,7 +87,7 @@ SELECT n.nspname, u.usename, format_type(t.oid, null) as typname
8787
and t.typnamespace = n.oid
8888
and t.typrelid = '0'::oid -- no complex types
8989
and t.typelem = '0'::oid -- no arrays
90-
and n.nspname not like 'pg_%' -- no catalogs
90+
and n.nspname not like 'pg\\_%' -- no catalogs
9191
and n.nspname != 'information_schema' -- no information_schema
9292
ORDER BY nspname, usename, typname;
9393

@@ -146,7 +146,7 @@ SELECT n.nspname, p.proname, p.pronargs, format_type(t.oid, null) as return_type
146146
FROM pg_namespace n, pg_proc p,
147147
pg_language l, pg_type t
148148
WHERE p.pronamespace = n.oid
149-
and n.nspname not like 'pg_%' -- no catalogs
149+
and n.nspname not like 'pg\\_%' -- no catalogs
150150
and n.nspname != 'information_schema' -- no information_schema
151151
and p.prolang = l.oid
152152
and p.prorettype = t.oid

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy