From niral.trivedi@insage.com Fri Dec 15 21:44:59 2000 Received: from ariel.planet.net (ariel.planet.net [208.163.30.11]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eBFLix613541; Fri, 15 Dec 2000 16:44:59 -0500 (EST) (envelope-from niral.trivedi@insage.com) Received: by ariel.planet.net with Internet Mail Service (5.5.2650.21) id ; Fri, 15 Dec 2000 16:49:15 -0500 Message-ID: <328DC4EC2C9B74428D8DAED1931285BF10D95D@FLAN-EXCH01.corp.insage.com> From: Niral Trivedi To: pgsql-general@postgresql.org Cc: "'pgsql-admin@postgresql.org'" Subject: simple questions Date: Fri, 15 Dec 2000 16:45:25 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" X-Archive-Number: 200012/107 X-Sequence-Number: 302 All, I have very simple two questions.. How can we 'describe a table' and 'view all available tables' in postgres DB?? I am looking for something similar to 'desc ' and 'show tables' in MySQL or 'desc
' and 'select * from tab' in Oracle.. Thanks in advance for your help.. Niral From bhoran@herald.com Fri Dec 15 21:53:23 2000 Received: from magellan.herald.com (NS1.herald.com [199.172.188.2]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eBFLrN614404; Fri, 15 Dec 2000 16:53:23 -0500 (EST) (envelope-from bhoran@herald.com) Received: (from uucp@localhost) by magellan.herald.com (8.8.5/8.8.8) id QAA04956; Fri, 15 Dec 2000 16:50:08 -0500 (EST) Received: from unknown(166.108.250.249) by magellan-new.herald.com via smap (V5.0) id xma004931; Fri, 15 Dec 00 16:49:53 -0500 Received: from herald.com (IDENT:bhoran@cartman [127.0.0.1]) by localhost.localdomain (8.9.3/8.8.7) with ESMTP id QAA03949; Fri, 15 Dec 2000 16:52:54 -0500 Message-ID: <3A3A92B4.5963BF39@herald.com> Date: Fri, 15 Dec 2000 16:52:52 -0500 From: Brian Horan X-Mailer: Mozilla 4.72 [en] (X11; U; Linux 2.2.14-5.0 i686) X-Accept-Language: en MIME-Version: 1.0 To: Niral Trivedi CC: pgsql-general@postgresql.org, "'pgsql-admin@postgresql.org'" Subject: Re: simple questions References: <328DC4EC2C9B74428D8DAED1931285BF10D95D@FLAN-EXCH01.corp.insage.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200012/108 X-Sequence-Number: 303 Niral Trivedi wrote: > > All, > > I have very simple two questions.. > > How can we 'describe a table' and 'view all available tables' in postgres > DB?? > > I am looking for something similar to 'desc
' and 'show tables' in > MySQL or > 'desc
' and 'select * from tab' in Oracle.. > > Thanks in advance for your help.. > > Niral easily. psql#> \d table_name for a specific table psql#> \d for all tables and \? for other useful stuff with backslashes. -- ,~, v Brian Horan /(|)\ Systems Analyst/Programmer /( | )\ Miami Herald Publishing Company //( | )\\ bhoran@herald.com cell: (954) 296-7807 -----"-"----------------------------------------- From jliang@ipinc.com Fri Dec 15 21:55:22 2000 Received: from tidal.ipinc.com (tidal.ipinc.com [199.245.188.85]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eBFLtM614658; Fri, 15 Dec 2000 16:55:22 -0500 (EST) (envelope-from jliang@tidal.ipinc.com) Received: from localhost (jliang@localhost) by tidal.ipinc.com (8.9.3/8.9.3) with ESMTP id NAA50198; Fri, 15 Dec 2000 13:55:49 -0800 (PST) (envelope-from jliang@tidal.ipinc.com) Date: Fri, 15 Dec 2000 13:55:49 -0800 (PST) From: Jie Liang To: Niral Trivedi cc: pgsql-general@postgresql.org, "'pgsql-admin@postgresql.org'" Subject: Re: simple questions In-Reply-To: <328DC4EC2C9B74428D8DAED1931285BF10D95D@FLAN-EXCH01.corp.insage.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200012/109 X-Sequence-Number: 304 Hi, there, in psql use \d tablename BTW you can use \? to list all related command Jie LIANG Internet Products Inc. 10350 Science Center Drive Suite 100, San Diego, CA 92121 Office:(858)320-4873 jliang@ipinc.com www.ipinc.com On Fri, 15 Dec 2000, Niral Trivedi wrote: > All, > > I have very simple two questions.. > > How can we 'describe a table' and 'view all available tables' in postgres > DB?? > > I am looking for something similar to 'desc
' and 'show tables' in > MySQL or > 'desc
' and 'select * from tab' in Oracle.. > > Thanks in advance for your help.. > > Niral > From bmccoy@chapelperilous.net Mon Dec 18 03:50:43 2000 Received: from mail.postgresql.org (webmail.postgresql.org [216.126.85.28]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id eBI3oh640835 for ; Sun, 17 Dec 2000 22:50:43 -0500 (EST) (envelope-from pgsql-admin-owner@postgresql.org) Received: from chapelperilous.net (chapelperilous.net [216.254.44.199]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eBFLsa614514; Fri, 15 Dec 2000 16:54:36 -0500 (EST) (envelope-from bmccoy@chapelperilous.net) Received: from localhost (bmccoy@localhost) by chapelperilous.net (8.9.3/8.9.3) with ESMTP id QAA18263; Fri, 15 Dec 2000 16:56:26 -0500 Date: Fri, 15 Dec 2000 16:56:26 -0500 (EST) From: "Brett W. McCoy" To: Niral Trivedi cc: , "'pgsql-admin@postgresql.org'" Subject: Re: [GENERAL] simple questions In-Reply-To: <328DC4EC2C9B74428D8DAED1931285BF10D95D@FLAN-EXCH01.corp.insage.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200012/112 X-Sequence-Number: 308 On Fri, 15 Dec 2000, Niral Trivedi wrote: > I have very simple two questions.. > > How can we 'describe a table' and 'view all available tables' in postgres > DB?? > > I am looking for something similar to 'desc
' and 'show tables' in > MySQL or > 'desc
' and 'select * from tab' in Oracle.. If you are using the psql app, \d will show you all relations (tables, sequences, etc). \dt will show all tables, \dt
will show the details of a particualr table. See the online help \? for more info. -- Brett http://www.chapelperilous.net/~bmccoy/ --------------------------------------------------------------------------- If we all work together, we can totally disrupt the system. From jliang@ipinc.com Fri Dec 15 21:57:06 2000 Received: from tidal.ipinc.com (tidal.ipinc.com [199.245.188.85]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eBFLv5614865; Fri, 15 Dec 2000 16:57:06 -0500 (EST) (envelope-from jliang@tidal.ipinc.com) Received: from localhost (jliang@localhost) by tidal.ipinc.com (8.9.3/8.9.3) with ESMTP id NAA50213; Fri, 15 Dec 2000 13:57:33 -0800 (PST) (envelope-from jliang@tidal.ipinc.com) Date: Fri, 15 Dec 2000 13:57:33 -0800 (PST) From: Jie Liang To: Niral Trivedi cc: pgsql-general@postgresql.org, "'pgsql-admin@postgresql.org'" Subject: Re: simple questions In-Reply-To: <328DC4EC2C9B74428D8DAED1931285BF10D95D@FLAN-EXCH01.corp.insage.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200012/111 X-Sequence-Number: 306 \d tablename \dt --- list all tables \dv --- list all views Jie LIANG Internet Products Inc. 10350 Science Center Drive Suite 100, San Diego, CA 92121 Office:(858)320-4873 jliang@ipinc.com www.ipinc.com On Fri, 15 Dec 2000, Niral Trivedi wrote: > All, > > I have very simple two questions.. > > How can we 'describe a table' and 'view all available tables' in postgres > DB?? > > I am looking for something similar to 'desc
' and 'show tables' in > MySQL or > 'desc
' and 'select * from tab' in Oracle.. > > Thanks in advance for your help.. > > Niral > From olly@lfix.co.uk Fri Dec 15 22:00:14 2000 Received: from anchor-post-31.mail.demon.net (anchor-post-31.mail.demon.net [194.217.242.89]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eBFM0E615421; Fri, 15 Dec 2000 17:00:14 -0500 (EST) (envelope-from olly@lfix.co.uk) Received: from lfix.demon.co.uk ([158.152.59.127] helo=linda.lfix.co.uk) by anchor-post-31.mail.demon.net with esmtp (Exim 2.12 #1) id 1472uB-0004YR-0V; Fri, 15 Dec 2000 22:00:43 +0000 Received: from lfix.co.uk (olly@localhost [127.0.0.1]) by linda.lfix.co.uk (8.11.1/8.11.1/Debian 8.11.0-6) with ESMTP id eBFM0dr15350; Fri, 15 Dec 2000 22:00:39 GMT Message-Id: <200012152200.eBFM0dr15350@linda.lfix.co.uk> X-Authentication-Warning: linda.lfix.co.uk: Host olly@localhost [127.0.0.1] claimed to be lfix.co.uk X-Mailer: exmh version 2.2 06/23/2000 (debian 2.2-1) with nmh-1.0.4+dev X-URL: http://www.lfix.co.uk/oliver X-face: "xUFVDj+ZJtL_IbURmI}!~xAyPC"Mrk=MkAm&tPQnNq(FWxv49R}\>0oI8VM?O2VY+N7@F- KMLl*!h}B)u@TW|B}6 cc: pgsql-general@postgresql.org, "'pgsql-admin@postgresql.org'" Subject: Re: simple questions In-reply-to: Message from Niral Trivedi of Fri, 15 Dec 2000 16:45:25 EST. <328DC4EC2C9B74428D8DAED1931285BF10D95D@FLAN-EXCH01.corp.insage.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 15 Dec 2000 22:00:37 +0000 From: "Oliver Elphick" X-Archive-Number: 200012/111 X-Sequence-Number: 307 Niral Trivedi wrote: >All, > >I have very simple two questions.. > >How can we 'describe a table' and 'view all available tables' in postgres >DB?? > >I am looking for something similar to 'desc
' and 'show tables' in >MySQL or >'desc
' and 'select * from tab' in Oracle.. In psql: \d lists all tables \d table lists all columns in a table use \? for help on psql commands and \h for help on SQL commands Start psql with -E to see the SQL queries that \d produces. -- Oliver Elphick Oliver.Elphick@lfix.co.uk Isle of Wight http://www.lfix.co.uk/oliver PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47 6B 7E 39 CC 56 E4 C1 47 GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C ======================================== "The fear of the LORD is the instruction of wisdom, and before honour is humility." Proverbs 15:33 From niral.trivedi@insage.com Fri Dec 15 22:00:59 2000 Received: from ariel.planet.net (ariel.planet.net [208.163.30.11]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eBFM0x615450; Fri, 15 Dec 2000 17:00:59 -0500 (EST) (envelope-from niral.trivedi@insage.com) Received: by ariel.planet.net with Internet Mail Service (5.5.2650.21) id ; Fri, 15 Dec 2000 17:05:15 -0500 Message-ID: <328DC4EC2C9B74428D8DAED1931285BF10D95E@FLAN-EXCH01.corp.insage.com> From: Niral Trivedi To: "'Jie Liang'" Cc: pgsql-general@postgresql.org, "'pgsql-admin@postgresql.org'" Subject: RE: simple questions Date: Fri, 15 Dec 2000 17:01:24 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" X-Archive-Number: 200012/110 X-Sequence-Number: 305 Thank you all for your such a quick response.. Niral