1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-09 13:09:39 +03:00

The attached patch shows the new column "tablespace" in the mentioned

views.

Klaus Naumann
This commit is contained in:
Bruce Momjian
2004-07-21 20:43:53 +00:00
parent 7a55ba7615
commit 4690cc9c7f
3 changed files with 9 additions and 5 deletions

View File

@@ -3,7 +3,7 @@
*
* Copyright 1996-2003, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/backend/catalog/system_views.sql,v 1.8 2004/07/21 20:34:45 momjian Exp $
* $PostgreSQL: pgsql/src/backend/catalog/system_views.sql,v 1.9 2004/07/21 20:43:45 momjian Exp $
*/
CREATE VIEW pg_user AS
@@ -41,22 +41,26 @@ CREATE VIEW pg_tables AS
SELECT
N.nspname AS schemaname,
C.relname AS tablename,
T.spcname AS tablespace,
pg_get_userbyid(C.relowner) AS tableowner,
C.relhasindex AS hasindexes,
C.relhasrules AS hasrules,
(C.reltriggers > 0) AS hastriggers
FROM pg_class C LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
LEFT JOIN pg_tablespace T ON (T.oid = C.reltablespace)
WHERE C.relkind = 'r';
CREATE VIEW pg_indexes AS
SELECT
N.nspname AS schemaname,
C.relname AS tablename,
T.spcname AS tablespace,
I.relname AS indexname,
pg_get_indexdef(I.oid) AS indexdef
FROM pg_index X JOIN pg_class C ON (C.oid = X.indrelid)
JOIN pg_class I ON (I.oid = X.indexrelid)
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
LEFT JOIN pg_tablespace T ON (T.oid = C.reltablespace)
WHERE C.relkind = 'r' AND I.relkind = 'i';
CREATE VIEW pg_stats AS