| From: | konstantin knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru> |
|---|---|
| To: | Thom Brown <thom(at)linux(dot)com> |
| Cc: | PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: array of domain types |
| Date: | 2016-06-02 10:40:45 |
| Message-ID: | 84CCCA35-FD4F-45C5-BF94-71184E4DF1CF@postgrespro.ru |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Jun 2, 2016, at 12:29 PM, Thom Brown wrote:
> On 2 June 2016 at 10:13, konstantin knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru> wrote:
>
> Yes, it doesn't work:
>
> # CREATE DOMAIN teenager AS int CHECK (VALUE BETWEEN 13 AND 19);
> CREATE DOMAIN
>
> # SELECT 14::teenager;
> teenager
> ----------
> 14
> (1 row)
>
> # SELECT 20::teenager;
> ERROR: value for domain teenager violates check constraint "teenager_check"
>
> # SELECT '{14,20}'::teenager[];
> teenager
> ----------
> {14,20}
> (1 row)
>
> That last one should fail.
Yes, I see.
This approach was wrong.
Attached please find patch for DefineDomain function.
>
> Thom
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Антон Бушмелев | 2016-06-02 11:18:26 | Re: 9.4 -> 9.5 regression with queries through pgbouncer on RHEL 6 |
| Previous Message | Thom Brown | 2016-06-02 09:29:28 | Re: array of domain types |