Re: preserving statistics settings - Mailing list pgsql-hackers

From Tom Lane
Subject Re: preserving statistics settings
Date
Msg-id 13879.1027099709@sss.pgh.pa.us
Whole thread Raw
In response to Re: preserving statistics settings  (nconway@klamath.dyndns.org (Neil Conway))
Responses Re: preserving statistics settings  (nconway@klamath.dyndns.org (Neil Conway))
List pgsql-hackers
nconway@klamath.dyndns.org (Neil Conway) writes:
> Hmmm... we could allow SET STATISTICS to take 'DEFAULT' easily enough
> (and that might even be a good idea in any case), but you're right --
> without a way for pg_dump to determine the default value and/or whether
> the admin have explicitely changed the attstattarget for that column,
> there's not much that can be done...

> I suppose we could hard-code the current default value into pg_dump,
> but that's pretty ugly.

Also, there's no guarantee that pg_dump would know what default the
backend had been compiled with, so it might make the wrong conclusion
anyway.

> Does anyone have a better suggestion?

Not sure why I didn't think of this before, but we could make the stored
value of attstattarget be "-1" to indicate "use the default".  Zero or a
positive value then indicates an explicit selection.  We can't
retroactively fix 7.2, but going forward we'd have a reasonable answer.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Barry Lind
Date:
Subject: Re: heap_delete, heap_mark4update must reset t_ctid
Next
From: Alessandro Baretta
Date:
Subject: Arrays and FFTW