RE: [QUESTIONS] arrays
Forwarded to the HACKER list.
-DEJ
Show quoted text
-----Original Message-----
From: Anton Stöckl [SMTP:tony@cys.de]
Sent: Tuesday, May 05, 1998 7:57 AM
To: PostgreSQL Questions
Subject: [QUESTIONS] arraysHi there,
I just started playing around with arrays and have a question:
Can I select all values of an array without the braces and delimiters?
Like:
apache_conf=> select directive_key from vhosts;
directive_key
-------------
{1,2}
(1 row)apache_conf=> select all_array_values(directive_key) from vhosts;
directive_key
-------------
1
2
(2 row)I don't know how many elements the array holds, so I can't just use
the array[n] notation (would I need an array if I knew?).
I could parse it in my program, but in that case, I wouldn't need an
array, too (but could use a varchar type).There is an additional array question coming to my mind:
Can I insert values into the array (and delete from it), or do I have
to override it with the new values.Sorry if there are answers in the manuals, I just found the
description
how to create an array.Any pointers appreciated, Tony
--
----------C-Y-B-E-R-S-O-L-U-T-I-O-N-S----------------
Anton Stöckl mailto:tony@cys.de
CyberSolutions GmbH http://www.cys.de
Frankfurter Ring 193A Phone +49 89 32369223
80807 Muenchen Fax +49 89 32369220
------W-E----M-A-K-E----I-T----P-O-S-S-I-B-L-E-------
--
Official WWW Site: http://www.postgresql.org
Online Docs & FAQ: http://www.postgresql.org/docs
Searchable Lists: http://www.postgresql.org/mhonarc