X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id BFA199DC9D2 for ; Wed, 14 Dec 2005 13:35:12 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 34673-04 for ; Wed, 14 Dec 2005 13:35:11 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from wolff.to (wolff.to [66.93.197.194]) by postgresql.org (Postfix) with SMTP id 689649DC9C4 for ; Wed, 14 Dec 2005 13:35:09 -0400 (AST) Received: (qmail 14774 invoked by uid 500); 14 Dec 2005 17:39:55 -0000 Date: Wed, 14 Dec 2005 11:39:55 -0600 From: Bruno Wolff III To: Daniel Ariel Cc: pgsql-interfaces@postgresql.org Subject: Re: Obtaining information on the schema of tables which I do not own Message-ID: <20051214173955.GA9238@wolff.to> Mail-Followup-To: Bruno Wolff III , Daniel Ariel , pgsql-interfaces@postgresql.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.019 required=5 tests=[AWL=0.019] X-Spam-Score: 0.019 X-Spam-Level: X-Archive-Number: 200512/18 X-Sequence-Number: 5886 On Mon, Dec 12, 2005 at 23:02:52 +0200, Daniel Ariel wrote: > > Dear list, > > I am currently developing an application which needs to know information > about table schema in order to display them correctly (specificly > foreign keys, default values and not null characteristics). > > For security reasons I would prefer for it not to run as superuser. You don't have to be a superuser to see the catalog tables. In fact people sometimes complain about that. > > I may often wish to display tables which I do not own and potentially > not even have anything other than SELECT permissions to. I will need the > schema information for these tables. Probably you should start by seeing if the information schema provides what you need: http://developer.postgresql.org/docs/postgres/information-schema.html If you need more than that, then you probably want to look at the documentation for the system catalogs: http://developer.postgresql.org/docs/postgres/catalogs.html