From: | Kovacs Zoltan <kovzol(at)sol(dot)cc(dot)u-szeged(dot)hu> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Cc: | pgsql-sql(at)hub(dot)org |
Subject: | inserting values into arrays |
Date: | 2000-01-20 12:30:31 |
Message-ID: | Pine.GSO.4.21.0001201327470.21680-100000@sol.cc.u-szeged.hu |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Hi,
I unsubscribed pgsql-sql for some days, so I don't know whether this
problem is reported already or not.
I am trying to write a function for making group and user creation
easier. I would like to insert a new value after the existing ones in the
field "grolist" in the table "pg_group".
I tried a few solutions without success:
a) Defining a variable in a plpgsql function with type _int4. But
the command SELECT INTO refused to take the array up. Or, if I can do
this, how can I append a row after the others?
b) The other idea was to get the values step by step from the array,
making a varchar type variable with the values and the other neccessary
punctuation ("{", "'", ",", "}"), and then perform an update on the right
row of pg_group. But I realized that there is no varchar->_int4 converter
in Postgres yet, unfortunately.
The strange thing is that I can do almost everything by typing the queries
across the psql frontend, but from functions nothing (I think it is due to
there is no varchar->_int4 conversion) .
What should I do?
Thanks in advice,
Zoltan
Kov\'acs, Zolt\'an
kovacsz(at)pc10(dot)radnoti-szeged(dot)sulinet(dot)hu
http://www.math.u-szeged.hu/~kovzol
ftp://pc10.radnoti-szeged.sulinet.hu/home/kovacsz
From | Date | Subject | |
---|---|---|---|
Next Message | dLux | 2000-01-20 12:56:32 | sql performance help needed |
Previous Message | Peter Eisentraut | 2000-01-20 11:58:30 | Re: [SQL] crypt in Postgres? |