Re: Select works only when connected from login postgres

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Joseph Brenner <doomvox@gmail.com>
Cc: pgsql-general@postgresql.org
Date: 2016-12-04T00:51:35Z
Lists: pgsql-hackers, pgsql-general
Joseph Brenner <doomvox@gmail.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


Commits

  1. Handle empty or all-blank PAGER setting more sanely in psql.