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

Commite181001

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 parentede9b68 commite181001

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-
SELECTpgn.nspname,pgc.relname
33-
FROM pg_classpgc, pg_namespacepgn
34-
WHEREpgc.relnamespace=pgn.oid
35-
andpgc.relkind = 'r' -- not indices, views, etc
36-
andpgn.nspname not like 'pg_%' -- not catalogs
37-
andpgn.nspname != 'information_schema' -- not information_schema
32+
SELECTn.nspname,c.relname
33+
FROM pg_classc, pg_namespacen
34+
WHEREc.relnamespace=n.oid
35+
andc.relkind = 'r' -- not indices, views, etc
36+
andn.nspname not like 'pg\\_%' -- not catalogs
37+
andn.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)

[8]ページ先頭

©2009-2025 Movatter.jp