Thread: Re: [PATCHES] Version checking when loading psql

Re: [PATCHES] Version checking when loading psql

From
Tom Lane
Date:
[ redirected from patches to general ]

Peter Eisentraut <peter_e@gmx.net> writes:
> Greg Sabino Mullane writes:
>> Attached is a little patch that simply verifies that the
>> version of psql you are running is the same as the version
>> of postgresql you are attaching to.

> I'm sure this would annoy people.

I'm of two minds about it.  It'd annoy *me*, but I know we have seen
trouble reports from people who were using version-mismatched psql
and didn't understand why some \d commands didn't work.  Maybe we
should be catering more to newbies here.

Any other opinions out there?

            regards, tom lane

Re: [PATCHES] Version checking when loading psql

From
Bruce Momjian
Date:
> > I'm sure this would annoy people.
>
> I'm of two minds about it.  It'd annoy *me*, but I know we have seen
> trouble reports from people who were using version-mismatched psql
> and didn't understand why some \d commands didn't work.  Maybe we
> should be catering more to newbies here.
>
> Any other opinions out there?

Seems heavy-handed to warn each time.  Could we plop a file in the
user's home directory and warn the first time it doesn't match?  That
seems like overkill too.  :-)

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Re: [PATCHES] Version checking when loading psql

From
Vince Vielhaber
Date:
On Wed, 21 Nov 2001, Tom Lane wrote:

> [ redirected from patches to general ]
>
> Peter Eisentraut <peter_e@gmx.net> writes:
> > Greg Sabino Mullane writes:
> >> Attached is a little patch that simply verifies that the
> >> version of psql you are running is the same as the version
> >> of postgresql you are attaching to.
>
> > I'm sure this would annoy people.
>
> I'm of two minds about it.  It'd annoy *me*, but I know we have seen
> trouble reports from people who were using version-mismatched psql
> and didn't understand why some \d commands didn't work.  Maybe we
> should be catering more to newbies here.
>
> Any other opinions out there?

I'd rather know than not know.  But anything more than a warning on
connect would be truly annoying.  We've had mismatches on the hub
machines.

Vince.
--
==========================================================================
Vince Vielhaber -- KA8CSH    email: vev@michvhf.com    http://www.pop4.net
         56K Nationwide Dialup from $16.00/mo at Pop4 Networking
        Online Campground Directory    http://www.camping-usa.com
       Online Giftshop Superstore    http://www.cloudninegifts.com
==========================================================================




Re: [PATCHES] Version checking when loading psql

From
Tom Lane
Date:
Vince Vielhaber <vev@zippy.pop4.net> writes:
>> Any other opinions out there?

> I'd rather know than not know.  But anything more than a warning on
> connect would be truly annoying.

It was only a warning, not a refusal to proceed --- I doubt anyone
would hold still for the latter.

One point that may or may not sway anyone's opinion is that this would
require an extra query cycle during psql startup, meaning slower psql
launch.

            regards, tom lane

Re: [PATCHES] Version checking when loading psql

From
Vince Vielhaber
Date:
On Wed, 21 Nov 2001, Tom Lane wrote:

> Vince Vielhaber <vev@zippy.pop4.net> writes:
> >> Any other opinions out there?
>
> > I'd rather know than not know.  But anything more than a warning on
> > connect would be truly annoying.
>
> It was only a warning, not a refusal to proceed --- I doubt anyone
> would hold still for the latter.
>
> One point that may or may not sway anyone's opinion is that this would
> require an extra query cycle during psql startup, meaning slower psql
> launch.

And after \connect ??


Vince.
--
==========================================================================
Vince Vielhaber -- KA8CSH    email: vev@michvhf.com    http://www.pop4.net
         56K Nationwide Dialup from $16.00/mo at Pop4 Networking
        Online Campground Directory    http://www.camping-usa.com
       Online Giftshop Superstore    http://www.cloudninegifts.com
==========================================================================




Re: [PATCHES] Version checking when loading psql

From
Bruce Momjian
Date:
> Vince Vielhaber <vev@zippy.pop4.net> writes:
> >> Any other opinions out there?
>
> > I'd rather know than not know.  But anything more than a warning on
> > connect would be truly annoying.
>
> It was only a warning, not a refusal to proceed --- I doubt anyone
> would hold still for the latter.
>
> One point that may or may not sway anyone's opinion is that this would
> require an extra query cycle during psql startup, meaning slower psql
> launch.

Ewe, that is a negative.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Re: [PATCHES] Version checking when loading psql

From
Andrew Sullivan
Date:
On Wed, Nov 21, 2001 at 10:12:02AM -0500, Tom Lane wrote:

> Peter Eisentraut <peter_e@gmx.net> writes:
> > Greg Sabino Mullane writes:
> >> Attached is a little patch that simply verifies that the
> >> version of psql you are running is the same as the version
> >> of postgresql you are attaching to.
>
> > I'm sure this would annoy people.
>
> I'm of two minds about it.  [. . .]
>
> Any other opinions out there?

Depends what it'd do.  If it would disconnect you, well then, very
bad.  If it would just send a warning ("mismatched psq & postgres:
some features may not work"), well, nothing wrong with that.  It
might cut down on the questions and such.  But if it disables you
completely, well, ug.  No functionality is certainly worse than
limited functionality.

A

--
----
Andrew Sullivan                               87 Mowat Avenue
Liberty RMS                           Toronto, Ontario Canada
<andrew@libertyrms.info>                              M6K 3E3
                                         +1 416 646 3304 x110


Re: [PATCHES] Version checking when loading psql

From
Peter Eisentraut
Date:
Tom Lane writes:

> I'm of two minds about it.  It'd annoy *me*, but I know we have seen
> trouble reports from people who were using version-mismatched psql
> and didn't understand why some \d commands didn't work.  Maybe we
> should be catering more to newbies here.

Maybe only print the warning when a \d command is used (immediately
before or after).  However, I'd much rather make the \d commands
compatible a version or two back.

--
Peter Eisentraut   peter_e@gmx.net


Re: [PATCHES] Version checking when loading psql

From
Alvaro Herrera
Date:
On Wed, 21 Nov 2001, Tom Lane wrote:

> Peter Eisentraut <peter_e@gmx.net> writes:
> > Greg Sabino Mullane writes:
> >> Attached is a little patch that simply verifies that the
> >> version of psql you are running is the same as the version
> >> of postgresql you are attaching to.
>
> > I'm sure this would annoy people.
>
> I'm of two minds about it.  It'd annoy *me*, but I know we have seen
> trouble reports from people who were using version-mismatched psql
> and didn't understand why some \d commands didn't work.  Maybe we
> should be catering more to newbies here.

What about refusing to connect with unmatching versions unless you have
some environment variable set?

This way, newbies will have their connection refused and will have to
take some action (at least read some docs as to how to make it work),
but those who know better can just use it right away.

--
Alvaro Herrera (<alvherre[@]atentus.com>)
"El miedo atento y previsor es la madre de la seguridad" (E. Burke)