Re: Should PG backend know how to represent metadata?

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

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).

> 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

In response to

Responses

Browse pgsql-hackers by date

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