Extending SQL C-language multidimension arrays

From: Chris Schnaufer <chris(dot)schnaufer(at)pictometry(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Extending SQL C-language multidimension arrays
Date: 2012-06-08 21:17:06
Message-ID: 997B20BEC20E0143959C7817FFA08B96491D9C0A01@Aurora
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am using Postgrsql 9.0 and writing a C-language extension. The extension takes an n-dimension array and performs a lookup on that array. Right now I'm stuck on determining the dimensions of the array data passed in. No matter what I pass in as the array parameter (the first parameter) I'm getting a ARR_NDIM of 2.

For example, I get an ARRY_DIM of 2 for each of these queries:

SELECT getone(ARRAY[[10.1,11.2,12.3],[20.1,21.2,22.3]], POINT(1.0,1.0), 1.5, 1.0, 1.0);
SELECT getone(ARRAY[[10.1,11.2,12.3],[20.1,21.2,22.3],[31.1,33.2,35.3],[44.1,45.2,46.3]], POINT(1.0,1.0), 1.5, 1.0, 1.0);

To my way of thinking about these arrays, I should be getting the ARR_NDIM answer of 2 for the first query and an ARR_NDIM answer of 4 for the second one.

Is this a bug or am I missing something?

NOTICE: This message is covered by the Electronic Communications Privacy Act, Title 18, United States Code, Sections 2510-2521. This e-mail and any attached files are the exclusive property of Pictometry International Corp., are deemed privileged and confidential, and are intended solely for the use of the individual(s) or entity to whom this e-mail is addressed. If you are not one of the named recipient(s) or believe that you have received this message in error, please delete this e-mail and any attachments and notify the sender immediately. Any other use, re-creation, dissemination, forwarding or copying of this e-mail is strictly prohibited and may be unlawful.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Munro 2012-06-08 21:27:52 ctid ranges
Previous Message Adrian Klaver 2012-06-08 20:06:10 New crosslinks in docs