mirror of
https://github.com/postgres/postgres.git
synced 2025-12-15 02:22:24 +03:00
Initial version of the SQL information schema
This commit is contained in:
@@ -1266,7 +1266,7 @@ drop table cchild;
|
||||
--
|
||||
-- Check that ruleutils are working
|
||||
--
|
||||
SELECT viewname, definition FROM pg_views ORDER BY viewname;
|
||||
SELECT viewname, definition FROM pg_views WHERE schemaname <> 'information_schema' ORDER BY viewname;
|
||||
viewname | definition
|
||||
--------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
iexit | SELECT ih.name, ih.thepath, interpt_pp(ih.thepath, r.thepath) AS exit FROM ihighway ih, ramp r WHERE (ih.thepath ## r.thepath);
|
||||
|
||||
@@ -59,7 +59,7 @@ WHERE (p1.typtype = 'c' AND p1.typrelid = 0) OR
|
||||
-- NOTE: as of 7.3, this check finds SET, smgr, and unknown.
|
||||
SELECT p1.oid, p1.typname
|
||||
FROM pg_type as p1
|
||||
WHERE p1.typtype in ('b','d') AND p1.typname NOT LIKE '\\_%' AND NOT EXISTS
|
||||
WHERE p1.typtype in ('b') AND p1.typname NOT LIKE '\\_%' AND NOT EXISTS
|
||||
(SELECT 1 FROM pg_type as p2
|
||||
WHERE p2.typname = ('_' || p1.typname)::name AND
|
||||
p2.typelem = p1.oid);
|
||||
|
||||
@@ -28,8 +28,9 @@ CREATE FUNCTION equipment(hobbies_r)
|
||||
CREATE FUNCTION user_relns()
|
||||
RETURNS setof name
|
||||
AS 'select relname
|
||||
from pg_class
|
||||
where relname !~ ''pg_.*'' and
|
||||
from pg_class c, pg_namespace n
|
||||
where relnamespace = n.oid and
|
||||
(nspname !~ ''pg_.*'' and nspname <> ''information_schema'') and
|
||||
relkind <> ''i'' '
|
||||
LANGUAGE 'sql';
|
||||
|
||||
|
||||
@@ -22,8 +22,9 @@ CREATE FUNCTION equipment(hobbies_r)
|
||||
CREATE FUNCTION user_relns()
|
||||
RETURNS setof name
|
||||
AS 'select relname
|
||||
from pg_class
|
||||
where relname !~ ''pg_.*'' and
|
||||
from pg_class c, pg_namespace n
|
||||
where relnamespace = n.oid and
|
||||
(nspname !~ ''pg_.*'' and nspname <> ''information_schema'') and
|
||||
relkind <> ''i'' '
|
||||
LANGUAGE 'sql';
|
||||
CREATE FUNCTION pt_in_widget(point, widget)
|
||||
|
||||
@@ -763,7 +763,7 @@ drop table cchild;
|
||||
--
|
||||
-- Check that ruleutils are working
|
||||
--
|
||||
SELECT viewname, definition FROM pg_views ORDER BY viewname;
|
||||
SELECT viewname, definition FROM pg_views WHERE schemaname <> 'information_schema' ORDER BY viewname;
|
||||
|
||||
SELECT tablename, rulename, definition FROM pg_rules
|
||||
ORDER BY tablename, rulename;
|
||||
|
||||
@@ -54,7 +54,7 @@ WHERE (p1.typtype = 'c' AND p1.typrelid = 0) OR
|
||||
|
||||
SELECT p1.oid, p1.typname
|
||||
FROM pg_type as p1
|
||||
WHERE p1.typtype in ('b','d') AND p1.typname NOT LIKE '\\_%' AND NOT EXISTS
|
||||
WHERE p1.typtype in ('b') AND p1.typname NOT LIKE '\\_%' AND NOT EXISTS
|
||||
(SELECT 1 FROM pg_type as p2
|
||||
WHERE p2.typname = ('_' || p1.typname)::name AND
|
||||
p2.typelem = p1.oid);
|
||||
|
||||
Reference in New Issue
Block a user