Re: FWD: Re: Updated backslash consistency patch

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Cc: Gregory Stark <stark(at)enterprisedb(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Brendan Jurd <direvus(at)gmail(dot)com>, Greg Sabino Mullane <greg(at)turnstep(dot)com>
Subject: Re: FWD: Re: Updated backslash consistency patch
Date: 2009-01-20 04:12:30
Message-ID: 200901200412.n0K4CUX12917@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian wrote:
> I know we don't like the current behavior, but I think we need to make
> them consistent first for easy testing and so when we change it, it will
> remain consistent.
>
> I will work on a consensus patch soon for the new behavior.

Here is what I hope is a consensus patch. It adds 'A' to show all
objects, including system ones. It turns out that this is how 'S' works
now in CVS, but 'S' is unclear because it suggests just system objects;
'A' for show 'all' objects seems clearer.

I did not add any special handling for patterns:

test=> \df repeat
List of functions
Schema | Name | Result data type | Argument data types
--------+------+------------------+---------------------
(0 rows)

test=> \dfA repeat
List of functions
Schema | Name | Result data type | Argument data types
------------+--------+------------------+---------------------
pg_catalog | repeat | text | text, integer
(1 row)

I am afraid that special pattern rules are going to be too confusing.
You can see only system objects by referencing pg_catalog:

test=> \dtA pg_catalog.pg_t*
List of relations
Schema | Name | Type | Owner
------------+------------------+-------+----------
pg_catalog | pg_tablespace | table | postgres
pg_catalog | pg_trigger | table | postgres
pg_catalog | pg_ts_config | table | postgres
pg_catalog | pg_ts_config_map | table | postgres
pg_catalog | pg_ts_dict | table | postgres
pg_catalog | pg_ts_parser | table | postgres
pg_catalog | pg_ts_template | table | postgres
pg_catalog | pg_type | table | postgres
(8 rows)

Patch attached. One interesting idea would be to assume 'A' if the
a schema is specified in the pattern, so;

\df pg_catalog.*

would work without 'A'.

With this patch, \d and \dt show only user tables, and \df shows only
user functions. I think usability-wise, these are good, and \dA, \dtA,
and \dfA include system tables and functions.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

Attachment Content-Type Size
/pgpatches/psql-A text/x-diff 14.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2009-01-20 04:57:14 Re: FWD: Re: Updated backslash consistency patch
Previous Message Hiroshi Inoue 2009-01-20 03:52:12 Re: [BUGS] BUG #4186: set lc_messages does not work