On Mon, Aug 29, 2005 at 08:12:37AM -0400, Robert Treat wrote:
> On Monday 29 August 2005 00:33, Tom Lane wrote:
> > David Fetter <david@fetter.org> writes:
> > > On a slightly related note, I've noticed that psql isn't
> > > backward compatible.
> >
> > We have never expected psql's \d commands to work against older
> > server versions, and two months after feature freeze isn't the
> > time to start making that happen.
Tom, good point on the timing. I wish I'd come up with this at a
better moment for 8.1. I still contend that this falls squarely in
the realm of bug fixes, and would be happy to get as
backward-compatible a bunch of \ functions as possible, even
back-porting, little as I believe that should be encouraged.
> That said, number of folks have looked at this problem and agree it
> would be nice to do, they just haven't formed a consensus on how to
> do it. If you have a plan for how you would want to approach this
> in 8.2, feel free to post it.
I'd be curious as to what's been proposed before, but briefly:
switch (pset.sversion/100) {
case 801:
...
break;
case 800:
...
break;
.
.
.
default:
...
break;
}
for each version-specific chunk of SQL that a backslash command would
issue. I know it makes the code bigger, but stacking things that way
makes it relatively easy to prepend new conditions at the top as
needed. Also TBD, I think it would be a Very Good Idea(TM) to see
about how this (and other front ends) can play nice with the
newsysviews project. It really chaps me to see all these wheels being
reinvented. :/
Cheers,
D
--
David Fetter david@fetter.org http://fetter.org/
phone: +1 510 893 6100 mobile: +1 415 235 3778
Remember to vote!