Re: Should PG backend know how to represent metadata? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Should PG backend know how to represent metadata?
Date
Msg-id 3325.963845206@sss.pgh.pa.us
Whole thread Raw
In response to Re: Should PG backend know how to represent metadata?  (Philip Warner <pjw@rhyme.com.au>)
Responses Re: Should PG backend know how to represent metadata?  (Philip Warner <pjw@rhyme.com.au>)
List pgsql-hackers
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).

> and a 'select'
> without a 'from' is not strictly legal,

It is in postgres, and this is hardly SQL-standard-based anyway...

> 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.
        regards, tom lane


pgsql-hackers by date:

Previous
From: eisentrp@csis.gvsu.edu
Date:
Subject: Re: Should PG backend know how to represent metadata?
Next
From: Larry Rosenman
Date:
Subject: Update: mac.c update, patch now on ftp