From: | Antti Haapala <antti(dot)haapala(at)iki(dot)fi> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | 7.4 Wishlist |
Date: | 2003-01-22 09:55:45 |
Message-ID: | Pine.GSO.4.44.0212161515240.18626-100000@paju.oulu.fi |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
SHOW
----
I think 7.4 could and really should implement SHOW command similar to
MySQL. Listing tables/foreign keys/views and so isn't just psql problem,
but common to many interface implementations and maintenance tools. I
think it's wrong to rely on pg_* system tables on these.
If you think of some probable new user (changing from MySQL) who asks how
to query list of tables in PostgreSQL and gets the answer (from psql -E)
that is:
SELECT n.nspname as "Schema",
c.relname as "Name",
CASE c.relkind WHEN 'r' THEN 'table' WHEN 'v' THEN 'view' WHEN 'i' THEN
'index' WHEN 'S' THEN 'sequence' WHEN 's' THEN 'special' END as "Type",
u.usename as "Owner"
FROM pg_catalog.pg_class c
LEFT JOIN pg_catalog.pg_user u ON u.usesysid = c.relowner
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
WHERE c.relkind IN ('r','v','S','')
AND n.nspname NOT IN ('pg_catalog', 'pg_toast')
AND pg_catalog.pg_table_is_visible(c.oid)
ORDER BY 1,2;
opposed to something like
SHOW TABLES_AND_VIEWS
as in MySQL, which DBMS would this user prefer?
I further suggest that these SHOW command parameters (like tables and
views) could be views in special system schema, so it could be easy to
update them just by changing templates. Maybe 7.5 (if it had introduced
new features) could provide downward compatibility to 7.4 ready clients by
allowing the use of SHOW-views from different schema (like
pg_show_743_compat)
:)
Stored procedures used in implementing new syntax
-------------------------------------------------
This is an implementation detail suggestion. Would it be possible that
new syntax in SQL could be implemented in different languages than C.
We
From | Date | Subject | |
---|---|---|---|
Next Message | Antti Haapala | 2003-01-22 09:57:16 | Re: 7.4 Wishlist |
Previous Message | Emmanuel Charpentier | 2003-01-22 07:10:26 | Re: [mail] Re: Win32 port patches submitted |