Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 0432A4768FA for ; Thu, 29 Aug 2002 08:51:10 -0400 (EDT) Received: from mceahern.com (maxmail002.maximumasp.com [216.26.162.8]) by postgresql.org (Postfix) with ESMTP id A5FBF4768A2 for ; Thu, 29 Aug 2002 08:51:00 -0400 (EDT) Received: from LAPMARK [64.109.31.28] by mceahern.com with ESMTP (SMTPD32-7.12) id A8A779B011A; Thu, 29 Aug 2002 08:50:47 -0400 From: "Mark McEahern" To: Subject: Re: programatically obtaining table layout Date: Thu, 29 Aug 2002 07:50:41 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 In-Reply-To: <1030006940.22212.0@iris.uk.clara.net> Importance: Normal X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/349 X-Sequence-Number: 5463 > Is there a way of getting the output of a \d tablename from within a > program (like describe in mysql) If I understand your question correctly, you mean how do I do what this does: psql -c "\d $tablename" $dbname $username Try this: psql --help Notice the -E option: -E Display queries that internal commands generate So: psql -c "\d $tablename" -E $dbname $username Cheers, // mark -