Thread: Is this fixable?

Is this fixable?

From
Josh Berkus
Date:
Guys,

On current Ubuntu/Debian, if you try to use "pg_ctl" instead of
"pg_ctlcluster", you get this message:

The program 'pg_ctl' is currently not installed. To run 'pg_ctl' please
ask your administrator to install the package 'postgres-xc'

I know where that's coming from, but to date I've witnessed four
postgres beginners then trying to install postgres-xc and really messing
up their servers.  Is there any possible way to fix the command database
so that users don't get that error message?

--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com


Re: Is this fixable?

From
Magnus Hagander
Date:
On Fri, Oct 17, 2014 at 12:41 AM, Josh Berkus <josh@agliodbs.com> wrote:
> Guys,
>
> On current Ubuntu/Debian, if you try to use "pg_ctl" instead of
> "pg_ctlcluster", you get this message:

How do you define "current Ubuntu/Debian"? Because I don't get that on
debian stable for example. I do get it on current Ubuntu LTS (trusty).


> The program 'pg_ctl' is currently not installed. To run 'pg_ctl' please
> ask your administrator to install the package 'postgres-xc'
>
> I know where that's coming from, but to date I've witnessed four
> postgres beginners then trying to install postgres-xc and really messing
> up their servers.  Is there any possible way to fix the command database
> so that users don't get that error message?

That does indeed sound like a packaging issue with postgres-xc. It
shouldn't expose a non-versioned pg_ctl, the same way that regular
PostgreSQL doesn't.

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/


Re: Is this fixable?

From
Thom Brown
Date:
On 17 October 2014 09:43, Magnus Hagander <magnus@hagander.net> wrote:
On Fri, Oct 17, 2014 at 12:41 AM, Josh Berkus <josh@agliodbs.com> wrote:
> Guys,
>
> On current Ubuntu/Debian, if you try to use "pg_ctl" instead of
> "pg_ctlcluster", you get this message:

How do you define "current Ubuntu/Debian"? Because I don't get that on
debian stable for example. I do get it on current Ubuntu LTS (trusty).

I get it on LMDE:

# pg_ctl
The program 'pg_ctl' is currently not installed.  You can install it by typing:
apt-get install postgres-xc
pg_ctl: command not found

LMDE is based on Debian Testing.

--
Thom

Re: Is this fixable?

From
Josh Berkus
Date:
On 10/17/2014 01:43 AM, Magnus Hagander wrote:
> On Fri, Oct 17, 2014 at 12:41 AM, Josh Berkus <josh@agliodbs.com> wrote:
>> Guys,
>>
>> On current Ubuntu/Debian, if you try to use "pg_ctl" instead of
>> "pg_ctlcluster", you get this message:
>
> How do you define "current Ubuntu/Debian"? Because I don't get that on
> debian stable for example. I do get it on current Ubuntu LTS (trusty).

I'm seeing it on Ubuntu 12.04 and 14.04.  I thought I got it on one
version of Debian, but now I can't find that.


--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com


Re: Is this fixable?

From
Christoph Berg
Date:
On 17. Oktober 2014 09:43:06 GMT+01:00, Magnus Hagander <magnus@hagander.net> wrote:
>On Fri, Oct 17, 2014 at 12:41 AM, Josh Berkus <josh@agliodbs.com>
>wrote:
>> Guys,
>>
>> On current Ubuntu/Debian, if you try to use "pg_ctl" instead of
>> "pg_ctlcluster", you get this message:
>
>How do you define "current Ubuntu/Debian"? Because I don't get that on
>debian stable for example. I do get it on current Ubuntu LTS (trusty).
>
>
>> The program 'pg_ctl' is currently not installed. To run 'pg_ctl'
>please
>> ask your administrator to install the package 'postgres-xc'
>>
>> I know where that's coming from, but to date I've witnessed four
>> postgres beginners then trying to install postgres-xc and really
>messing
>> up their servers.  Is there any possible way to fix the command
>database
>> so that users don't get that error message?
>
>That does indeed sound like a packaging issue with postgres-xc. It
>shouldn't expose a non-versioned pg_ctl, the same way that regular
>PostgreSQL doesn't.

Ubuntu has some package like command-not-found preinstalled which Debian hasn't. I have no clue how to "tune" that
thing,though. 


Re: Is this fixable?

From
Markus Wanner
Date:
On 10/17/2014 10:43 AM, Magnus Hagander wrote:
> On Fri, Oct 17, 2014 at 12:41 AM, Josh Berkus <josh@agliodbs.com> wrote:
>> Is there any possible way to fix the command database
>> so that users don't get that error message?

Looking at the command-not-found sources, there doesn't seem to be any
kind of rule system or exceptions. It's just an index (not even a stupid
one, correcting spelling errors and such. But if you ask for pg_ctl,
that's a perfect match.)

Extending the search paths to include /usr/lib/postgresql/X.Y/bin in the
index wouldn't help, as these directories usually aren't in the PATH.
(And postgresql-X.Y is likely to be installed already, in that situation.)

What command-not-found could probably do instead is taking those
(installed) executables into account and propose to use them.

> That does indeed sound like a packaging issue with postgres-xc. It
> shouldn't expose a non-versioned pg_ctl, the same way that regular
> PostgreSQL doesn't.

That sounds like a good idea independent of this issue. Ideally, making
Postgres-XC (and Postgres-XL...) co-installable with vanilla Postgres
versions. Also seems like a substantial amount of work, though.

>> to date I've witnessed four postgres beginners then trying to
>> install postgres-xc and really messing up their servers.

Granted, the advice is unfortunate. However, given postgres-xc conflicts
with postgresql-common, the package manager would have to ask about
uninstalling postgresql-common and all dependent Postgres packages. That
would raise a couple of red flags for me. So I'm also a bit surprised
people manage to screw their systems that way... AKA: It ain't broken
*that* badly.

Another, simplistic idea: Given these packages currently conflict, could
(and should) postgresql-common provide a wrapper or dummy /usr/bin/pg_ctl?

Regards

Markus Wanner



Attachment

Re: Is this fixable?

From
Christoph Berg
Date:
Re: Markus Wanner 2014-10-20 <5444BAF0.6020308@bluegap.ch>
> >> to date I've witnessed four postgres beginners then trying to
> >> install postgres-xc and really messing up their servers.
>
> Granted, the advice is unfortunate. However, given postgres-xc conflicts
> with postgresql-common, the package manager would have to ask about
> uninstalling postgresql-common and all dependent Postgres packages. That
> would raise a couple of red flags for me. So I'm also a bit surprised
> people manage to screw their systems that way... AKA: It ain't broken
> *that* badly.

I've seen people who had gone down that road pop up on #postgresql
more than once in the past. But yes, if you install something and it
nukes half of your system, you somewhat get to break the pieces.
(OTOH, if tons of HOWTOs on the internet and the PG docs talk about
using pg_ctl, installing -xc to get it isn't that far-fetched.)

> Another, simplistic idea: Given these packages currently conflict, could
> (and should) postgresql-common provide a wrapper or dummy /usr/bin/pg_ctl?

I've been pondering that, but I don't think that's a change we should
be doing in the last week before the jessie freeze.

Christoph
--
cb@df7cb.de | http://www.df7cb.de/


Re: Is this fixable?

From
Josh Berkus
Date:
On 10/22/2014 01:00 AM, Christoph Berg wrote:
> Re: Markus Wanner 2014-10-20 <5444BAF0.6020308@bluegap.ch>
>>>> to date I've witnessed four postgres beginners then trying to
>>>> install postgres-xc and really messing up their servers.
>>
>> Granted, the advice is unfortunate. However, given postgres-xc conflicts
>> with postgresql-common, the package manager would have to ask about
>> uninstalling postgresql-common and all dependent Postgres packages. That
>> would raise a couple of red flags for me. So I'm also a bit surprised
>> people manage to screw their systems that way... AKA: It ain't broken
>> *that* badly.
>
> I've seen people who had gone down that road pop up on #postgresql
> more than once in the past. But yes, if you install something and it
> nukes half of your system, you somewhat get to break the pieces.
> (OTOH, if tons of HOWTOs on the internet and the PG docs talk about
> using pg_ctl, installing -xc to get it isn't that far-fetched.)
>
>> Another, simplistic idea: Given these packages currently conflict, could
>> (and should) postgresql-common provide a wrapper or dummy /usr/bin/pg_ctl?
>
> I've been pondering that, but I don't think that's a change we should
> be doing in the last week before the jessie freeze.

It would be a contradiction of several years of postgres/debian policy
as well, so I don't think you could do it without a fight.

I think the answer is to fix Ubuntu so that it stops recommending
postgres-xc.  cc'ing Martin Pitt to see if he has any idea how to do that.

--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com


Re: Is this fixable?

From
Martin Pitt
Date:
Josh Berkus [2014-10-22  7:44 -0700]:
> I think the answer is to fix Ubuntu so that it stops recommending
> postgres-xc.  cc'ing Martin Pitt to see if he has any idea how to do that.

Yes, I agree; that would be a comparatively unintrusive solution which
would be suitable for a stable release update. Changing -xc to live
under the p-common regime is certainly a better long-term goal, but
not doable for stable releases or Jessie.

Michael Vogt (the author of command-not-found) is here on the sprint
with me. I'll ask him the next time I run into him.

Martin
--
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)


Re: Is this fixable?

From
Martin Pitt
Date:
Hello all,

Josh Berkus [2014-10-22  7:44 -0700]:
> I think the answer is to fix Ubuntu so that it stops recommending
> postgres-xc.  cc'ing Martin Pitt to see if he has any idea how to do that.

I talked to Michael Vogt today, and he said it should be easy to do. I
filed https://launchpad.net/bugs/1384864 to track this.

Thanks,

Martin
--
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)