Thread: list schema

list schema

From
Jie Liang
Date:
Bruce,

I wonder which command can show all schemas in 7.3?
I mean:
\dt -- show all tables
\l -- show all databases
?? -- show all schemas

Thanks.


Jie Liang
Software Engineer
St. Bernard Software
16882 W. Bernardo Dr.
San Diego, CA 92127
Tel: 858-524-2134
Fax:858-676-2228
jie@stbernard.com

Re: list schema

From
Bruce Momjian
Date:
We should have one, but the only solution now is:

    test=> select * from pg_namespace;

---------------------------------------------------------------------------

Jie Liang wrote:
> Bruce,
>
> I wonder which command can show all schemas in 7.3?
> I mean:
> \dt -- show all tables
> \l -- show all databases
> ?? -- show all schemas
>
> Thanks.
>
>
> Jie Liang
> Software Engineer
> St. Bernard Software
> 16882 W. Bernardo Dr.
> San Diego, CA 92127
> Tel: 858-524-2134
> Fax:858-676-2228
> jie@stbernard.com
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: list schema

From
Bruce Momjian
Date:
Also, on TODO I see:

    * Add schema, cast, and conversion backslash commands to psql

so we know we need them.

---------------------------------------------------------------------------

Jie Liang wrote:
> Bruce,
>
> I wonder which command can show all schemas in 7.3?
> I mean:
> \dt -- show all tables
> \l -- show all databases
> ?? -- show all schemas
>
> Thanks.
>
>
> Jie Liang
> Software Engineer
> St. Bernard Software
> 16882 W. Bernardo Dr.
> San Diego, CA 92127
> Tel: 858-524-2134
> Fax:858-676-2228
> jie@stbernard.com
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: list schema

From
Tom Lane
Date:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Also, on TODO I see:
>     * Add schema, cast, and conversion backslash commands to psql
> so we know we need them.

I was going to add one for schemas, but \ds and \dS are already taken,
and there was no good proposal for what to use instead.  Any thoughts?

            regards, tom lane

Re: list schema

From
Bruce Momjian
Date:
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Also, on TODO I see:
> >     * Add schema, cast, and conversion backslash commands to psql
> > so we know we need them.
>
> I was going to add one for schemas, but \ds and \dS are already taken,
> and there was no good proposal for what to use instead.  Any thoughts?

I guess we have to go with the second letter, "c", or use "n" for
namespaces.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: list schema

From
Larry Rosenman
Date:

--On Thursday, December 05, 2002 15:33:01 -0500 Tom Lane
<tgl@sss.pgh.pa.us> wrote:

> Bruce Momjian <pgman@candle.pha.pa.us> writes:
>> Also, on TODO I see:
>>     * Add schema, cast, and conversion backslash commands to psql
>> so we know we need them.
>
> I was going to add one for schemas, but \ds and \dS are already taken,
> and there was no good proposal for what to use instead.  Any thoughts?
\dn for NameSpace?


>
>             regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>



--
Larry Rosenman                     http://www.lerctr.org/~ler
Phone: +1 972-414-9812                 E-Mail: ler@lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749




Re: list schema

From
Jean-Luc Lachance
Date:
How about \D for Domains...

BTW, because many people ask how to do the equivalant in SQL of a \
command,
why not be done with the \ commands which are criptic anyway and instead
create global stored procedures like:

sp_list_databases()
sp_list_schemas()
sp_list_{whatever}()
sp_enable_{this}()
sp_disable_{that}()

JLL


Tom Lane wrote:
>
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Also, on TODO I see:
> >       * Add schema, cast, and conversion backslash commands to psql
> > so we know we need them.
>
> I was going to add one for schemas, but \ds and \dS are already taken,
> and there was no good proposal for what to use instead.  Any thoughts?
>
>                         regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

Re: list schema

From
Jie Liang
Date:
I believe \dn is better.


Jie Liang
Software Engineer
St. Bernard Software
16882 W. Bernardo Dr.
San Diego, CA 92127
Tel: 858-524-2134
Fax:858-676-2228
jie@stbernard.com


-----Original Message-----
From: Bruce Momjian [mailto:pgman@candle.pha.pa.us]
Sent: Thursday, December 05, 2002 12:36 PM
To: Tom Lane
Cc: Jie Liang; pgsql-admin@postgresql.org
Subject: Re: [ADMIN] list schema


Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Also, on TODO I see:
> >     * Add schema, cast, and conversion backslash commands to psql
> > so we know we need them.
>
> I was going to add one for schemas, but \ds and \dS are already taken,
> and there was no good proposal for what to use instead.  Any thoughts?

I guess we have to go with the second letter, "c", or use "n" for
namespaces.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: list schema

From
Peter Eisentraut
Date:
Tom Lane writes:

> I was going to add one for schemas, but \ds and \dS are already taken,
> and there was no good proposal for what to use instead.  Any thoughts?

\dschema

Pretty soon we'll have too many things for 'c' as well, so maybe we should
go with full words.

--
Peter Eisentraut   peter_e@gmx.net


Re: list schema

From
Peter Childs
Date:
On Thursday 05 December 2002 23:21, Peter Eisentraut wrote:
> Tom Lane writes:
> > I was going to add one for schemas, but \ds and \dS are already taken,
> > and there was no good proposal for what to use instead.  Any thoughts?
>
> \dschema
>
> Pretty soon we'll have too many things for 'c' as well, so maybe we should
> go with full words.

    I think this sounds like a good idea. as they would be much easier to
remember if its a full word. You can always leave the 1 leave the 1 letter
abbrevations in anyway and have both!

    I also notice that on the todo list is a job to turn all these into views. It
might be worth doing that (should not be too difficult I think) plus they
could then be used from other client programs.

    Strictly I think this meta information should have its own access methods in
the sql standard because currently sql is a broken standard with out this
meta infomation.

Peter Childs

Re: list schema

From
Tom Lane
Date:
Peter Eisentraut <peter_e@gmx.net> writes:
> Tom Lane writes:
>> I was going to add one for schemas, but \ds and \dS are already taken,
>> and there was no good proposal for what to use instead.  Any thoughts?

> \dschema

I would have done that, but it doesn't fit nicely beside the behavior
of the \d[istvS] family.  Maybe we should retire that thing?

            regards, tom lane

Re: list schema

From
Tilo Schwarz
Date:
Peter Childs writes:

>     I also notice that on the todo list is a job to turn all these into views.
> It might be worth doing that (should not be too difficult I think) plus
> they could then be used from other client programs.

That would be really nice!

Tilo

Connection problem (newbie question)

From
"Paul Kavanagh"
Date:
Hi,

I've just installed Postgresql 7.3 via Cygwin on Win2K, started the
postmaster successfully, yet cannot connect using psql. See below for trace:

$ pg_ctl start -D /usr/share/postresql/data -l serverlog
postmaster successfully started

$ psql
psql: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

I've attached my .conf.

Any ideas ?

Thanks in advance,
-Paul

Attachment

Re: Connection problem (newbie question)

From
"TaChung Huang"
Date:
HI Paul: you would need to specify a database name such as the
"template1". The "template1" database is installed by default as you
install PostgreSQL.

psql <database name>

If you do not specify a database name, the default database name that
psql will use is 'postgresql"


Regards
TaChung Huang (黃大忠)



-----Original Message-----
From: pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Paul Kavanagh
Sent: Saturday, December 07, 2002 12:51 PM
To: pgsql-admin@postgresql.org
Subject: [ADMIN] Connection problem (newbie question)


Hi,

I've just installed Postgresql 7.3 via Cygwin on Win2K, started the
postmaster successfully, yet cannot connect using psql. See below for
trace:

$ pg_ctl start -D /usr/share/postresql/data -l serverlog postmaster
successfully started

$ psql
psql: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

I've attached my .conf.

Any ideas ?

Thanks in advance,
-Paul


Re: Connection problem (newbie question)

From
"Paul Kavanagh"
Date:
Thanks TaChung, and I tried that, but unfortunately the end result was the
same:

$ psql template1
psql: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

Connecting to the port via telnet fails:

$ telnet localhost 5432
Connecting To localhost...Could not open a connection to host on port 5432 :
Connect failed

I tried connecting via pgAdmin 11 (1.4) and got the following error msg:
"Number: -2147467259 Description: Could not connect to the server; Could not
connect to the remote socket"

Finally, I ran 'ps -ef' just after the postmaster successfully started (or
so it says), but there's no sign of any postgresql related processes:

$ ps -ef
     UID     PID    PPID TTY     STIME COMMAND
  pkavan    1868       1 con  11:07:57 /usr/bin/bash
  pkavan    1692    1868 con  21:27:06 /usr/bin/ps

I'm guessing the problems are all interconnected, but I thought the above
info might help..

Thanks in advance,
-Paul

> -----Original Message-----
> From: TaChung Huang [mailto:tachung_h@yahoo.com]
> Sent: Saturday, December 07, 2002 1:48 PM
> To: 'Paul Kavanagh'; pgsql-admin@postgresql.org
> Subject: RE: [ADMIN] Connection problem (newbie question)
>
>
> HI Paul: you would need to specify a database name such as the
> "template1". The "template1" database is installed by default as you
> install PostgreSQL.
>
> psql <database name>
>
> If you do not specify a database name, the default database name that
> psql will use is 'postgresql"
>
>
> Regards
> TaChung Huang (黃大忠)
>
>
>
> -----Original Message-----
> From: pgsql-admin-owner@postgresql.org
> [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Paul Kavanagh
> Sent: Saturday, December 07, 2002 12:51 PM
> To: pgsql-admin@postgresql.org
> Subject: [ADMIN] Connection problem (newbie question)
>
>
> Hi,
>
> I've just installed Postgresql 7.3 via Cygwin on Win2K, started the
> postmaster successfully, yet cannot connect using psql. See below for
> trace:
>
> $ pg_ctl start -D /usr/share/postresql/data -l serverlog postmaster
> successfully started
>
> $ psql
> psql: could not connect to server: No such file or directory
>         Is the server running locally and accepting
>         connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
>
> I've attached my .conf.
>
> Any ideas ?
>
> Thanks in advance,
> -Paul


Re: Connection problem (newbie question)

From
"Nick Fankhauser"
Date:
Paul-

> Finally, I ran 'ps -ef' just after the postmaster successfully started (or
> so it says), but there's no sign of any postgresql related processes:

This is clearly your problem. See if you can locate the log file & find out
why the processes are dying right away. Usually the location of the log file
is noted in the script you use for start up.

-NF


Re: Connection problem (newbie question)

From
Mohd Ghalib Akhtar
Date:
Hello

I would like to know the procedure to install PostGres
on Windows NT
machine. Also, if you could please also send me the
Installation, how to download ?





--- Paul Kavanagh <p_kavanagh@yahoo.com> wrote:
> Hi,
>
> I've just installed Postgresql 7.3 via Cygwin on
> Win2K, started the
> postmaster successfully, yet cannot connect using
> psql. See below for trace:
>
> $ pg_ctl start -D /usr/share/postresql/data -l
> serverlog
> postmaster successfully started
>
> $ psql
> psql: could not connect to server: No such file or
> directory
>         Is the server running locally and accepting
>         connections on Unix domain socket
> "/tmp/.s.PGSQL.5432"?
>
> I've attached my .conf.
>
> Any ideas ?
>
> Thanks in advance,
> -Paul
>

> ATTACHMENT part 2 application/octet-stream
name=postgresql.conf
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>


=====
Take careMohd.Ghalib Akhtar(office)91-11-6152172,Ext-217
Fax : 91-11-6146217, 6149446
---------------------------------

---------------------------------


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com