Re: [INTERFACES] [pgaccess-users] RE: - Mailing list pgsql-hackers

From Jan Wieck
Subject Re: [INTERFACES] [pgaccess-users] RE:
Date
Msg-id 3D2CDD94.5ECA7540@Yahoo.com
Whole thread Raw
In response to Re: [INTERFACES] [pgaccess-users] RE: bugzilla.pgaccess.org  (Bradley Baetz <bbaetz@student.usyd.edu.au>)
List pgsql-hackers
Rod Taylor wrote:
> 
> > However, is there an easy way of obtaining the list of columns (and their
> > types/indexes/etc) in a table, so that we can recreate table a with just
> > that column missing? One which won't break when the underlying pg_* schema
> > changes?
> 
> I see.  No, not that I know of.  You could take an SQL dump of the DB
> and work on that, then restore at the end of the upgrade process -- but
> thats not so good :)

One way to make the application more DB version independent is to
hide the system catalog version specific stuff in views. Whatever
information you need from the catalog, wrap it into bzdd_*
functions and views (BugZillaDataDictionary). If the catalog
changes, you just change the functions and views.

You finally end up with one .sql file per supported BZ/PG
combination. But that's alot better than bunches of if()'s in the
application code.


Jan

-- 

#======================================================================#
# It's easier to get forgiveness for being wrong than for being
right. #
# Let's break this rule - forgive
me.                                  #
#==================================================
JanWieck@Yahoo.com #


pgsql-hackers by date:

Previous
From: Bradley Baetz
Date:
Subject: Re: [INTERFACES] [pgaccess-users] RE: bugzilla.pgaccess.org
Next
From: Bruce Momjian
Date:
Subject: Re: [INTERFACES] [pgaccess-users] RE: bugzilla.pgaccess.org