Arrays of domains

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: Arrays of domains
Date: 2017-07-11 16:44:33
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Over in
there's a gripe about array_agg() not working for a domain type.
It fails because we don't create an array type over a domain type,
so the parser can't identify a suitable output type for the polymorphic

We could imagine tweaking the polymorphic-function resolution rules
so that a domain matched to ANYELEMENT is smashed to its base type,
allowing ANYARRAY to be resolved as the base type's array type.
While that would be a pretty localized fix, it seems like a kluge
to me.

Probably a better answer is to start supporting arrays over domain
types. That was left unimplemented in the original domains patch,
but AFAICS not for any better reason than lack of round tuits.
I did find an argument here:
that the SQL spec forbids domains over arrays, but that's the opposite
case (and a restriction we long since ignored, anyway).

Can anyone think of a reason not to pursue that?

regards, tom lane


Browse pgsql-hackers by date

  From Date Subject
Next Message Claudio Freire 2017-07-11 16:51:03 Fwd: Vacuum: allow usage of more than 1GB of work mem
Previous Message Shubham Barai 2017-07-11 13:40:08 GSoC 2017: weekly progress reports (week 6)