Lists: | pgsql-general |
---|
From: | Chris <pggeneral(at)designmagick(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | schemas in 7.3b1 |
Date: | 2002-10-03 13:44:52 |
Message-ID: | 3d9c49c7_1@news.iprimus.com.au |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
Hi all,
Just a quick question.
Is there an easy way to get a list of schemas in a database?
serverlogs=# SELECT version();
version
---------------------------------------------------------------
PostgreSQL 7.3b1 on i586-pc-linux-gnu, compiled by GCC 2.95.3
(1 row)
serverlogs=# CREATE SCHEMA dwarf;
CREATE SCHEMA
serverlogs=# SELECT current_schemas(true);
current_schemas
---------------------
{pg_catalog,public}
(1 row)
I found the pg_namespace table, but that doesn't tell me what database
has a particular schema..
I checked the developer docs but I couldn't find anything there.
Thanks,
Chris.
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Chris <pggeneral(at)designmagick(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: schemas in 7.3b1 |
Date: | 2002-10-03 15:56:50 |
Message-ID: | 5063.1033660610@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
Chris <pggeneral(at)designmagick(dot)com> writes:
> Is there an easy way to get a list of schemas in a database?
> I found the pg_namespace table, but that doesn't tell me what database
> has a particular schema.
Yours. pg_namespace is local to a database, same as most other
system catalogs.
We had meant to add a \d command for listing schemas in psql, but
both \ds and \dS are taken already :-(. Any ideas out there for
a reasonable choice?
regards, tom lane
From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Chris <pggeneral(at)designmagick(dot)com>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: schemas in 7.3b1 |
Date: | 2002-10-03 16:06:26 |
Message-ID: | 200210031606.g93G6Qi07290@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
Tom Lane wrote:
> Chris <pggeneral(at)designmagick(dot)com> writes:
> > Is there an easy way to get a list of schemas in a database?
> > I found the pg_namespace table, but that doesn't tell me what database
> > has a particular schema.
>
> Yours. pg_namespace is local to a database, same as most other
> system catalogs.
>
> We had meant to add a \d command for listing schemas in psql, but
> both \ds and \dS are taken already :-(. Any ideas out there for
> a reasonable choice?
Is this a TODO item?
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
From: | Lee Kindness <lkindness(at)csl(dot)co(dot)uk> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Chris <pggeneral(at)designmagick(dot)com>, pgsql-general(at)postgresql(dot)org, Lee Kindness <lkindness(at)csl(dot)co(dot)uk> |
Subject: | Re: schemas in 7.3b1 |
Date: | 2002-10-03 16:10:16 |
Message-ID: | 15772.27624.720893.813481@kelvin.csl.co.uk |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
Tom Lane writes:
> We had meant to add a \d command for listing schemas in psql, but
> both \ds and \dS are taken already :-(. Any ideas out there for
> a reasonable choice?
Howabout '\dschema', or would non-single-character choices need
further parsing code?
For want of anything better... '\dz'.
L.
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
Cc: | Chris <pggeneral(at)designmagick(dot)com>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: schemas in 7.3b1 |
Date: | 2002-10-03 16:13:05 |
Message-ID: | 5231.1033661585@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> Tom Lane wrote:
>> We had meant to add a \d command for listing schemas in psql, but
>> both \ds and \dS are taken already :-(. Any ideas out there for
>> a reasonable choice?
> Is this a TODO item?
Yeah, at this point I guess it is --- I had meant to get it done for
7.3, but I suppose it's too late now.
Now that I think about it, casts and conversions are two more new object
kinds that perhaps deserve \d support.
regards, tom lane
From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Chris <pggeneral(at)designmagick(dot)com>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: schemas in 7.3b1 |
Date: | 2002-10-03 16:37:03 |
Message-ID: | 200210031637.g93Gb3510515@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Tom Lane wrote:
> >> We had meant to add a \d command for listing schemas in psql, but
> >> both \ds and \dS are taken already :-(. Any ideas out there for
> >> a reasonable choice?
>
> > Is this a TODO item?
>
> Yeah, at this point I guess it is --- I had meant to get it done for
> 7.3, but I suppose it's too late now.
>
> Now that I think about it, casts and conversions are two more new object
> kinds that perhaps deserve \d support.
Added to TODO:
* Add schema, cast, and conversion backslash commands to psql
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
From: | frbn <frbn(at)efbs-seafrigo(dot)fr> |
---|---|
To: | Lee Kindness <lkindness(at)csl(dot)co(dot)uk> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Chris <pggeneral(at)designmagick(dot)com>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: schemas in 7.3b1 |
Date: | 2002-10-03 17:09:27 |
Message-ID: | 3D9C79C7.4020303@efbs-seafrigo.fr |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
Lee Kindness a écrit:
> Tom Lane writes:
> > We had meant to add a \d command for listing schemas in psql, but
> > both \ds and \dS are taken already :-(. Any ideas out there for
> > a reasonable choice?
>
> Howabout '\dschema', or would non-single-character choices need
> further parsing code?
>
> For want of anything better... '\dz'.
or d$ :\
From: | Thomas Pfau <pfau(at)gw(dot)rane(dot)net> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: schemas in 7.3b1 |
Date: | 2002-10-03 17:40:30 |
Message-ID: | 20021003134030.A23033@gw.rane.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
Tom Lane wrote:
> We had meant to add a \d command for listing schemas in psql, but
> both \ds and \dS are taken already :-(. Any ideas out there for
> a reasonable choice?
\l is currently used to list databases. How about \ls to list
schemas?
From: | Sean Chittenden <sean(at)chittenden(dot)org> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Chris <pggeneral(at)designmagick(dot)com>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: schemas in 7.3b1 |
Date: | 2002-10-04 03:32:19 |
Message-ID: | 20021004033219.GG44554@perrin.int.nxad.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
> > Is there an easy way to get a list of schemas in a database?
> > I found the pg_namespace table, but that doesn't tell me what database
> > has a particular schema.
>
> Yours. pg_namespace is local to a database, same as most other
> system catalogs.
>
> We had meant to add a \d command for listing schemas in psql, but
> both \ds and \dS are taken already :-(. Any ideas out there for
> a reasonable choice?
\dn [PATTERN] list schema names/name spaces
-sc
--
Sean Chittenden