Re: [HACKERS] array of domain types

2016-06-03 Thread Jim Nasby
On 6/3/16 11:50 AM, Konstantin Knizhnik wrote: Originally I was mostly interested in domains as kind of typedefs: convenient way to assign type to some particular kind of columns, for example object reference used in ORM. There are two main goals of using domain here: 1. Be able to easily change

Re: [HACKERS] array of domain types

2016-06-03 Thread Konstantin Knizhnik
On 03.06.2016 02:02, Rod Taylor wrote: On Thu, Jun 2, 2016 at 10:42 AM, Konstantin Knizhnik mailto:k.knizh...@postgrespro.ru>> wrote: On 02.06.2016 17:22, Tom Lane wrote: konstantin knizhnik mailto:k.knizh...@postgrespro.ru>> writes: Attached please find patch for D

Re: [HACKERS] array of domain types

2016-06-02 Thread Rod Taylor
On Thu, Jun 2, 2016 at 10:42 AM, Konstantin Knizhnik < k.knizh...@postgrespro.ru> wrote: > On 02.06.2016 17:22, Tom Lane wrote: > >> konstantin knizhnik writes: >> >>> Attached please find patch for DefineDomain function. >>> >> You didn't attach the patch, >> > > Sorry, but I did attached the pa

Re: [HACKERS] array of domain types

2016-06-02 Thread Konstantin Knizhnik
On 02.06.2016 17:22, Tom Lane wrote: konstantin knizhnik writes: Attached please find patch for DefineDomain function. You didn't attach the patch, Sorry, but I did attached the patch - I see the attachment in my mail received from the group. Multidimensional arrays work fine: knizhnik=#

Re: [HACKERS] array of domain types

2016-06-02 Thread Tom Lane
konstantin knizhnik writes: > Attached please find patch for DefineDomain function. You didn't attach the patch, but in any case, I would be astonished if there is no work required beyond creating the matching array type. The reverse case (domains over arrays) has half a dozen special cases requi

Re: [HACKERS] array of domain types

2016-06-02 Thread konstantin knizhnik
On Jun 2, 2016, at 12:29 PM, Thom Brown wrote:On 2 June 2016 at 10:13, konstantin knizhnik 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::teena

Re: [HACKERS] array of domain types

2016-06-02 Thread Thom Brown
On 2 June 2016 at 10:13, konstantin knizhnik wrote: > > On Jun 1, 2016, at 4:37 PM, Thom Brown wrote: > > On 1 June 2016 at 14:20, Konstantin Knizhnik > wrote: > >> I wonder why domain types can not be used for specification of array >> element: >> >> create domain objref as bigint; >> create ta

Re: [HACKERS] array of domain types

2016-06-02 Thread konstantin knizhnik
On Jun 1, 2016, at 4:37 PM, Thom Brown wrote: > On 1 June 2016 at 14:20, Konstantin Knizhnik > wrote: > I wonder why domain types can not be used for specification of array element: > > create domain objref as bigint; > create table foo(x objref[]); > ERROR: type "objref[]" does not exist > c

Re: [HACKERS] array of domain types

2016-06-01 Thread Thom Brown
On 1 June 2016 at 14:20, Konstantin Knizhnik wrote: > I wonder why domain types can not be used for specification of array > element: > > create domain objref as bigint; > create table foo(x objref[]); > ERROR: type "objref[]" does not exist > create table foo(x bigint[]); > CREATE TABLE > > Is

[HACKERS] array of domain types

2016-06-01 Thread Konstantin Knizhnik
I wonder why domain types can not be used for specification of array element: create domain objref as bigint; create table foo(x objref[]); ERROR: type "objref[]" does not exist create table foo(x bigint[]); CREATE TABLE Is there some principle problem here or it is just not implemented? -- K