pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
how do I set DateStyle = European in postmaster ?
6+ messages / 3 participants
[nested] [flat]

* how do I set DateStyle = European in postmaster ?
@ 2000-07-05 06:45 Michael Holopainen <michael@laserle.fi>
  2000-07-06 18:13 ` Re: how do I set DateStyle = European in postmaster ? Anthony E. Greene <agreene@pobox.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Michael Holopainen @ 2000-07-05 06:45 UTC (permalink / raw)
  To: ; +Cc: pgsql-admin

How do I set datestyle to European in server end ?

I tried running postmaster with "-oe" as instructed in one email, but it
resulted as error it did not accept -oe. 
for moment I all connections set datestyle = European, but it's not
enough. 

please, help!!!!1

-michael (A)  

Len Morgan wrote:
> 
> On a couple of my installations, I've noticed that after a few days there
> are several "dead" postmasters (i.e., not associated with any running
> backend).  When I do a ps -ax (RedHat 6.1, Postgresql 6.5.3) I see:
> 
> ...
> [postmaster]
> [postmaster]
> [postmaster]
> [postmaster]
> [postmaster]
> [postmaster]
> ...
> and several
> 
> /usr/bin/postgres ..... lines
> 
> The problem is that there are more [postmaster] lines (sometimes 4 or 5
> times as many) as there are /usr/bin/postgres lines.
> 
> When I do a kill -TERM pid on all of the [postmaster] pids or restart the
> postmaster, the system gets much faster.  The problem is I also cut of
> "live" connections in the process.  My question is: Is there any way I can
> determine which of the [postmaster] entries are associated with which
> /usr/bin/postgres entries?
> 
> Thank you!
> 
> Len Morgan

-- 
   --"Would you fly on airplane controlled by MS Windows ?"--
--------------------------------------------------------------------
| Michael Holopainen | Valuraudantie 25 | Tel: +358-(0)9-35093825  |
|                    | 00700 Helsinki   | Fax : +358-(0)9-35093850 |
| Laserle Oy         | Finland          | email: michael@laserle.fi|
--------------------------------------------------------------------



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: how do I set DateStyle = European in postmaster ?
  2000-07-05 06:45 how do I set DateStyle = European in postmaster ? Michael Holopainen <michael@laserle.fi>
@ 2000-07-06 18:13 ` Anthony E. Greene <agreene@pobox.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Anthony E. Greene @ 2000-07-06 18:13 UTC (permalink / raw)
  To: pgsql-admin

Michael Holopainen wrote:
> 
> How do I set datestyle to European in server end ?
> 
> I tried running postmaster with "-oe" as instructed in one email, but it
> resulted as error it did not accept -oe.
> for moment I all connections set datestyle = European, but it's not
> enough.

This can be set in an environment variable in the same script that
starts the postmaster. The name of the varible is in the docs.

-- 
Anthony E. Greene <agreene@pobox.com> <http://www.pobox.com/~agreene/;
PGP Key: 0x6C94239D/7B3D BD7D 7D91 1B44 BA26  C484 A42A 60DD 6C94 239D
Linux. The choice of a GNU Generation. <http://www.linux.org/;



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* RE: how do I set DateStyle = European in postmaster ?
@ 2000-07-06 14:05 Gary Stainburn <gary.stainburn@ringways.co.uk>
  0 siblings, 0 replies; 6+ messages in thread

From: Gary Stainburn @ 2000-07-06 14:05 UTC (permalink / raw)
  To: 'Michael Holopainen' <michael@laserle.fi>; +Cc: pgsql-admin


-----Original Message-----
From:	Michael Holopainen [SMTP:michael@laserle.fi]
Sent:	Wednesday, July 05, 2000 7:46 AM
Cc:	pgsql-admin@postgresql.org
Subject:	[ADMIN] how do I set DateStyle = European in postmaster ? 

>How do I set datestyle to European in server end ?
>
>I tried running postmaster with "-oe" as instructed in one email, but it
>resulted as error it did not accept -oe. 
>for moment I all connections set datestyle = European, but it's not
>enough. 

Use '-o -e' 

the '-o' tells the postmaster to pass whatever is next ('-e') to the back end process.

-----------------------------------------
Gary Stainburn.
Work: http://www.ringways.co.uk mailto:gary.stainburn@ringways.co.uk
REVCOM: http://www.revcom.org.uk mailto:gary.stainburn@revcom.org.uk
-----------------------------------------
Murphy's Laws: (326) If it jams - force it. If it breaks, it needed replacing anyway.
-----------------------------------------




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* RE: how do I set DateStyle = European in postmaster ?
@ 2000-07-07 08:53 Gary Stainburn <gary.stainburn@ringways.co.uk>
  0 siblings, 0 replies; 6+ messages in thread

From: Gary Stainburn @ 2000-07-07 08:53 UTC (permalink / raw)
  To: 'Michael Holopainen' <michael@laserle.fi>; +Cc: pgsql-admin

-----Original Message-----
From:	Michael Holopainen [SMTP:michael@laserle.fi]
Sent:	Friday, July 07, 2000 7:27 AM
To:	Gary Stainburn
Subject:	Re: [ADMIN] how do I set DateStyle = European in postmaster ?

>Thank you for your help, but 
>what is correct postmaster options syntax in (linux) startup script?
>
>Here are the variations I have seen 
>
>-oe
>-o -e 
>'-o -e'
>-o "-e"
>"-oe"
>
>atleast -oe and -o -e do not work. So I suspect it is -o "-e"  
>Am I correct ? 

Choices 1 and 5 are the same and wrong.
Choices 2 and 4 are the same and right.
Choice 2 is the one that I use.

Most of this formatting is down to the shell and not postmaster, but
what you should be telling postmaster with the '-o' argument is to pass
the next argument '-e' to the backend process.

What happens when you make a connection to the postmaster, either by
starting psql, DBI, pgaccess, odbc connection etc, is that postmaster
forks another process to actually do the work.  That is why you need to
do it like this.

With choice 1, you have just one argument.  With choice 3 you still only
have one argument because you have enclosed it inside quotes.  When the
shell interprets the line it uses spaces to split the arguments up.
Quotes override this behaviour by keeping everything inside them -
including the spaces - as one argument.  
This is why choice 1 = 5 and 2 = 3.

Can you post the script that you use to start the postmaster and I will
have a look at it.  Also, it is always a good idea to Cc: the mailing
list with any follow-ups because you then get other people seeing the
message.

>
>(postgres is in use so, I can't just restart it when I want. So it would
>be good to KNOW excatly what to do, coz when I stop it, I do not have
>time to play with it [I'm sure you know the feeling...
>"can_i_use_the_db_yet, (30 sec later)can_i_use_the_db_yet, etc. "] )

I know exactly what you mean, and to make it worse, I have a 'real-time'
feed from a logger that *expects* it to be there 24x7 and allows very
little latitude - it has enough buffer for a few minutes only, just
about enough time to reboot the PC.

>
>-michael (A)
[snip]

-----------------------------------------
Gary Stainburn.
Work: http://www.ringways.co.uk mailto:gary.stainburn@ringways.co.uk
REVCOM: http://www.revcom.org.uk mailto:gary.stainburn@revcom.org.uk
-----------------------------------------
Murphy's Laws: (326) If it jams - force it. If it breaks, it needed replacing anyway.
-----------------------------------------





^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* RE: how do I set DateStyle = European in postmaster ?
@ 2000-07-07 12:30 Gary Stainburn <gary.stainburn@ringways.co.uk>
  2000-07-07 15:18 ` RE: how do I set DateStyle = European in postmaster ? Anthony E. Greene <agreene@pobox.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Gary Stainburn @ 2000-07-07 12:30 UTC (permalink / raw)
  To: 'Michael Holopainen' <michael@laserle.fi>; +Cc: pgsql-admin

-----Original Message-----
From:	Michael Holopainen [SMTP:michael@laserle.fi]
Sent:	Friday, July 07, 2000 12:22 PM
To:	Gary Stainburn
Subject:	Re: [ADMIN] how do I set DateStyle = European in postmaster ?

>OK, here is the script (the whole postgres script)
>
>--- >8
>#!/bin/sh
>
>case "$1" in
>'start')
>        su - postgres -c "/usr/local/pgsql/bin/pg_ctl -o \"-S -i\"

Okay, you've got me, I've never seen it done that way before.  Every
setup I've ever seen calls postmaster directly.  However, try these two
options and hopefully one of them should do what you want.  If you wish,
you could combine both of them using the belt and braces notion

su - postgres -c "/usr/local/pgsql/bin/pg_ctl -o \"-S -i -e\" start"
or (all 1 line - remove the '\')
su - postgres -c "export lang=en_GB ; /usr/local/pgsql/bin/pg_ctrl \
    -o \"-S -i -e \" start"

It would be tidier to do

su - postgres -c 'export lang=en_GB ; /usr/local/pgsql/bin/pg_ctrl \
    -o "-S -i -e" start'

again as one line.  Using the single quotes for the outside means that
you don't have to escape the inner quotes and makes the line easier to
read.

>start"
>        ;;
>'stop')
>        su - postgres -c "/usr/local/pgsql/bin/pg_ctl stop"
>        ;;
>*)
>        echo "Usage: $0 { start | stop }"
>        ;;
>esac
>exit 0
>--- >8
>
>I didn't do it, I just need to live with it ;).
>It's pg 7.0 & 2.2.14 (suse 6.4) linux.
>
>All suggestions will be greatly appreaciated , also any ideas why
>postgres stops accepting connections from unix port ?
>When I start pg, I can connect to the base with psql OK. but the next
>day it no longer accept connections from the default port and I need to
>pass -h localhost to be able to connect to database.
>(all above is done while logged in as user 'postgres') 
>

Sorry, I can't help here.  Have you looked to see what happens overnight
that could affect it's behaviour as something must be causing it.

>-micahel (A)

-----------------------------------------
Gary Stainburn.
Work: http://www.ringways.co.uk mailto:gary.stainburn@ringways.co.uk
REVCOM: http://www.revcom.org.uk mailto:gary.stainburn@revcom.org.uk
-----------------------------------------
Murphy's Laws: (326) If it jams - force it. If it breaks, it needed replacing anyway.
-----------------------------------------




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* RE: how do I set DateStyle = European in postmaster ?
  2000-07-07 12:30 RE: how do I set DateStyle = European in postmaster ? Gary Stainburn <gary.stainburn@ringways.co.uk>
@ 2000-07-07 15:18 ` Anthony E. Greene <agreene@pobox.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Anthony E. Greene @ 2000-07-07 15:18 UTC (permalink / raw)
  To: pgsql-admin

At 13:30 2000-07-07 +0100, Gary Stainburn wrote:
>-----Original Message-----
>From:	Michael Holopainen [SMTP:michael@laserle.fi]
>Sent:	Friday, July 07, 2000 12:22 PM
>To:	Gary Stainburn
>Subject:	Re: [ADMIN] how do I set DateStyle = European in postmaster ?
>
>>OK, here is the script (the whole postgres script)
[snip]

I set the DateStyle in /etc/profile, which works for ISO, but not for
European. That may have to do with locale settings in the RPM I have
installed.

It's a lot simpler if it works for you. Just put this in /etc/profile:

  export PGDATESTYLE='European'

Since the postmaster script uses "su -l" it gets the environment, including
things setup in /etc/profile (assuming the postgres user's shell is bash).


 Tony
 --
 Anthony E. Greene <agreene@pobox.com>
 PGP Key: 0x6C94239D/7B3D BD7D 7D91 1B44 BA26  C484 A42A 60DD 6C94 239D
 Linux: The choice of a GNU Generation.



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2000-07-07 15:18 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-07-05 06:45 how do I set DateStyle = European in postmaster ? Michael Holopainen <michael@laserle.fi>
2000-07-06 18:13 ` Anthony E. Greene <agreene@pobox.com>
2000-07-06 14:05 RE: how do I set DateStyle = European in postmaster ? Gary Stainburn <gary.stainburn@ringways.co.uk>
2000-07-07 08:53 RE: how do I set DateStyle = European in postmaster ? Gary Stainburn <gary.stainburn@ringways.co.uk>
2000-07-07 12:30 RE: how do I set DateStyle = European in postmaster ? Gary Stainburn <gary.stainburn@ringways.co.uk>
2000-07-07 15:18 ` Anthony E. Greene <agreene@pobox.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox