DEFAULT_STATISTICS_TARGET

Started by John D. Burgeralmost 20 years ago4 messagesgeneral
Jump to latest
#1John D. Burger
john@mitre.org

Is there any way to set DEFAULT_STATISTICS_TARGET on a permanent basis
for a particular database? SET DEFAULT_STATISTICS_TARGET is only per
session, apparently, and I'm not sure I want to set it for the whole
cluster in the config file. I know I can fix it per-column with ALTER
TABLE, but that's a bit of a pain.

I'm running 7.4. Thanks for any info.

- John D. Burger
MITRE

#2Michael Fuhr
mike@fuhr.org
In reply to: John D. Burger (#1)
Re: DEFAULT_STATISTICS_TARGET

On Wed, Jun 14, 2006 at 06:21:35PM -0400, John D. Burger wrote:

Is there any way to set DEFAULT_STATISTICS_TARGET on a permanent basis
for a particular database?

You can use ALTER DATABASE. New sessions will get the new value;
you'll need to reconnect to see the effect.

http://www.postgresql.org/docs/7.4/interactive/sql-alterdatabase.html

--
Michael Fuhr

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: John D. Burger (#1)
Re: DEFAULT_STATISTICS_TARGET

"John D. Burger" <john@mitre.org> writes:

Is there any way to set DEFAULT_STATISTICS_TARGET on a permanent basis
for a particular database? SET DEFAULT_STATISTICS_TARGET is only per
session, apparently, and I'm not sure I want to set it for the whole
cluster in the config file. I know I can fix it per-column with ALTER
TABLE, but that's a bit of a pain.
I'm running 7.4. Thanks for any info.

ALTER DATABASE SET, same as most other GUC variables ...

regards, tom lane

#4John D. Burger
john@mitre.org
In reply to: Michael Fuhr (#2)
Re: DEFAULT_STATISTICS_TARGET

You can use ALTER DATABASE.

Argh! I somehow missed that despite reading the Run-time Configuration
section three times ... Thanks, folks!

- John D. Burger
MITRE