Re: Number of dimensions of an array parameter

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Thomas Hallgren <thomas(at)tada(dot)se>
Cc: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Number of dimensions of an array parameter
Date: 2006-05-08 18:05:40
Message-ID: 20060508180540.GB20672@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, May 08, 2006 at 07:31:14PM +0200, Thomas Hallgren wrote:
> Would it be hard to enforce a real check? The implementation could use
> GUC settings like 'enforce_array_dimensions' and 'enforce_array_lengths'
> that could be set to false for the legacy implementations that rely on
> the current behavior. I know Tom added the ability to have NULL values
> in the arrays. Perhaps now is the time to improve the type semantics as
> well?

The big probem is where do you store the number of declared dimensions?
It's not stored anywhere, so there's nowhere to check against either.
If we can fix that first we might get to the checking part.

test=# create function foo(int[][]) returns int4 as 'select 1' language sql;
CREATE FUNCTION
test=# \df foo
List of functions
Result data type | Schema | Name | Argument data types
------------------+--------+------+---------------------
integer | public | foo | integer[]
(1 row)

Have a ncie day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2006-05-08 18:08:59 Re: XLOG_BLCKSZ vs. wal_buffers table
Previous Message Rod Taylor 2006-05-08 18:03:17 Re: Number of dimensions of an array parameter