SELECT using arrays

From: Evan Klinger <evan715(at)sirius(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: pgsql-sql(at)postgresql(dot)org
Subject: SELECT using arrays
Date: 1999-07-14 21:05:00
Message-ID: 378CFB7C.6BE05DA0@sirius.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

I have been playing around with this for some time now to no avail. I
have a table info with a two-dimensional text type array action. Is
there any way to select the corresponding value of one of the elements
without knowing the order of the elements?

E.g.

CREATE TABLE info (action text[][]);

INSERT INTO info VALUES ('{{"VAR","VAL"},{"VAR2","VAL2"}}');

Now what SELECT query will search for "VAR" within action (in this
case it is the first element, but it may not always be) and print out
"VAL."

Any information would be greatly appreciated.

Thank you very much.

Evan

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-07-14 21:07:14 #include files
Previous Message Thomas Lockhart 1999-07-14 20:19:57 Re: [HACKERS] Re: Arrays versus 'type constant' syntax

Browse pgsql-sql by date

  From Date Subject
Next Message Kyle Bateman 1999-07-14 23:03:12 How big can a transaction query be?
Previous Message Steven Bradley 1999-07-14 15:50:23 Re: [SQL] WHERE clause?