Thread: set permanent date style
hi, I just install postgres 7.2.1 and start the server using the start up script provided in contrib/start-scripts/linux. Now I want my date style to automatically change to European every time the postgres server is started. How can I do it? Thanks, Martin _________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com
On Sat, Jun 15, 2002 at 03:42:00AM +0000, Martin Teoh wrote: > I just install postgres 7.2.1 and start the server using the start up script > provided in contrib/start-scripts/linux. Now I want my date style to > automatically change to European every time the postgres server is started. > How can I do it? add -o \"-o -e\" to the arguments of pg_ctl in the inits-cript. (at least with the RH init-script). Alternatively you can set an enviroment-variable before starting the deamon. -- Ragnar Kjørstad Big Storage
Martin- in postmaster.conf, add a line that looks something like this: PGDATESTYLE=ISO,European (or SQL,European or POSTGRES,European or GERMAN,European) Regards, -Nick -------------------------------------------------------------------------- Nick Fankhauser nickf@ontko.com Phone 1.765.935.4283 Fax 1.765.962.9788 Ray Ontko & Co. Software Consulting Services http://www.ontko.com/ > -----Original Message----- > From: pgsql-admin-owner@postgresql.org > [mailto:pgsql-admin-owner@postgresql.org]On Behalf Of Martin Teoh > Sent: Friday, June 14, 2002 10:42 PM > To: pgsql-admin@postgresql.org > Subject: [ADMIN] set permanent date style > > > hi, > > I just install postgres 7.2.1 and start the server using the > start up script > provided in contrib/start-scripts/linux. Now I want my date style to > automatically change to European every time the postgres server > is started. > How can I do it? > > Thanks, > Martin > > _________________________________________________________________ > Chat with friends online, try MSN Messenger: http://messenger.msn.com > > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly >
"Nick Fankhauser" <nickf@ontko.com> writes: > in postmaster.conf, add a line that looks something like this: > PGDATESTYLE=ISO,European I do not believe that will work in any released version. It will work to set PGDATESTYLE as an environment variable in the postmaster's environment, however. As of 7.3 it will be possible to set DateStyle in postgresql.conf, but up through 7.2 DateStyle is specially handled and isn't in the set of variables that postgresql.conf knows about :-( For the particular problem at hand, adding -e to the postmaster's command line switches might have been enough ... regards, tom lane
Hmmm... I'm confused. It works for us. When I make this change in postmaster.conf for our v7.2 install, it has the desired effect. Perhaps this file is specific to the Debian package. Is postmaster.conf generally used in all distributions? Here is the documentation I found in that file: # How (by default) to present dates to the frontend; the user can override # this setting for his own session. The choices are: # Style Date Datetime # ---------------------------------------------------------------- # ISO 1999-07-17 1999-07-17 07:09:18+01 # SQL 17/07/1999 17/07/1999 07:09:19.00 BST # POSTGRES 17-07-1999 Sat 17 Jul 07:09:19 1999 BST # GERMAN 17.07.1999 17.07.1999 07:09:19.00 BST # # It is also possible to specify month-day or day-month ordering in date # input and output. Americans tend to use month-day; Europeans use # day-month. Specify European or nonEuropean. Separate the two parameters # by a comma with no spaces PGDATESTYLE=SQL,nonEuropean -Nick > -----Original Message----- > From: Tom Lane [mailto:tgl@sss.pgh.pa.us] > Sent: Tuesday, June 18, 2002 8:39 AM > To: nickf@ontko.com > Cc: Martin Teoh; pgsql-admin@postgresql.org > Subject: Re: [ADMIN] set permanent date style > > > "Nick Fankhauser" <nickf@ontko.com> writes: > > in postmaster.conf, add a line that looks something like this: > > PGDATESTYLE=ISO,European > > I do not believe that will work in any released version. It will work > to set PGDATESTYLE as an environment variable in the postmaster's > environment, however. > > As of 7.3 it will be possible to set DateStyle in postgresql.conf, > but up through 7.2 DateStyle is specially handled and isn't in the > set of variables that postgresql.conf knows about :-( > > For the particular problem at hand, adding -e to the postmaster's > command line switches might have been enough ... > > regards, tom lane >
"Nick Fankhauser" <nickf@ontko.com> writes: > Hmmm... I'm confused. It works for us. When I make this change in > postmaster.conf for our v7.2 install, it has the desired effect. I'm sorry, I thought that was a thinko for postgresql.conf. Evidently not --- it must be a file that sets up environment variables for the postmaster. > Perhaps this file is specific to the Debian package. It's certainly not part of the standard source distribution, but it might be in the standard RPM package. regards, tom lane
On Tue, 2002-06-18 at 15:26, Tom Lane wrote: > "Nick Fankhauser" <nickf@ontko.com> writes: > > Hmmm... I'm confused. It works for us. When I make this change in > > postmaster.conf for our v7.2 install, it has the desired effect. > > I'm sorry, I thought that was a thinko for postgresql.conf. Evidently > not --- it must be a file that sets up environment variables for the > postmaster. That is correct; it sets PGDATESTYLE, PGDATA (indirectly), the logfile, and offers the chance to send any special options to pg_ctl. > > Perhaps this file is specific to the Debian package. Probably. -- Oliver Elphick Oliver.Elphick@lfix.co.uk Isle of Wight http://www.lfix.co.uk/oliver GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C "Jesus said unto her, I am the resurrection, and the life; he that believeth in me, though he were dead, yet shall he live." John 11:25