Re: [HACKERS] Improved \df(+) in psql + backward-compatibility

From: David Fetter <david(at)fetter(dot)org>
To: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] Improved \df(+) in psql + backward-compatibility
Date: 2005-08-29 13:29:42
Message-ID: 20050829132942.GG4094@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

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(at)fetter(dot)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(at)fetter(dot)org http://fetter.org/
phone: +1 510 893 6100 mobile: +1 415 235 3778

Remember to vote!

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Qingqing Zhou 2005-08-29 13:37:27 Re: 8.1beta, SunOS and shmget
Previous Message Ilia Kantor 2005-08-29 13:04:33 Selectivity function argument: Const -> Array

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2005-08-29 13:46:21 Re: be-secure.c patch
Previous Message Robert Treat 2005-08-29 12:12:37 Re: [HACKERS] Improved \df(+) in psql + backward-compatibility