Re: all non-PK columns from information schema

From: Adam Cornett <adam(dot)cornett(at)gmail(dot)com>
To: Richard Broersma <richard(dot)broersma(at)gmail(dot)com>
Cc: Tarlika Elisabeth Schmitz <postgresql6(at)numerixtechnology(dot)de>, pgsql-general(at)postgresql(dot)org
Subject: Re: all non-PK columns from information schema
Date: 2011-11-16 18:48:30
Message-ID: CAB5sPxbLQSnBGog9yVv50KSDb=S-EZzC5XERJM8hPeTZi+nFMA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Nov 15, 2011 at 11:29 AM, Richard Broersma <
richard(dot)broersma(at)gmail(dot)com> wrote:

> On Tue, Nov 15, 2011 at 8:00 AM, Tarlika Elisabeth Schmitz
> <postgresql6(at)numerixtechnology(dot)de> wrote:
> > Interesting. I have previously used the information_schema for similar
> > queries.
> >
> > What are the pros and cons for using either pg_catalog or
> > information_schema?
>
> My understanding is that pg_catalog tables and views *can* change
> between major releases while the information_schema is expected to be
> more stable between major releases.
>
> Applications that depend upon the information_schema rather than
> pg_catalog are less likely to break when the PostgreSQL server is
> upgraded.
>
> --
> Regards,
> Richard Broersma Jr.
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

The reason for this is that the pg_* tables are obviously specific to
Postgres, and do change between versions.

The information_schema tables are actually part of the SQL standard so it
is a portable way to get information about the database structure.

-Adam Cornett

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Guillaume Lelarge 2011-11-16 21:58:16 Re: Foreign Tables
Previous Message Sean Patronis 2011-11-16 18:48:25 Re: [BULK] Re: Streaming Replication woes