Received: from merganser.its.uu.se (merganser.its.uu.se [130.238.6.236]) by hub.org (8.9.3/8.9.3) with ESMTP id QAA38504 for ; Thu, 20 Jan 2000 16:48:35 -0500 (EST) (envelope-from peter@localhost.its.uu.se) Received: from regulus.its.uu.se ([130.238.7.19]:64632 "EHLO regulus.its.uu.se") by merganser.its.uu.se with ESMTP id ; Thu, 20 Jan 2000 22:47:59 +0100 Received: from peter (helo=localhost) by regulus.its.uu.se with local-esmtp (Exim 3.02 #2) id 12BPXz-000324-00; Thu, 20 Jan 2000 22:55:19 +0100 Date: Thu, 20 Jan 2000 22:55:19 +0100 (CET) From: Peter Eisentraut To: Kovacs Zoltan Sandor cc: pgsql-sql@postgresql.org Subject: Re: [SQL] insert values into arrays In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: Peter Eisentraut I was the unlucky guy that implemented CREATE GROUP and friends for 7.0, so I can feel your array pains. While I don't know an answer to your problem, I think this was a place where an array was not appropriate. I don't know why this was done that way, I hope to change it some day. On 2000-01-20, Kovacs Zoltan Sandor mentioned: > (I sent this mail to a few list members already. Sorry, if you are one of > them, too.) > > I didn't read 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, > Kovacs, Zoltan > > > ************ > > -- Peter Eisentraut Sernanders väg 10:115 peter_e@gmx.net 75262 Uppsala http://yi.org/peter-e/ Sweden