Re: [HACKERS] user-defined numeric data types triggering ERROR:unsupported type - Mailing list pgsql-hackers

From Tomas Vondra
Subject Re: [HACKERS] user-defined numeric data types triggering ERROR:unsupported type
Date
Msg-id b5cede7b-354b-83e6-ab1f-7a1bf8a232fa@2ndquadrant.com
Whole thread Raw
In response to Re: [HACKERS] user-defined numeric data types triggering ERROR:unsupported type  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Responses Re: [HACKERS] user-defined numeric data types triggering ERROR: unsupported type  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi,

Here is v2 of the fix. It does handle all the convert_to_scalar calls
for various data types, just like the numeric one did in v1 with the
exception of bytea.

The bytea case is fixed by checking that the boundary values are
varlenas. This seems better than checking for BYTEAOID explicitly, which
would fail for custom varlena-based types. At first I've been thinking
there might be issues when the data types has mismatching ordering, but
I don't think the patch makes it any worse.

I've also added a bunch of regression tests, checking each case. The
bytea test it should cause segfault on master, of course.

regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment

pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: perltidy version
Next
From: Arthur Zakirov
Date:
Subject: Re: pg_get_functiondef forgets about most GUC_LIST_INPUT GUCs