Re: Should PG backend know how to represent metadata?

From: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Should PG backend know how to represent metadata?
Date: 2000-07-17 16:30:38
Message-ID: 3.0.5.32.20000718023038.0243b430@mail.rhyme.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At 10:46 17/07/00 -0400, Tom Lane wrote:
>Philip Warner <pjw(at)rhyme(dot)com(dot)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 |/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Philip Warner 2000-07-17 16:47:45 Re: Should PG backend know how to represent metadata?
Previous Message Larry Rosenman 2000-07-17 16:10:45 Update: mac.c update, patch now on ftp