dbTalk Databases Forums  

[BUGS] CVS Head: Pg_ctl bug?

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] CVS Head: Pg_ctl bug? in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Dave Page
 
Posts: n/a

Default [BUGS] CVS Head: Pg_ctl bug? - 08-29-2005 , 01:18 PM







I just noticed that if I don't specify a data directory either on the
command line or in $PGDATA,, pg_ctl fails silently on Windows (haven't
been able to test other platforms atm). Is this a bug or an oversight -
an error message would seem appropriate?

/D

postgres@PC30:/usr/local/pgsql$ bin/pg_ctl start
postgres@PC30:/usr/local/pgsql$ bin/pg_ctl -D data start
postmaster starting
postgres@PC30:/usr/local/pgsql$ LOG: database system was interrupted at
2005-08-29 00:34:07 GMT Standard Time
LOG: checkpoint record is at 0/39F218
LOG: redo record is at 0/39F218; undo record is at 0/0; shutdown TRUE
LOG: next transaction ID: 1478; next OID: 16392
LOG: next MultiXactId: 1; next MultiXactOffset: 0
LOG: database system was not properly shut down; automatic recovery in
progress
LOG: record with zero length at 0/39F260
LOG: redo is not required
LOG: database system is ready
LOG: transaction ID wrap limit is 2147484144, limited by database
"postgres"

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] CVS Head: Pg_ctl bug? - 08-29-2005 , 02:52 PM






"Dave Page" <dpage (AT) vale-housing (DOT) co.uk> writes:
Quote:
I just noticed that if I don't specify a data directory either on the
command line or in $PGDATA,, pg_ctl fails silently on Windows (haven't
been able to test other platforms atm). Is this a bug or an oversight -
an error message would seem appropriate?
On my machine it does this:

$ bin/pg_ctl start
pg_ctl: no database directory specified and environment variable PGDATA unset
Try "pg_ctl --help" for more information.
$

Is write_stderr() broken on Windows?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend


Reply With Quote
  #3  
Old   
Magnus Hagander
 
Posts: n/a

Default Re: [BUGS] CVS Head: Pg_ctl bug? - 08-29-2005 , 03:00 PM



Quote:
I just noticed that if I don't specify a data directory=20
either on the=20
command line or in $PGDATA,, pg_ctl fails silently on=20
Windows (haven't=20
been able to test other platforms atm). Is this a bug or an=20
oversight=20
- an error message would seem appropriate?
=20
On my machine it does this:
=20
$ bin/pg_ctl start
pg_ctl: no database directory specified and environment=20
variable PGDATA unset Try "pg_ctl --help" for more information.
$
=20
Is write_stderr() broken on Windows?
In some cases it writes to the eventlog instead of stderr. Dave, can you
check if this is what's happening to you?

//Magnus

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org


Reply With Quote
  #4  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] CVS Head: Pg_ctl bug? - 08-29-2005 , 03:15 PM



"Dave Page" <dpage (AT) vale-housing (DOT) co.uk> writes:
Quote:
In some cases it writes to the eventlog instead of stderr.

Yes, this is what's happening. Odd though, considering that I have:
#log_destination = 'stderr'
In my out-of-the-box config.
pg_ctl doesn't read the config file, though. Probably we need to
make write_stderr aware that it's running in an interactive program
rather than in the postmaster, and never use the eventlog in this context.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq


Reply With Quote
  #5  
Old   
Dave Page
 
Posts: n/a

Default Re: [BUGS] CVS Head: Pg_ctl bug? - 08-29-2005 , 03:15 PM



=20

Quote:
-----Original Message-----
From: Magnus Hagander [mailto:mha (AT) sollentuna (DOT) net]=20
Sent: 29 August 2005 20:58
To: Tom Lane; Dave Page
Cc: pgsql-bugs (AT) postgresql (DOT) org
Subject: RE: [BUGS] CVS Head: Pg_ctl bug?=20
=20
Is write_stderr() broken on Windows?
=20
In some cases it writes to the eventlog instead of stderr.=20
Dave, can you
check if this is what's happening to you?
Bah, no coffee for 2 weeks dulls the mind :-(

Yes, this is what's happening. Odd though, considering that I have:

#log_destination =3D 'stderr'

In my out-of-the-box config.

Regards, Dave.

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq


Reply With Quote
  #6  
Old   
Magnus Hagander
 
Posts: n/a

Default Re: [BUGS] CVS Head: Pg_ctl bug? - 08-29-2005 , 03:15 PM



Quote:
Is write_stderr() broken on Windows?
=20
In some cases it writes to the eventlog instead of stderr.=20
Dave, can you
check if this is what's happening to you?
=20
Bah, no coffee for 2 weeks dulls the mind :-(
=20
Yes, this is what's happening. Odd though, considering that I have:
=20
#log_destination =3D 'stderr'
=20
In my out-of-the-box config.
This is output from pg_ctl, right? pg_ctl doesn't look at
postgresql.conf...

pg_ctl has:
if (!isatty(fileno(stderr))) /* Running as a service */
.... write to eventlog ...


That check appears to be failing. The backend has a lot more elaborate
check (in port/backend/security.c). Perhaps we need to make that kind of
advanced check in pg_ctl as well?

Though I don't see any of this code changing lately, so I don't see why
it's failing now. Are you running it under some kind of different
environment than you used to? Any other ideas on why it would claim your
console is not a tty?

//Magnus

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org


Reply With Quote
  #7  
Old   
Magnus Hagander
 
Posts: n/a

Default Re: [BUGS] CVS Head: Pg_ctl bug? - 08-29-2005 , 03:21 PM



Quote:
In some cases it writes to the eventlog instead of stderr.=20
=20
Yes, this is what's happening. Odd though, considering that I have:
#log_destination =3D 'stderr'
In my out-of-the-box config.
=20
pg_ctl doesn't read the config file, though. Probably we=20
need to make write_stderr aware that it's running in an=20
interactive program rather than in the postmaster, and never=20
use the eventlog in this context.
It must sitll use the eventlog when called as a service control process,
otherwise any error output from pg_ctl in that scenario would go to
/dev/null...=20
There is code that attempts to check this, but it's apparantly failing.

//Magnus

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster


Reply With Quote
  #8  
Old   
Dave Page
 
Posts: n/a

Default Re: [BUGS] CVS Head: Pg_ctl bug? - 08-29-2005 , 03:30 PM



=20

Quote:
-----Original Message-----
From: Tom Lane [mailto:tgl (AT) sss (DOT) pgh.pa.us]=20
Sent: 29 August 2005 21:12
To: Dave Page
Cc: Magnus Hagander; pgsql-bugs (AT) postgresql (DOT) org
Subject: Re: [BUGS] CVS Head: Pg_ctl bug?=20
=20
"Dave Page" <dpage (AT) vale-housing (DOT) co.uk> writes:
In some cases it writes to the eventlog instead of stderr.=20
=20
Yes, this is what's happening. Odd though, considering that I have:
#log_destination =3D 'stderr'
In my out-of-the-box config.
=20
pg_ctl doesn't read the config file, though. Probably we need to
make write_stderr aware that it's running in an interactive program
rather than in the postmaster, and never use the eventlog in=20
this context.
Which makes sense given that the entire problem is that it doesn't know
where to find the config file!

/D

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match


Reply With Quote
  #9  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] CVS Head: Pg_ctl bug? - 08-29-2005 , 03:35 PM



"Magnus Hagander" <mha (AT) sollentuna (DOT) net> writes:
Quote:
Though I don't see any of this code changing lately, so I don't see why
it's failing now. Are you running it under some kind of different
environment than you used to?
Well, are we sure that it was working for Dave before? Maybe it's a
long-standing problem. If you didn't happen to mistype a command you'd
not know it wasn't working.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings


Reply With Quote
  #10  
Old   
Dave Page
 
Posts: n/a

Default Re: [BUGS] CVS Head: Pg_ctl bug? - 08-29-2005 , 03:47 PM



=20

Quote:
-----Original Message-----
From: Magnus Hagander [mailto:mha (AT) sollentuna (DOT) net]=20
Sent: 29 August 2005 21:13
To: Dave Page; Tom Lane
Cc: pgsql-bugs (AT) postgresql (DOT) org
Subject: RE: [BUGS] CVS Head: Pg_ctl bug?=20
=20
Though I don't see any of this code changing lately, so I=20
don't see why
it's failing now. Are you running it under some kind of different
environment than you used to? Any other ideas on why it would=20
claim your
console is not a tty?
The only change is a new install of msys a month or so back, so nothing
major ;-). I can't think of anything that /should/ have changed that
behaviour.

Regards, Dave

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.