Re: Accessing schema data in information schema - Mailing list pgsql-hackers

From Darcy Buskermolen
Subject Re: Accessing schema data in information schema
Date
Msg-id 200603221640.58233.darcy@wavefire.com
Whole thread Raw
In response to Re: Accessing schema data in information schema  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Accessing schema data in information schema
List pgsql-hackers
On Wednesday 22 March 2006 13:11, Tom Lane wrote:
> Peter Eisentraut <peter_e@gmx.net> writes:
> > How does one get at the missing fields.  The only way I know is
> > selecting from the sequence, but how does one work this into this
> > query?  Somehow it seems that these things should be stored in a real
> > system catalog.
>
> Yeah.  I've occasionally toyed with the idea that sequences should be
> rows in a single catalog instead of independent tables as they are now.
> This would make for a much smaller disk footprint (with consequent I/O
> savings) and would solve problems like the one you have.  Unfortunately
> the backward-compatibility issues seem a bit daunting :-(.  It's
> probably not completely impossible, but how do we preserve the existing
> behavior that you can "SELECT * FROM seqname" and get the parameters?
>
> Ideally I'd like
>     SELECT * FROM seqname;        -- gets params of one sequence
>     SELECT * FROM pg_sequence;    -- gets params of all sequences
>
> One possible kluge is to make all the sequences be child tables of a
> pg_sequence catalog that exists only to be their inheritance parent.
> This seems pretty ugly from a performance point of view though.
> Selecting from pg_sequence would be really expensive if you have a lot
> of sequences, and there wouldn't be any opportunity for reducing the
> disk footprint.
>
> (Thinks a bit...)  Maybe it would work for pg_sequence to be a real
> catalog with a row per sequence, and we also create a view named after
> the sequence that simply selects from pg_sequence with an appropriate
> WHERE condition.

I'd think that would be a workable solution, with documentation notes that 
this will be deprecated in favor of information_schema  in an upcoming 
release ?

>
> Plan C would be to say that we don't need to preserve "SELECT * FROM
> seqname", but I'll bet there would be some hollering.?

>
>             regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend

-- 
Darcy Buskermolen
Wavefire Technologies Corp.

http://www.wavefire.com
ph: 250.717.0200
fx: 250.763.1759


pgsql-hackers by date:

Previous
From: Trent Shipley
Date:
Subject: Re: Modular Type Libraries: was A real currency type
Next
From: Tom Lane
Date:
Subject: Re: Accessing schema data in information schema