Re: extend VacAttrStats to allow stavalues of different types - Mailing list pgsql-patches

From Tom Lane
Subject Re: extend VacAttrStats to allow stavalues of different types
Date
Msg-id 18320.1212417449@sss.pgh.pa.us
Whole thread Raw
In response to Re: extend VacAttrStats to allow stavalues of different types  ("Heikki Linnakangas" <heikki@enterprisedb.com>)
Responses Re: extend VacAttrStats to allow stavalues of different types  (Jan Urbański <j.urbanski@students.mimuw.edu.pl>)
List pgsql-patches
"Heikki Linnakangas" <heikki@enterprisedb.com> writes:
> Jan Urbański wrote:
>> +      * XXX or maybe fall back on attrtype-> stuff when these are NULL? That way
>> +      * we won't break other people's custom typanalyze functions. Not sure if
>> +      * any exist, though.

> I tried to google for a user defined data type with a custom typanalyze
> function but didn't find anything, so I don't think it's an issue.

Oh, it absolutely is an issue.  PostGIS has them, if no one else does.

I think the correct solution is to initialize the fields to match the
column type before calling the typanalyze function.  Then you don't
break compatibility for existing typanalyze functions.  It's also less
code, since the standard typanalyze functions can rely on those preset
values.

            regards, tom lane

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: Feature: give pg_dump a WHERE clause expression
Next
From: Jan Urbański
Date:
Subject: Re: extend VacAttrStats to allow stavalues of different types