Re: Select works only when connected from login postgres

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joseph Brenner <doomvox(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Select works only when connected from login postgres
Date: 2016-12-04 00:51:35
Message-ID: 9621.1480812695@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Joseph Brenner <doomvox(at)gmail(dot)com> writes:
> I'm trying to get a new build of 9.6.1 working on Debian
> stable and I'm seeing some odd behavior where things work
> correctly if I run psql when logged in as user 'postgres',
> but if I'm logged-in as user 'doom' (my usual login), I don't
> seem to have any select privileges. Even this fails
> silently:

> select 'world' as hello;

Um, define "fails silently"? Do you get a command prompt from
psql? What does the interaction look like *exactly*? If psql
just returns to the shell command prompt, maybe it's giving a
nonzero exit code? (try "echo $?" afterwards)

[ and later... ]

> The only thing unusual about the steps that I followed was I built
> with port 5433 (rather than 5432) as the default,

This is not as simple as it might look; the default port is actually
wired into libpq.so, not psql itself. And on most brands of Linuxen,
it's not that easy to get a program to link to a non-default copy of
a shared library if there's a copy in /usr/lib. However, if you were
connecting to the wrong port number, I'd still not expect that it
just dies without saying anything.

Hmm ... a different take on that is that maybe psql is crashing
because it's linking to an ABI-incompatible libpq. You should try
"ldd" on the psql executable and see if it's resolving the libpq
dependency to the copy you intended.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gmail 2016-12-04 00:59:22 Re: Postrgres-XL and Postgres-BDR
Previous Message Raymond O'Donnell 2016-12-04 00:48:06 Re: No select privileges when not connecting from login postgres

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2016-12-04 01:06:53 Re: Logical Replication WIP
Previous Message Joseph Brenner 2016-12-03 23:04:55 Re: Select works only when connected from login postgres