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 06:43:09
Message-ID: 28691.963816189@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 would have thought that the database itself should be the tool used to
> display SQL, and if not the database, then one of the interface libraries.

You might be on to something. We have bits and pieces of that, such as
the rule reverse-lister and the code Peter just added to create a
readable version of a type name, but maybe some more consolidation is
in order.

> The separation would have the further advantage that when a new language
> feature is added the person adding it does not have to remember to update
> pg_dump, psql etc. And the task might be a little easier, since I would
> hope that the code to dump the definition would be close to the code to
> parse it.

No, not really. The only advantage would be in centralizing the display
capability and having just one copy instead of several. That is a
substantial advantage, but you only get it if you make sure the backend
display capability is defined in a way that lets all these apps use it.
That might take some careful thought. For example, does the definition
of a table include associated constraints and indexes? pg_dump would
want them separate, other apps perhaps not. Also, psql's \d command
doesn't display the schema of a table in the form of a CREATE command
to recreate it, and I don't think it should. Certainly you don't want
to condemn every app that wants to know "what are the columns of this
table" to have to include a full SQL parser to make sense of the
answer. So I think some thought is needed to figure out what a
general-purpose representation would be like.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Philip Warner 2000-07-17 06:52:01 Re: Should PG backend know how to represent metadata?
Previous Message Chris Bitmead 2000-07-17 06:30:23 Re: Should PG backend know how to represent metadata?