X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 3C6C39DC815 for ; Tue, 27 Dec 2005 15:33:03 -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 75554-04 for ; Tue, 27 Dec 2005 15:33:01 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from anu.ie (mail.anu.net [213.247.49.236]) by postgresql.org (Postfix) with ESMTP id C4D289DC80C for ; Tue, 27 Dec 2005 15:32:57 -0400 (AST) Received: from kenxp (68.40.184.254) by anu.ie with ESMTP (Eudora Internet Mail Server X 3.2.8b1); Tue, 27 Dec 2005 19:32:57 +0000 From: "Ken Winter" To: "'George Pavlov'" , Subject: Re: The Information Schema vs the PG Catalog Date: Tue, 27 Dec 2005 14:32:52 -0500 Message-ID: <005001c60b1c$54b86bc0$6603a8c0@kenxp> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.6626 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 In-Reply-To: Importance: Normal X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.034 required=5 tests=[AWL=0.034] X-Spam-Score: 0.034 X-Spam-Level: X-Archive-Number: 200512/209 X-Sequence-Number: 23751 Thanks, George. What you say fits with what I was finding. I think that's the way I will go. ~ Ken > -----Original Message----- > From: George Pavlov [mailto:gpavlov@mynewplace.com] > Sent: Tuesday, December 27, 2005 12:11 PM > To: pgsql-sql@postgresql.org > Cc: ken@sunward.org > Subject: Re: The Information Schema vs the PG Catalog > > I would say that pg_catalog is the more complete one whereas the > information_schema the more generic, standards-conformant place. I would > stick with the information_schema unless that becomes inadequate. A case > in point may be sequences. Apart from > information_schema.columns.column_default I haven't seen them > represented anywhere there (please someone correct me if I am wrong). > You can get more information about sequences from pg_catalog.pg_class > (look for pg_class.relkind='S') and various views that sit on top of > that (e.g. pg_statio_all_sequences). > > George > > > > I'm writing PL/pgSQL routines that generate triggers, functions, > > and rules based on design characteristics of tables, columns, and > > other database objects. These routines need to be able to look up > > the definitions of these objects. I see that there are two places > > available to look up this info: the Information Schema and in the > > PG Catalog. > > > > Which source is preferable? Or if that answer isn't absolute, > > what are the reasons or conditions for preferring one over the > > other? > > > > Also, a specific question: Does the Information Schema offer any > > way to list the sequences that exist and their attributes? I > > can't seem to find any. > >