Thread: US Date Style
Note: I sent this to the pgsql-general list from another account yesterday, but it hasn't been answered. My apologies if you see it twice. On the other hand, I have taken some time to proofread a bit, so perhaps the punctuation won't be quite as bad. I recently upgraded the PostgreSQL database on one of my Debian Linux boxes to postgresql-7.0-0.beta3-1 in preparation for the grand switchover to version 7.0. So far I am quite impressed, but I have had a little bit of a problem setting the PGDATESTYLE correctly. For historical reasons I would like to continue using the US datestyle (eg. Sat Jan 01 07:09:19 2000 MDT). I have tried setting the variable in /etc/postgresql/postmaster.init and no joy. I have also tried to set the value of PGDATESTYLE manually in psql using: processdata=>\set PGDATESTYLE US When I do this I am able to then check the variables that are set and I get: processdata=> \set VERSION = 'PostgreSQL 7.0.0 on i686-pc-linux-gnu, compiled by gcc 2.95.2' DBNAME = 'processdata' USER = 'earlj' HOST = 'nampadata' PORT = '5432' ENCODING = 'SQL_ASCII' PROMPT1 = '%/%R%# ' PROMPT2 = '%/%R%# ' PROMPT3 = '>> ' HISTSIZE = '500' PGDATESTYLE = 'US' Unfortunately, when I test it out: processdata=> select 'now'::datetime; ?column? ------------------------2000-04-19 14:09:06-06 (1 row) I still get the ISO format. So what do I need to do to get my US datestyle back? Sorry to bother, Jason Earl __________________________________________________ Do You Yahoo!? Send online invitations with Yahoo! Invites. http://invites.yahoo.com
With a little bit of grepping through the docs I have found something that will mostly work for me. I simply need to have each client issue a: SET DATESTYLE TO 'Postgres'; This works just fine, but (of course) I would rather have this set up as the 'default.' Does anyone know how to do this? Thanks again, Jason --- Jason Earl <jdearl@yahoo.com> wrote: > Note: I sent this to the pgsql-general list from > another account > yesterday, but it hasn't been answered. My > apologies > if you see it > twice. On the other hand, I have taken some time to > proofread a bit, > so perhaps the punctuation won't be quite as bad. > > I recently upgraded the PostgreSQL database on one > of > my Debian Linux > boxes to postgresql-7.0-0.beta3-1 in preparation for > the grand > switchover to version 7.0. So far I am quite > impressed, but I have > had a little bit of a problem setting the > PGDATESTYLE > correctly. For > historical reasons I would like to continue using > the > US datestyle > (eg. Sat Jan 01 07:09:19 2000 MDT). > > I have tried setting the variable in > /etc/postgresql/postmaster.init > and no joy. I have also tried to set the value of > PGDATESTYLE > manually in psql using: > > processdata=>\set PGDATESTYLE US > > When I do this I am able to then check the variables > that are set and > I get: > > processdata=> \set > VERSION = 'PostgreSQL 7.0.0 on i686-pc-linux-gnu, > compiled by gcc 2.95.2' > DBNAME = 'processdata' > USER = 'earlj' > HOST = 'nampadata' > PORT = '5432' > ENCODING = 'SQL_ASCII' > PROMPT1 = '%/%R%# ' > PROMPT2 = '%/%R%# ' > PROMPT3 = '>> ' > HISTSIZE = '500' > PGDATESTYLE = 'US' > > Unfortunately, when I test it out: > > processdata=> select 'now'::datetime; > ?column? > ------------------------ > 2000-04-19 14:09:06-06 > (1 row) > > I still get the ISO format. So what do I need to do > to get my US > datestyle back? > > Sorry to bother, > Jason Earl > > > __________________________________________________ > Do You Yahoo!? > Send online invitations with Yahoo! Invites. > http://invites.yahoo.com > __________________________________________________ Do You Yahoo!? Send online invitations with Yahoo! Invites. http://invites.yahoo.com
Thanks to <web Manager> and the PostgreSQL docs I have found out what I was doing wrong. Actually the fix was so dead simple that I am more than a little embarrased to share. But here goes... The Debian package of PostgreSQL has a nifty configuration file /etc/postgresql/postmaster.init . Basically this file let's you customize just about any PostgreSQL parameter that is configurable at run time and worth fiddling with. I read the config file and decided that setting: PGDATESTYLE=US Should do what I needed. Unfortunately what I actually wanted was: PGDATESTYLE=POSTGRES Thanks to web@inter-resa.com, and special thanks to the PostgreSQL team for their continued efforts. 7.0 Rocks, Jason Earl --- Jason Earl <jdearl@yahoo.com> wrote: > With a little bit of grepping through the docs I > have > found something that will mostly work for me. I > simply need to have each client issue a: > > SET DATESTYLE TO 'Postgres'; > > This works just fine, but (of course) I would rather > have this set up as the 'default.' Does anyone know > how to do this? > > Thanks again, > Jason > > --- Jason Earl <jdearl@yahoo.com> wrote: > > Note: I sent this to the pgsql-general list from > > another account > > yesterday, but it hasn't been answered. My > > apologies > > if you see it > > twice. On the other hand, I have taken some time > to > > proofread a bit, > > so perhaps the punctuation won't be quite as bad. > > > > I recently upgraded the PostgreSQL database on one > > of > > my Debian Linux > > boxes to postgresql-7.0-0.beta3-1 in preparation > for > > the grand > > switchover to version 7.0. So far I am quite > > impressed, but I have > > had a little bit of a problem setting the > > PGDATESTYLE > > correctly. For > > historical reasons I would like to continue using > > the > > US datestyle > > (eg. Sat Jan 01 07:09:19 2000 MDT). > > > > I have tried setting the variable in > > /etc/postgresql/postmaster.init > > and no joy. I have also tried to set the value of > > PGDATESTYLE > > manually in psql using: > > > > processdata=>\set PGDATESTYLE US > > > > When I do this I am able to then check the > variables > > that are set and > > I get: > > > > processdata=> \set > > VERSION = 'PostgreSQL 7.0.0 on i686-pc-linux-gnu, > > compiled by gcc 2.95.2' > > DBNAME = 'processdata' > > USER = 'earlj' > > HOST = 'nampadata' > > PORT = '5432' > > ENCODING = 'SQL_ASCII' > > PROMPT1 = '%/%R%# ' > > PROMPT2 = '%/%R%# ' > > PROMPT3 = '>> ' > > HISTSIZE = '500' > > PGDATESTYLE = 'US' > > > > Unfortunately, when I test it out: > > > > processdata=> select 'now'::datetime; > > ?column? > > ------------------------ > > 2000-04-19 14:09:06-06 > > (1 row) > > > > I still get the ISO format. So what do I need to > do > > to get my US > > datestyle back? > > > > Sorry to bother, > > Jason Earl > > > > > > __________________________________________________ > > Do You Yahoo!? > > Send online invitations with Yahoo! Invites. > > http://invites.yahoo.com > > > > __________________________________________________ > Do You Yahoo!? > Send online invitations with Yahoo! Invites. > http://invites.yahoo.com > __________________________________________________ Do You Yahoo!? Send online invitations with Yahoo! Invites. http://invites.yahoo.com
Jason Earl <jdearl@yahoo.com> writes: > With a little bit of grepping through the docs I have > found something that will mostly work for me. I > simply need to have each client issue a: > SET DATESTYLE TO 'Postgres'; > This works just fine, but (of course) I would rather > have this set up as the 'default.' Does anyone know > how to do this? PGDATESTYLE (note spelling) as an environment variable in the environment of either the postmaster or the client application will do it. If you start the postmaster with that in its environment, it becomes the default setting for all backends in that installation. If you start a (libpq-based) client with that in its environment, libpq will issue the SET DATESTYLE command for you during connection startup. regards, tom lane
I see on the ftp site that 7.0rc1 is up there now. Is this the last before the final 7.0, or is this the final 7.0? Either way, when can we expect rpm's of the final 7.0? Thanks, Daniel Spratlen spratlen@arches.uga.edu
> I see on the ftp site that 7.0rc1 is up there now. Is this the last > before the final 7.0, or is this the final 7.0? > Either way, when can we expect rpm's of the final 7.0? It is just a candidate. We will see if it the same as the final. -- Bruce Momjian | http://www.op.net/~candle pgman@candle.pha.pa.us | (610) 853-3000+ If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania19026
Bruce Momjian <pgman@candle.pha.pa.us> writes: >> I see on the ftp site that 7.0rc1 is up there now. Is this the last >> before the final 7.0, or is this the final 7.0? >> Either way, when can we expect rpm's of the final 7.0? > It is just a candidate. We will see if it the same as the final. It's already known not to be the final ;-) Current schedule is to go final on May 1. In the meantime, keep those beta-test reports coming... otherwise 7.0 won't be any better than rc1... regards, tom lane
> > I see on the ftp site that 7.0rc1 is up there now. Is this the last > > before the final 7.0, or is this the final 7.0? > > Either way, when can we expect rpm's of the final 7.0? > > It is just a candidate. We will see if it the same as the final. Already outdated, Tom fixed the bug about count(*) from views (thanks again). Jan -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #========================================= wieck@debis.com (Jan Wieck) #