Thread: BUG #1672: Postgres 8.0 doesn't return errors.

BUG #1672: Postgres 8.0 doesn't return errors.

From
"Gregory L Miller-Kramer"
Date:
The following bug has been logged online:

Bug reference:      1672
Logged by:          Gregory L Miller-Kramer
Email address:      millerg@contexttech.com
PostgreSQL version: 8.0.2
Operating system:   CentOS 4.0
Description:        Postgres 8.0 doesn't return errors.
Details:

To Whom it may concern:
Postgres8 does not return errors for some reason. If you look at the errors
generated on dev or purposely cause an error in psql you will see what I
mean. All errors are being dumped to /opt/pgsql/pgstartup.log. I'm thinking
maybe this is a config option when postgres is built? Or maybe a bug in
Postgres8?

I had originally thought this was fixed by removing the ">> $PGLOG" from the
the postgres startup script and restarting postgres. However, all that did
was dump errors to STDOUT rather than the log file, so it looked to me like
the problem was fixed. However, after I logged out of pgsql, I saw that I
was still getting errors on the console from other people and the apps, etc.
And when I closed my shell, all errors were lost, so I had to put the change
back so that we could at least find the errors in pgstartup.log if we need
them.

When we used 7.4.2 we did not have this issue. The errors would disply in
psql as well as in the web page. We are using Apache, mod_perl, and
apache::ASP...

Thank you,
Greg Miller-Kramer

Re: BUG #1672: Postgres 8.0 doesn't return errors.

From
Michael Fuhr
Date:
On Mon, May 16, 2005 at 02:16:34PM +0100, Gregory L Miller-Kramer wrote:
>
> Postgres8 does not return errors for some reason.

In what context?

> If you look at the errors generated on dev or purposely cause an
> error in psql you will see what I mean.

Please provide an example so we can see exactly what you're talking
about; the bug report doesn't contain enough information to duplicate
the problem.

What's the output of "SHOW client_min_messages;"?

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

Re: BUG #1672: Postgres 8.0 doesn't return errors.

From
Tom Lane
Date:
"Gregory L Miller-Kramer" <millerg@contexttech.com> writes:
> Postgres8 does not return errors for some reason. If you look at the errors
> generated on dev or purposely cause an error in psql you will see what I
> mean. All errors are being dumped to /opt/pgsql/pgstartup.log.

This report is pretty unclear, but are you complaining that there's
nothing in pgstartup.log?  There's not supposed to be; that file only
exists to catch any error messages that might come out before the error
logging mechanism is started up.  The default logging arrangement in the
8.0 RPMs is that postmaster log output goes into day-named log files
under /var/lib/pgsql/data/pg_log/.  If you don't like that, feel free to
adjust the postgresql.conf parameters that control it.

            regards, tom lane

Re: BUG #1672: Postgres 8.0 doesn't return errors.

From
Michael Fuhr
Date:
On Tue, May 17, 2005 at 05:05:03PM -0400, Gregory L Miller-Kramer wrote:

> On system One I enter the database ...
> psql exdb exdb
> select misspelled_excol from extable;
>
> and an error is displayed...
> ERROR: column 'misspelled_excol' does not exist
>
> On the "Other" system (Postgres 8.0) that error is NOT displayed.
> Infact, nothing is displayed it just returns to the prompt.

As I asked in my previous message, what's the output of the following
query?

SHOW client_min_messages;

My first guess is that client_min_messages is set to "fatal" or
"panic", which, although not among the documented settings for
client_min_messages, are allowed and would have the effect you
describe:

test=> SET client_min_messages TO panic;
SET
test=> SELECT misspelled_excol FROM extable;
test=> SET client_min_messages TO notice;
SET
test=> SELECT misspelled_excol FROM extable;
ERROR:  column "misspelled_excol" does not exist

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

Re: BUG #1672: Postgres 8.0 doesn't return errors.

From
Michael Fuhr
Date:
On Wed, May 18, 2005 at 09:11:00AM -0400, Gregory L Miller-Kramer wrote:
>
> I entered the statement you wanted. (show client_min_messages;) It
> returned...
>  client_min_messages
> ---------------------
>  log
> (1 row)
>
> I did try what you mentioned (set client_min_messages to notice;) and it
> didn't work.

Hmmm...is it possible that psql's stderr is redirected?  That's
another way I can duplicate what you're seeing:

$ psql test 2> /dev/null
test=> SELECT misspelled_excol FROM extable;
test=>

$ psql test
test=> SELECT misspelled_excol FROM extable;
ERROR:  column "misspelled_excol" does not exist
test=>

If psql's stderr isn't explicitly redirected then psql would inherit
the shell's stderr, which might be redirected.  What shell are you
using?  If it's a Bourne-like shell, what output do you get from
the following?

echo test1
echo test2 >&2

Does your system have lsof or some other utility that shows a
process's file descriptors?  If so, what does that utility show
for a running psql that's experiencing the problem?

Do you get output from non-error queries?

If none of this reveals the problem, then it might be useful to see
the output of "\set" and "show all" in psql.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

Re: BUG #1672: Postgres 8.0 doesn't return errors.

From
Gregory L Miller-Kramer
Date:
Thanks again for getting back to me.

I entered the statement you wanted. (show client_min_messages;) It
returned...
 client_min_messages
---------------------
 log
(1 row)

I did try what you mentioned (set client_min_messages to notice;) and it
didn't work.

Any other recommendations? I do appreciate your assistance and I will
endeavor to make sure to try what you suggest before replying.

Thank you,
Greg Miller-Kramer


On Tue, 2005-05-17 at 17:05 -0600, Michael Fuhr wrote:

> On Tue, May 17, 2005 at 05:05:03PM -0400, Gregory L Miller-Kramer wrote:
>
> > On system One I enter the database ...
> > psql exdb exdb
> > select misspelled_excol from extable;
> >
> > and an error is displayed...
> > ERROR: column 'misspelled_excol' does not exist
> >
> > On the "Other" system (Postgres 8.0) that error is NOT displayed.
> > Infact, nothing is displayed it just returns to the prompt.
>
> As I asked in my previous message, what's the output of the following
> query?
>
> SHOW client_min_messages;
>
> My first guess is that client_min_messages is set to "fatal" or
> "panic", which, although not among the documented settings for
> client_min_messages, are allowed and would have the effect you
> describe:
>
> test=> SET client_min_messages TO panic;
> SET
> test=> SELECT misspelled_excol FROM extable;
> test=> SET client_min_messages TO notice;
> SET
> test=> SELECT misspelled_excol FROM extable;
> ERROR:  column "misspelled_excol" does not exist
>
> --
> Michael Fuhr
> http://www.fuhr.org/~mfuhr/
>

Senior Engineer
Context Technologies, Inc.
CRM & Systems Integration - Software, Services, Solutions

1173 Pittsford-Victor Rd.
Suite 110
Pittsford, NY 14534

Phone:    585.586.6775 x8195
Fax:        585.383.8872
E-Mail:    millerg@contexttech.com
Web:    http://www.contexttech.com/

--
This message has been scanned for viruses and
dangerous content, and is believed to be clean.

Re: BUG #1672: Postgres 8.0 doesn't return errors.

From
Tom Lane
Date:
Gregory L Miller-Kramer <millerg@contexttech.com> writes:
> I entered the statement you wanted. (show client_min_messages;) It
> returned...
>  client_min_messages
> ---------------------
>  log
> (1 row)

[ scratches head... ]  It's pretty hard to see why SHOW would display
something but error messages don't get displayed.

However, I still have a sneaking feeling that SELinux is mixed up in
this somehow.  Does "/usr/sbin/getenforce" show that enforcement is
active?  If so, does "sudo /usr/sbin/setenforce 0" change psql's
behavior?

            regards, tom lane