Skip site navigation (1) Skip section navigation (2)

Re: [GENERAL] Empty arrays with ARRAY[]

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Brendan Jurd" <direvus(at)gmail(dot)com>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Martijn van Oosterhout" <kleptog(at)svana(dot)org>, <pgsql-hackers(at)postgresql(dot)org>, <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [GENERAL] Empty arrays with ARRAY[]
Date: 2007-11-30 10:09:22
Message-ID: 877ik0cael.fsf@oxford.xeocode.com (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackerspgsql-patches
"Brendan Jurd" <direvus(at)gmail(dot)com> writes:

> The patch is very invasive (at least compared to any of my previous
> patches), but so far I haven't managed to find any broken behaviour.

I'm sorry to suggest anything at this point, but... would it be less invasive
if instead of requiring the immediate cast you created a special case in the
array code to allow a placeholder object for "empty array of unknown type".
The only operation which would be allowed on it would be to cast it to some
specific array type.

That way things like

UPDATE foo SET col = array[];
INSERT INTO foo (col) VALUES (array[]);

could be allowed if they could be contrived to introduce an assignment cast.

-- 
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com
  Ask me about EnterpriseDB's RemoteDBA services!

In response to

Responses

pgsql-hackers by date

Next:From: Tatsuo IshiiDate: 2007-11-30 10:15:35
Subject: Re: PostGreSQL and recursive queries...
Previous:From: Usama DarDate: 2007-11-30 10:08:02
Subject: Re: Release Note Changes

pgsql-patches by date

Next:From: Alvaro HerreraDate: 2007-11-30 12:21:17
Subject: Re: pg_regress: paths in largeobject test
Previous:From: Simon RiggsDate: 2007-11-30 09:54:19
Subject: Re: [PATCHES] Partition: use triggers instead of rules

pgsql-general by date

Next:From: Madison KellyDate: 2007-11-30 10:22:34
Subject: Moving lock file (/tmp/.s.PGSQL.<port>)
Previous:From: Martijn van OosterhoutDate: 2007-11-30 10:07:35
Subject: Re: invalid byte sequence for encoding "UTF8"

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group