PL/Python: domain over array support

From: Rodolfo Campero <rodolfo(dot)campero(at)anachronics(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: PL/Python: domain over array support
Date: 2013-10-26 13:17:19
Message-ID: CAHNrXgHnnGMuh1V_dSzrRrz7upD3R-xc5d+eHXai=a8NWoFNkQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The attached patch add support of domains over arrays to PL/Python (eg:
CREATE DOMAIN my_domain AS integer[]).

Basically it just uses get_base_element_type instead of get_element_type
in plpy_typeio.c, and uses domain_check before returning a sequence as
array in PLySequence_ToArray whenever appropriate.

There's one line I'm not sure about; I modified a switch statement (line
427):
switch (element_type ? element_type : getBaseType(arg->typoid))
The rationale is that when element_type is set, it is already a base type,
because there is no support of arrays of domains in PostgreSQL, but this
may not held true in the future.

Regards,
Rodolfo

Attachment Content-Type Size
plpython_domain_over_array_v1.patch application/octet-stream 4.8 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2013-10-26 14:04:29 Re: Changes to stringinfo.c
Previous Message Amit Kapila 2013-10-26 08:18:12 Re: Pattern matching operators a index