Re: Should PG backend know how to represent metadata?
От | Philip Warner |
---|---|
Тема | Re: Should PG backend know how to represent metadata? |
Дата | |
Msg-id | 3.0.5.32.20000718023038.0243b430@mail.rhyme.com.au обсуждение исходный текст |
Ответ на | Re: Should PG backend know how to represent metadata? (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-hackers |
At 10:46 17/07/00 -0400, Tom Lane wrote: >Philip Warner <pjw@rhyme.com.au> writes: >> I don't think we have functions that return multiple rows, > >We do, although they're a bit unwieldy to use; might be better to avoid >that feature. I'd be inclined to avoid the issue, and just have the >function return one result (which might contain newlines for readability >of course). Not sure that this has the flexibility needed for tables; I'd like the calling application to be able to get just the base table definition with no constraints, and also request the related items (constraints, indexes etc). I also want to avoid the caller from having to parse the output in any way. Perhaps it is best left as an API-only feature, but now I have thought of an SQL interface, I do like the idea. > >> Which brings me to my next idea: > >> select defn from pg_dump where type='table and name = 'foo' >> or >> select related_items from pg_dump where type='table and name = 'foo' > >> where pg_dump can be implemented via a rewrite rule....maybe. > >The rewrite rule couldn't do any of the heavy lifting; it'd still end >up calling a function. A view like pg_rules might not be a bad idea, >but you should plan on exposing the underlying function for >flexibility. Sounds fine. Only I'm not sure that a rule can do it - AFAICT I still need some underlying table to select from when I use a rule...unless I can fake a result set for a 'special' table? ---------------------------------------------------------------- Philip Warner | __---_____ Albatross Consulting Pty. Ltd. |----/ - \ (A.C.N. 008 659 498) | /(@) ______---_ Tel: (+61) 0500 83 82 81 | _________ \ Fax: (+61) 0500 83 82 82 | ___________ | Http://www.rhyme.com.au | / \| | --________-- PGP key available upon request, | / and from pgp5.ai.mit.edu:11371 |/
В списке pgsql-hackers по дате отправления: