From romio@il.aduva.com Wed Jan 9 11:32:23 2002 Received: from il.linuxqa.com ([212.199.118.82]) by postgresql.org (8.11.3/8.11.4) with SMTP id g09BWNB77349 for ; Wed, 9 Jan 2002 06:32:23 -0500 (EST) (envelope-from romio@il.aduva.com) Received: (qmail 5114 invoked from network); 9 Jan 2002 11:28:43 -0000 Received: from romio.linuxqa.com (HELO il.aduva.com) (10.0.0.20) by il.linuxqa.com with SMTP; 9 Jan 2002 11:28:43 -0000 Message-ID: <3C3C2A12.BB15E98@il.aduva.com> Date: Wed, 09 Jan 2002 13:31:30 +0200 From: Roman Gavrilov Reply-To: romio@il.aduva.com Organization: Aduva Ltd. X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.4.2-2 i686) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Monitoring database Content-Type: multipart/alternative; boundary="------------676338E631C4A4AADFCA141A" X-Archive-Number: 200201/74 X-Sequence-Number: 2962 --------------676338E631C4A4AADFCA141A Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello everybody. Is there any way to check database status, or who is currently connected to it. I tried to drop database and got an error saying that other users using this database. So I wanted to see who is connected right now to the database. One more question is how can I see all tables in the template1 ? Thanks allot. -- ----------------------------------------------------------------------------- Roman Gavrilov Aduva Inc., Web Development Services. work +972-3-7534324 mobile +972-54-834668 romio@aduva.com, romio@netvision.net.il --------------676338E631C4A4AADFCA141A Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Hello everybody.
Is there any way to check database status, or who is currently connected to it.
I tried to drop database and got an error saying that other users using this database.
So I wanted to see who is connected right now to the database.

One more question is how can I see all tables in the template1 ?
Thanks allot.

-- 
-----------------------------------------------------------------------------
 Roman Gavrilov                           
 Aduva Inc., Web Development Services.    
 work +972-3-7534324 mobile +972-54-834668
 romio@aduva.com, romio@netvision.net.il
  --------------676338E631C4A4AADFCA141A-- From tbarnard@povn.com Mon Jan 14 15:36:44 2002 Received: from cps.criterian.com ([63.175.25.6]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g0EFaiB33404 for ; Mon, 14 Jan 2002 10:36:44 -0500 (EST) (envelope-from tbarnard@povn.com) Received: from dev6 (dev5.hartcomm.com [63.175.25.165]) by cps.criterian.com (8.11.2/8.8.7) with SMTP id g0EFUC818451; Mon, 14 Jan 2002 07:30:13 -0800 Message-ID: <005b01c19d11$3c7e4e80$a519af3f@hartcomm.com> From: "Tim Barnard" To: Cc: References: <3C3C2A12.BB15E98@il.aduva.com> Subject: Re: [ADMIN] Monitoring database Date: Mon, 14 Jan 2002 07:36:29 -0800 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0058_01C19CCE.2DE59060" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 X-Archive-Number: 200201/371 X-Sequence-Number: 19321 This is a multi-part message in MIME format. ------=_NextPart_000_0058_01C19CCE.2DE59060 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I don't think there is currently a way to check the database for connection= s (someone correct me if I'm wrong). But to get a list of all of the tables= in template1: \c template1 select relname from pg_class Tim ----- Original Message -----=20 From: Roman Gavrilov=20 To: pgsql-admin@postgresql.org=20 Sent: Wednesday, January 09, 2002 3:31 AM Subject: [ADMIN] Monitoring database Hello everybody.=20 Is there any way to check database status, or who is currently connected = to it.=20 I tried to drop database and got an error saying that other users using t= his database.=20 So I wanted to see who is connected right now to the database.=20 One more question is how can I see all tables in the template1 ?=20 Thanks allot.=20 --=20 ---------------------------------------------------------------------------= -- Roman Gavrilov=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20 Aduva Inc., Web Development Services.=20=20=20=20 work +972-3-7534324 mobile +972-54-834668 romio@aduva.com, romio@netvision.net.il =20=20=20=20 ------=_NextPart_000_0058_01C19CCE.2DE59060 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
I don't think there is currently a way to = check the=20 database for connections (someone correct me if I'm wrong). But to get a li= st of=20 all of the tables in template1:
 
\c template1
select relname from pg_class
 
Tim
----- Original Message -----
Fro= m:=20 Roman=20 Gavrilov
Sent: Wednesday, January 09, 2002 = 3:31=20 AM
Subject: [ADMIN] Monitoring=20 database

Hello everybody.
Is there any way to check database st= atus,=20 or who is currently connected to it.
I tried to drop database and got= an=20 error saying that other users using this database.
So I wanted t= o see=20 who is connected right now to the database.=20

One more question is how can I see all tables in the template1 ?
T= hanks=20 allot.

-- 
---------------------------------------------------------------------------=
--
 Roman Gavrilov         &=
nbsp;           &nbs=
p;     
 Aduva Inc., Web Development Services.    
 work +972-3-7534324 mobile +972-54-834668
 romio@aduva.com, romio@netvision.net.il
 =20 ------=_NextPart_000_0058_01C19CCE.2DE59060-- From david@netventures.com.au Tue Jan 15 00:15:59 2002 Received: from dealer.netventures.com.au (dnet137107-1.gw.connect.com.au [210.8.15.221] (may be forged)) by postgresql.org (8.11.3/8.11.4) with ESMTP id g0F0FwV93694 for ; Mon, 14 Jan 2002 19:15:59 -0500 (EST) (envelope-from david@netventures.com.au) Received: from ciderbox.in.netventures.com.au (net137107-2.gw.connect.com.au [210.9.198.119]) by dealer.netventures.com.au (Postfix) with ESMTP id A7BC71A5DC1; Tue, 15 Jan 2002 11:15:58 +1100 (EST) Date: Tue, 15 Jan 2002 11:16:04 +1100 Subject: Re: Monitoring database Content-Type: multipart/alternative; boundary=Apple-Mail-1-534309663 Mime-Version: 1.0 (Apple Message framework v480) Cc: pgsql-admin@postgresql.org To: romio@il.aduva.com From: David Stanaway In-Reply-To: <3C3C2A12.BB15E98@il.aduva.com> Message-Id: <103EAC6B-094D-11D6-9DC5-0003930FDAB2@netventures.com.au> X-Mailer: Apple Mail (2.480) X-Archive-Number: 200201/87 X-Sequence-Number: 2975 --Apple-Mail-1-534309663 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=ISO-8859-1; format=flowed On Wednesday, January 9, 2002, at 10:31 PM, Roman Gavrilov wrote: > Hello everybody. > Is there any way to check database status, or who is currently=20 > connected to it. > I tried to drop database and got an error saying that other users using= =20 > this database. > So I=A0wanted to see who is connected right now to the database. Take a look here maybe: http://gborg.postgresql.org/project/pgmonitor/projdisplay.php > One more question is how can I see all tables in the template1 ? > Thanks allot. in the psql client: psql template1 \dt \h is definately worth reading too. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D David Stanaway Personal: david@stanaway.net Work: david@netventures.com.au --Apple-Mail-1-534309663 Content-Transfer-Encoding: quoted-printable Content-Type: text/enriched; charset=ISO-8859-1 On Wednesday, January 9, 2002, at 10:31 PM, Roman Gavrilov wrote: Hello everybody. Is there any way to check database status, or who is currently connected to it. I tried to drop database and got an error saying that other users using this database. So I=A0wanted to see who is connected right now to the database. Take a look here maybe: http://gborg.postgresql.org/project/pgmonitor/projdisplay.php One more question is how can I see all tables in the template1 ? Thanks allot. in the psql client: psql template1 \dt \h is definately worth reading too.=20 Helvetica=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D David Stanaway Personal: david@stanaway.net=20 Work: david@netventures.com.au --Apple-Mail-1-534309663-- From david@netventures.com.au Tue Jan 15 22:29:22 2002 Received: from dealer.netventures.com.au (dnet137107-1.gw.connect.com.au [210.8.15.221] (may be forged)) by postgresql.org (8.11.3/8.11.4) with ESMTP id g0FMTLV55728 for ; Tue, 15 Jan 2002 17:29:22 -0500 (EST) (envelope-from david@netventures.com.au) Received: from ciderbox.in.netventures.com.au (net137107-2.gw.connect.com.au [210.9.198.119]) by dealer.netventures.com.au (Postfix) with ESMTP id 8D7241A64D7; Wed, 16 Jan 2002 09:29:18 +1100 (EST) Date: Wed, 16 Jan 2002 09:29:20 +1100 Subject: Re: Monitoring database Content-Type: multipart/alternative; boundary=Apple-Mail-1-614306178 Mime-Version: 1.0 (Apple Message framework v480) From: David Stanaway To: romio@il.aduva.com, pgsql-admin@postgresql.org In-Reply-To: <3C43E383.19393CDE@il.aduva.com> Message-Id: <51E20ECE-0A07-11D6-BE62-0003930FDAB2@netventures.com.au> X-Mailer: Apple Mail (2.480) X-Archive-Number: 200201/96 X-Sequence-Number: 2983 --Apple-Mail-1-614306178 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=ISO-8859-1; format=flowed On Tuesday, January 15, 2002, at 07:08 PM, Roman Gavrilov wrote: >> David Stanaway wrote: >> >> On Wednesday, January 9, 2002, at 10:31 PM, Roman Gavrilov wrote: >>> =A0=A0=A0=A0 One more question is how can I see all tables in the templ= ate1 ? >>> =A0=A0=A0=A0 Thanks allot. >> >> in the psql client: psql template1 >> \dt >> \h is definately worth reading too. > =A0 > Did you try that ? > I get=A0 "No relations found" is it a problem or template1 tables are=20 > protected some how and not shown in \dt What relations are you looking for? System tables? They don't show up=20 in \dt That just lists user tables. There are a number of \d commands in psql for different types of=20 relations, you should look at \? (Sorry I said \h and thats for SQL=20 help) to see all the psql escapes. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D David Stanaway Personal: david@stanaway.net Work: david@netventures.com.au --Apple-Mail-1-614306178 Content-Transfer-Encoding: quoted-printable Content-Type: text/enriched; charset=ISO-8859-1 On Tuesday, January 15, 2002, at 07:08 PM, Roman Gavrilov wrote: David Stanaway wrote: On Wednesday, January 9, 2002, at 10:31 PM, Roman Gavrilov wrote: =A0=A0=A0=A0 One more question is how can I see all tables in the template1 ? =A0=A0=A0=A0 Thanks allot. in the psql client: psql template1 \dt \h is definately worth reading too. =A0 Did you try that ? I get=A0 "No relations found" is it a problem or template1 tables are protected some how and not shown in \dt What relations are you looking for? System tables? They don't show up in \dt That just lists user tables.=20 There are a number of \d< commands in psql for different types of relations, you should look at \? (Sorry I said \h and thats for SQL help) to see all the psql escapes. Helvetica=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D David Stanaway Personal: david@stanaway.net=20 Work: david@netventures.com.au --Apple-Mail-1-614306178-- From romio@il.aduva.com Wed Jan 16 08:10:19 2002 Received: from il.linuxqa.com ([212.199.118.82]) by postgresql.org (8.11.3/8.11.4) with SMTP id g0G8AJV34314 for ; Wed, 16 Jan 2002 03:10:19 -0500 (EST) (envelope-from romio@il.aduva.com) Received: (qmail 29523 invoked from network); 16 Jan 2002 08:05:48 -0000 Received: from romio.linuxqa.com (HELO il.aduva.com) (10.0.0.20) by il.linuxqa.com with SMTP; 16 Jan 2002 08:05:48 -0000 Message-ID: <3C45352D.D95F430@il.aduva.com> Date: Wed, 16 Jan 2002 10:09:17 +0200 From: Roman Gavrilov Reply-To: romio@il.aduva.com Organization: Aduva Ltd. X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.4.2-2 i686) X-Accept-Language: en MIME-Version: 1.0 To: David Stanaway CC: pgsql-admin@postgresql.org Subject: Re: Monitoring database References: <51E20ECE-0A07-11D6-BE62-0003930FDAB2@netventures.com.au> Content-Type: multipart/alternative; boundary="------------79E1472153B68AA771708164" X-Archive-Number: 200201/100 X-Sequence-Number: 2987 --------------79E1472153B68AA771708164 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Yes I would like to see system tables, that is correct is there any way to see all those tables. For example in MySQL there is mysql database where you have all system tables. David Stanaway wrote: > On Tuesday, January 15, 2002, at 07:08 PM, Roman Gavrilov wrote: > > David Stanaway wrote: > > On Wednesday, January 9, 2002, at 10:31 PM, Roman Gavrilov wrote: > > One more question is how can I see all tables in the template1 ? > Thanks allot. > > in the psql client: psql template1 > \dt > \h is definately worth reading too. > > > Did you try that ? > I get "No relations found" is it a problem or template1 tables are protected some how and not shown in \dt > > What relations are you looking for? System tables? They don't show up in \dt That just lists user tables. > There are a number of \d commands in psql for different types of relations, you should look at \? (Sorry I said \h and thats for SQL help) to see all the psql escapes. > > ============================== > David Stanaway > Personal: david@stanaway.net > Work: david@netventures.com.au -- ----------------------------------------------------------------------------- Roman Gavrilov Aduva Inc., Web Development Services. work +972-3-7534324 mobile +972-54-834668 romio@aduva.com, romio@netvision.net.il --------------79E1472153B68AA771708164 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Yes I would like to see system tables, that is correct is there any way to see all those tables.
For example in MySQL there is mysql database where you have all system tables.

David Stanaway wrote:

On Tuesday, January 15, 2002, at 07:08 PM, Roman Gavrilov wrote:

          David Stanaway wrote:

          On Wednesday, January 9, 2002, at 10:31 PM, Roman Gavrilov wrote:

                    One more question is how can I see all tables in the template1 ?
                    Thanks allot.

          in the psql client: psql template1
          \dt
          \h is definately worth reading too.
 

     Did you try that ?
     I get  "No relations found" is it a problem or template1 tables are protected some how and not shown in \dt

What relations are you looking for? System tables? They don't show up in \dt That just lists user tables.
There are a number of \d<X> commands in psql for different types of relations, you should look at \? (Sorry I said \h and thats for SQL help) to see all the psql escapes.

==============================
David Stanaway
Personal: david@stanaway.net
Work: david@netventures.com.au

-- 
-----------------------------------------------------------------------------
 Roman Gavrilov                           
 Aduva Inc., Web Development Services.    
 work +972-3-7534324 mobile +972-54-834668
 romio@aduva.com, romio@netvision.net.il
  --------------79E1472153B68AA771708164-- From david@netventures.com.au Wed Jan 16 22:36:05 2002 Received: from dealer.netventures.com.au (dnet137107-1.gw.connect.com.au [210.8.15.221] (may be forged)) by postgresql.org (8.11.3/8.11.4) with ESMTP id g0GMa5V38871 for ; Wed, 16 Jan 2002 17:36:05 -0500 (EST) (envelope-from david@netventures.com.au) Received: from ciderbox.in.netventures.com.au (net137107-2.gw.connect.com.au [210.9.198.119]) by dealer.netventures.com.au (Postfix) with ESMTP id E18471A5DCA; Thu, 17 Jan 2002 09:36:01 +1100 (EST) Date: Thu, 17 Jan 2002 09:36:06 +1100 Subject: Re: Monitoring database Content-Type: multipart/alternative; boundary=Apple-Mail-1-701112064 Mime-Version: 1.0 (Apple Message framework v480) From: David Stanaway To: romio@il.aduva.com, pgsql-admin@postgresql.org In-Reply-To: <3C45352D.D95F430@il.aduva.com> Message-Id: <6E38ED39-0AD1-11D6-84EB-0003930FDAB2@netventures.com.au> X-Mailer: Apple Mail (2.480) X-Archive-Number: 200201/106 X-Sequence-Number: 2993 --Apple-Mail-1-701112064 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=ISO-8859-1; format=flowed On Wednesday, January 16, 2002, at 07:09 PM, Roman Gavrilov wrote: > Yes I=A0would like to see system tables, that is correct is there any way= =20 > to see all those tables. > For example in MySQL there is mysql database where you have all system=20 > tables. Please read the documentation. I have already told you where to look. But just incase you missed it: $ psql template1 Welcome to psql, the PostgreSQL interactive terminal. Type: \copyright for distribution terms \h for help with SQL commands \? for help on internal slash commands \g or terminate with semicolon to execute query \q to quit template1=3D> \? \a toggle between unaligned and aligned mode \c[onnect] [dbname|- [user]] connect to new database (currently 'template1') \C table title \copy ... perform SQL COPY with data stream to the client machine \copyright show PostgreSQL usage and distribution terms \d <table> describe table (or view, index, sequence) \d{t|i|s|v} list tables/indices/sequences/views \d{p|S|l} list permissions/system tables/lobjects \da list aggregates \dd [object] list comment for table, type, function, or operator \df list functions \do list operators \dT list data types \e [file] edit the current query buffer or [file] with external=20 editor \echo <text> write text to stdout \encoding <encoding> set client encoding \f <sep> change field separator \g [file] send query to backend (and results in [file] or |pipe) \h [cmd] help on syntax of sql commands, * for all commands \H toggle HTML mode (currently off) \i <file> read and execute queries from <file> \l list all databases \lo_export, \lo_import, \lo_list, \lo_unlink large object operations \o [file] send all query results to [file], or |pipe \p show the content of the current query buffer \pset <opt> set table output <opt> =3D=20 {format|border|expanded|fieldsep| null|recordsep|tuples_only|title|tableattr|pager} \q quit psql \qecho <text> write text to query output stream (see \o) \r reset (clear) the query buffer \s [file] print history or save it in [file] \set <var> <value> set internal variable \t show only rows (currently off) \T <tags> HTML table tags \unset <var> unset (delete) internal variable \w <file> write current query buffer to a <file> \x toggle expanded output (currently off) \z list table access permissions \! [cmd] shell escape or command =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D David Stanaway Personal: david@stanaway.net Work: david@netventures.com.au --Apple-Mail-1-701112064 Content-Transfer-Encoding: quoted-printable Content-Type: text/enriched; charset=ISO-8859-1 On Wednesday, January 16, 2002, at 07:09 PM, Roman Gavrilov wrote: <excerpt>Yes I=A0would like to see system tables, that is correct is there any way to see all those tables. For example in MySQL there is mysql database where you have all system tables. </excerpt> Please read the documentation. I have already told you where to look. But just incase you missed it: $ psql template1 Welcome to psql, the PostgreSQL interactive terminal. Type: \copyright for distribution terms \h for help with SQL commands \? for help on internal slash commands \g or terminate with semicolon to execute query \q to quit template1=3D> \? \a toggle between unaligned and aligned mode \c[onnect] [dbname|- [user]] connect to new database (currently 'template1') \C <<title> table title \copy ... perform SQL COPY with data stream to the client machine \copyright show PostgreSQL usage and distribution terms \d <<table> describe table (or view, index, sequence) \d{t|i|s|v} list tables/indices/sequences/views \d{p|S|l} list permissions/system tables/lobjects \da list aggregates \dd [object] list comment for table, type, function, or operator \df list functions \do list operators \dT list data types \e [file] edit the current query buffer or [file] with external editor \echo <<text> write text to stdout \encoding <<encoding> set client encoding \f <<sep> change field separator \g [file] send query to backend (and results in [file] or |pipe) \h [cmd] help on syntax of sql commands, * for all commands \H toggle HTML mode (currently off) \i <<file> read and execute queries from <<file> \l list all databases \lo_export, \lo_import, \lo_list, \lo_unlink large object operations \o [file] send all query results to [file], or |pipe \p show the content of the current query buffer \pset <<opt> set table output <<opt> =3D {format|border|expanded|fieldsep| null|recordsep|tuples_only|title|tableattr|pager} \q quit psql \qecho <<text> write text to query output stream (see \o) \r reset (clear) the query buffer \s [file] print history or save it in [file] \set <<var> <<value> set internal variable \t show only rows (currently off) \T <<tags> HTML table tags \unset <<var> unset (delete) internal variable \w <<file> write current query buffer to a <<file> \x toggle expanded output (currently off) \z list table access permissions \! [cmd] shell escape or command <fontfamily><param>Helvetica</param>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D David Stanaway Personal: david@stanaway.net=20 Work: david@netventures.com.au</fontfamily> --Apple-Mail-1-701112064--