commit
31849411a8
1578 files changed
+290463
No files matched your search
@@ -0,0 +1,41 @@
|
||||
\set ON_ERROR_STOP on
|
||||
|
||||
BEGIN READ ONLY;
|
||||
|
||||
SELECT
|
||||
current_database() AS current_database,
|
||||
current_user AS current_user,
|
||||
inet_server_addr()::text AS server_address,
|
||||
inet_server_port() AS server_port,
|
||||
has_database_privilege(current_user, current_database(), 'CREATE') AS can_create_schema;
|
||||
|
||||
SELECT
|
||||
n.nspname AS schema_name,
|
||||
pg_get_userbyid(n.nspowner) AS schema_owner,
|
||||
has_schema_privilege(current_user, n.oid, 'USAGE') AS can_use,
|
||||
has_schema_privilege(current_user, n.oid, 'CREATE') AS can_create_objects
|
||||
FROM pg_namespace n
|
||||
WHERE n.nspname = 'th_hotel_booking';
|
||||
|
||||
SELECT
|
||||
n.nspname AS schema_name,
|
||||
c.relkind,
|
||||
count(*) AS object_count
|
||||
FROM pg_class c
|
||||
JOIN pg_namespace n ON n.oid = c.relnamespace
|
||||
WHERE n.nspname NOT LIKE 'pg_%'
|
||||
AND n.nspname <> 'information_schema'
|
||||
GROUP BY n.nspname, c.relkind
|
||||
ORDER BY n.nspname, c.relkind;
|
||||
|
||||
SELECT
|
||||
n.nspname AS schema_name,
|
||||
c.relname AS object_name,
|
||||
c.relkind
|
||||
FROM pg_class c
|
||||
JOIN pg_namespace n ON n.oid = c.relnamespace
|
||||
WHERE n.nspname = 'th_hotel_booking'
|
||||
ORDER BY c.relkind, c.relname;
|
||||
|
||||
COMMIT;
|
||||
|
||||
Reference in new issue
Block a user