Re: [GENERAL] Array constructor requires one argument

2007-01-09 Thread Tom Lane
Martijn van Oosterhout writes: > On Tue, Jan 09, 2007 at 04:09:21PM -0500, Tom Lane wrote: >> One possibility that might handle Martijn's problem is to allow the >> construct >> ARRAY[]::type[] > I don't think it would be too hard to fix, I'll look tomorrow. It could be pretty ugly, because type

Re: [GENERAL] Array constructor requires one argument

2007-01-09 Thread Martijn van Oosterhout
On Tue, Jan 09, 2007 at 04:09:21PM -0500, Tom Lane wrote: > Joe Conway <[EMAIL PROTECTED]> writes: > > Unless we can convince ourselves that array-of-UNKNOWN is not dangerous, > > I don't think this is easily solved. > > One possibility that might handle Martijn's problem is to allow the > constr

Re: [GENERAL] Array constructor requires one argument

2007-01-09 Thread David Fetter
On Tue, Jan 09, 2007 at 04:09:21PM -0500, Tom Lane wrote: > Joe Conway <[EMAIL PROTECTED]> writes: > > Unless we can convince ourselves that array-of-UNKNOWN is not dangerous, > > I don't think this is easily solved. > > One possibility that might handle Martijn's problem is to allow the > constr

Re: [GENERAL] Array constructor requires one argument

2007-01-09 Thread Tom Lane
Joe Conway <[EMAIL PROTECTED]> writes: > Unless we can convince ourselves that array-of-UNKNOWN is not dangerous, > I don't think this is easily solved. One possibility that might handle Martijn's problem is to allow the construct ARRAY[]::type[] that is, you can have an empty ARRAY con

Re: [GENERAL] Array constructor requires one argument

2007-01-09 Thread Joe Conway
Tom Lane wrote: Martijn van Oosterhout writes: On Tue, Jan 09, 2007 at 10:02:09AM -0500, Tom Lane wrote: Define the data type of SELECT ARRAY[]; The same type as: SELECT NULL; Hardly, because whatever type NULL has, it's not an array type. Here's a link to the initial discussion on

Re: [GENERAL] Array constructor requires one argument

2007-01-09 Thread Tom Lane
Martijn van Oosterhout writes: > On Tue, Jan 09, 2007 at 10:02:09AM -0500, Tom Lane wrote: >> Define the data type of >> SELECT ARRAY[]; > The same type as: > SELECT NULL; Hardly, because whatever type NULL has, it's not an array type. > In fact, you could just make it an unknown > literal with

Re: [GENERAL] Array constructor requires one argument

2007-01-09 Thread Martijn van Oosterhout
On Tue, Jan 09, 2007 at 10:02:09AM -0500, Tom Lane wrote: > Martijn van Oosterhout writes: > > Is there a particular reason why the array constructor requires at > > least one argument? > > Define the data type of > > SELECT ARRAY[]; The same type as: SELECT NULL; or SELECT '{

Re: [GENERAL] Array constructor requires one argument

2007-01-09 Thread Tom Lane
Martijn van Oosterhout writes: > Is there a particular reason why the array constructor requires at > least one argument? Define the data type of SELECT ARRAY[]; regards, tom lane ---(end of broadcast)--- T

[GENERAL] Array constructor requires one argument

2007-01-09 Thread Martijn van Oosterhout
Hi, Is there a particular reason why the array constructor requires at least one argument? It's a bit irriating to have to special case zero length arrays. # select array[]; ERROR: syntax error at or near "]" at character 14 # select array[1]; array --- {1} (1 row) # select '{}'::int4[];