By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,358 Members | 1,292 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,358 IT Pros & Developers. It's quick & easy.

setting datestyle for different databases within a cluster

P: n/a
Boy, I'm just full of questions today ...

Is there a way to provide different persistent settings for DateStyle for
different databases within the same cluster?

Simply put, I've got two databases and I'd like to have 2 different DateStyles,
and I'd like to have it so I don't have to set the DateStyle at the beginning
of each session. Looking through the docs:
1) I don't want to use SET DATESTYLE because I can't guarantee that each app
that connects will set it since I can't control them all.
2) I can't use the postgresql.conf file, because that forces me to use the
same DateStyle for each database within a cluster.
3) I can't use the environment variable for the same reason as #1, in addition
to the fact that many of these apps may access through ODBC.
4) I tried, experimentally, to set DateStyle in the pg_settings table, but it
seems to work some magic that the setting is set back to the config file
default at the end of a session (bummer).

Any suggestions?

--
Bill Moran
Potential Technologies
http://www.potentialtech.com
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #1
Share this Question
Share on Google+
2 Replies

P: n/a
Bill Moran <wm****@potentialtech.com> writes:
Is there a way to provide different persistent settings for DateStyle for
different databases within the same cluster?


See ALTER DATABASE ... SET ...

(There's also ALTER USER ... SET if a per-user setting would work
better.)

regards, tom lane

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

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #2

P: n/a
Tom Lane wrote:
Bill Moran <wm****@potentialtech.com> writes:
Is there a way to provide different persistent settings for DateStyle for
different databases within the same cluster?


See ALTER DATABASE ... SET ...

(There's also ALTER USER ... SET if a per-user setting would work
better.)


Thanks, Tom. That's exactly what I needed!

--
Bill Moran
Potential Technologies
http://www.potentialtech.com
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.