Re: [HACKERS] Accessing schema data in information schema

2006-03-23 Thread Andrew Dunstan
Tom Lane wrote: Given the thought that we need both transactional and nontransactional state for a sequence, I'm kind of inclined to leave the transactional data in pg_class. We could still imagine putting the nontransactional state into a new pg_sequence catalog indexed by, say, the pg_class O

Re: [HACKERS] Accessing schema data in information schema

2006-03-23 Thread Tom Lane
"Zeugswetter Andreas DCP SD" <[EMAIL PROTECTED]> writes: > Of course if we still need one row in pg_class for the ACL's, that row > might as well be a view. Yeah, view or view-like thingie. Given the thought that we need both transactional and nontransactional state for a sequence, I'm kind of in

Re: [HACKERS] Accessing schema data in information schema

2006-03-23 Thread Zeugswetter Andreas DCP SD
> 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. I'd like to hear this hollering first, before we create tons of views :-) Imho it is not a problem to remove it, I am for Plan C. (Those with need for the select can stil

Re: [HACKERS] Accessing schema data in information schema

2006-03-23 Thread Jim C. Nasby
On Thu, Mar 23, 2006 at 12:10:54AM +0200, Hannu Krosing wrote: > ??hel kenal p??eval, K, 2006-03-22 kell 16:11, kirjutas Tom Lane: > > Peter Eisentraut <[EMAIL PROTECTED]> writes: > > > How does one get at the missing fields. The only way I know is > > > selecting from the sequence, but how does

Re: [HACKERS] Accessing schema data in information schema

2006-03-23 Thread Hannu Krosing
Ühel kenal päeval, K, 2006-03-22 kell 21:50, kirjutas Andrew Dunstan: > Tom Lane said: > > Darcy Buskermolen <[EMAIL PROTECTED]> writes: > >> On Wednesday 22 March 2006 13:11, Tom Lane wrote: > >>> (Thinks a bit...) Maybe it would work for pg_sequence to be a real > >>> catalog with a row per sequ

Re: [HACKERS] Accessing schema data in information schema

2006-03-22 Thread Christopher Kings-Lynne
Hm, good point. We could put 'em in pg_sequence, except that most of the operations on pg_sequence rows will be nontransactional, and that doesn't seem to square nicely with transactional updates on ACLs. Maybe we need two catalogs just to separate the transactional and nontransactional data for

Re: [HACKERS] Accessing schema data in information schema

2006-03-22 Thread Tom Lane
"Andrew Dunstan" <[EMAIL PROTECTED]> writes: > What happens to sequence ACLs? Hm, good point. We could put 'em in pg_sequence, except that most of the operations on pg_sequence rows will be nontransactional, and that doesn't seem to square nicely with transactional updates on ACLs. Maybe we need

Re: [HACKERS] Accessing schema data in information schema

2006-03-22 Thread Andrew Dunstan
Tom Lane said: > Darcy Buskermolen <[EMAIL PROTECTED]> writes: >> On Wednesday 22 March 2006 13:11, Tom Lane wrote: >>> (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

Re: [HACKERS] Accessing schema data in information schema

2006-03-22 Thread Tom Lane
Darcy Buskermolen <[EMAIL PROTECTED]> writes: > On Wednesday 22 March 2006 13:11, Tom Lane wrote: >> (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 wit

Re: [HACKERS] Accessing schema data in information schema

2006-03-22 Thread Darcy Buskermolen
On Wednesday 22 March 2006 13:11, Tom Lane wrote: > Peter Eisentraut <[EMAIL PROTECTED]> 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

Re: [HACKERS] Accessing schema data in information schema

2006-03-22 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > Hannu Krosing wrote: >> I guess we can't easily start locking some subarea of a page, say 256 >> byte subpage, or just the tuple. > Huh, we _can_ lock individual tuples, using LockTuple() (or rather, > heap_lock_tuple). Since the tuple is modified in p

Re: [HACKERS] Accessing schema data in information schema

2006-03-22 Thread Alvaro Herrera
Hannu Krosing wrote: > I guess we can't easily start locking some subarea of a page, say 256 > byte subpage, or just the tuple. > OTOH it may be possible as we don't need to lock page header for > sequences as the tuple is updated in place and will not change in size. Huh, we _can_ lock individu

Re: [HACKERS] Accessing schema data in information schema

2006-03-22 Thread Hannu Krosing
Ühel kenal päeval, K, 2006-03-22 kell 17:29, kirjutas Tom Lane: > Hannu Krosing <[EMAIL PROTECTED]> writes: > > Ühel kenal päeval, K, 2006-03-22 kell 16:11, kirjutas Tom Lane: > >> Yeah. I've occasionally toyed with the idea that sequences should be > >> rows in a single catalog instead of indepen

Re: [HACKERS] Accessing schema data in information schema

2006-03-22 Thread Tom Lane
Hannu Krosing <[EMAIL PROTECTED]> writes: > Ühel kenal päeval, K, 2006-03-22 kell 16:11, kirjutas Tom Lane: >> 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 dis

Re: [HACKERS] Accessing schema data in information schema

2006-03-22 Thread Hannu Krosing
Ühel kenal päeval, K, 2006-03-22 kell 16:11, kirjutas Tom Lane: > Peter Eisentraut <[EMAIL PROTECTED]> 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 s

Re: [HACKERS] Accessing schema data in information schema

2006-03-22 Thread Tom Lane
Peter Eisentraut <[EMAIL PROTECTED]> 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 t

[HACKERS] Accessing schema data in information schema

2006-03-22 Thread Peter Eisentraut
I'm updating the information schema for SQL:2003. I'm having some difficulties with the "sequences" view. It should look approximately like this (uninteresting stuff omitted): CREATE VIEW sequences AS SELECT CAST(current_database() AS sql_identifier) AS sequence_catalog, CAST(nc.nsp