Re: select statement against pg_stats returns inconsistent data

From: Shelby Cain <alyandon(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: select statement against pg_stats returns inconsistent data
Date: 2004-02-26 04:18:59
Message-ID: 20040226041859.97252.qmail@web41602.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers


--- Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Hoo, I'm surprised no one noticed this during 7.4
> development/testing.
> The problem applies for any datatype that requires
> double alignment,
> which includes int8, float8, and timestamp as well
> as most of the
> geometric types. pg_statistic is declared as using
> type "anyarray",
> and this type really needs to be marked as requiring
> double alignment
> so that arrays of double-aligned datatypes will come
> out correctly.
>
> The correct source fix is a one-line change in
> pg_type.h, but this will
> not propagate into existing databases without an
> initdb. It looks like
> what you'd need to do to fix an existing database is
>
> -- clear out broken data in pg_statistic
> DELETE FROM pg_statistic;
> -- this should update 1 row:
> UPDATE pg_type SET typalign = 'd' WHERE oid = 2277;
> -- this should update 6 rows:
> UPDATE pg_attribute SET attalign = 'd' WHERE
> atttypid = 2277;
> -- might be a good idea to start a fresh backend at
> this point
> -- repopulate pg_statistic
> ANALYZE;
>
> Ugh :-(
>
> regards, tom lane

Works for me. Thanks!

__________________________________
Do you Yahoo!?
Get better spam protection with Yahoo! Mail.
http://antispam.yahoo.com/tools

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joe Conway 2004-02-26 04:20:34 Re: key = currval('tab_key_seq') choses SEQSCAN?!
Previous Message Eric B.Ridge 2004-02-26 02:29:33 Re: key = currval('tab_key_seq') choses SEQSCAN?!

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-02-26 04:46:03 Re: CVS HEAD compile warning
Previous Message Philip Warner 2004-02-26 03:43:01 Re: bgwriter never dies