From SN14@chrysler.com Mon Jan 26 18:15:27 1998 Received: from fxiod01.is.chrysler.com (firewall-user@fxiod01.is.chrysler.com [204.189.94.70]) by hub.org (8.8.8/8.7.5) with SMTP id NAA05074 for ; Mon, 26 Jan 1998 13:15:27 -0500 (EST) From: SN14@chrysler.com Received: by fxiod01.is.chrysler.com; id NAA19611; Mon, 26 Jan 1998 13:13:37 -0500 Received: from odhubpr1-le0.oddc.chrysler.com(192.168.212.80) by fxiod01.is.chrysler.com via smap (3.2) id xma019288; Mon, 26 Jan 98 13:13:09 -0500 Received: from infoctr.chrysler.com (clic.cldc.chrysler.com [192.168.137.67]) by odhubpr1-nf0.oddc.chrysler.com (8.8.5/8.8.5/chrysler-relay.1.2-kcd) with SMTP id NAA10187 for ; Mon, 26 Jan 1998 13:14:53 -0500 (EST) Received: from SN14 by infoctr.chrysler.com (IBM VM SMTP V2R4) with BSMTP id 3664; Mon, 26 Jan 98 13:14:52 EST Message-ID: <729414.47692.387040@infoctr.chrysler.com> Comments: Converted from OfficeVision/VM to RFC822 format by PUMP V2.2X Date: Mon, 26 Jan 98 13:14:51 EST Subject: C++/C interface functions to find tables in a database??? To: I need C/C++ interface functions to find all tables in a database and all the fields in a table. Thank you for the help. Steven Nie From scrappy@hub.org Mon Jan 26 19:03:48 1998 Received: from localhost (scrappy@localhost) by hub.org (8.8.8/8.7.5) with SMTP id OAA10648; Mon, 26 Jan 1998 14:03:48 -0500 (EST) Date: Mon, 26 Jan 1998 14:03:47 -0500 (EST) From: The Hermit Hacker To: SN14@chrysler.com cc: pgsql-interfaces@postgreSQL.org Subject: Re: [INTERFACES] C++/C interface functions to find tables in a database??? In-Reply-To: <729414.47692.387040@infoctr.chrysler.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Mon, 26 Jan 1998 SN14@chrysler.com wrote: > > I need C/C++ interface functions to find all tables in a database and all the > fields in a table. Check out 'man libpq' for the PQfname() function...you'll want to do a 'SELECT * from WHERE oid = 0'; which will return zero results, but will give you the fields to grab using PQfname() Can't help with the tables though...you'll want to look at 'man catalogs' Another good place to look is psql.c, which has the various 'SELECT' statements used in psql for calling up tables and whatnot