RE: [HACKERS] Arrays broken on temp tables

From: "Ansley, Michael" <Michael(dot)Ansley(at)intec(dot)co(dot)za>
To: "'Kristofer Munn '" <kmunn(at)munn(dot)com>, "'pgsql-hackers(at)postgreSQL(dot)org '" <pgsql-hackers(at)postgreSQL(dot)org>
Subject: RE: [HACKERS] Arrays broken on temp tables
Date: 1999-11-06 21:08:00
Message-ID: 1BF7C7482189D211B03F00805F8527F748C224@S-NATH-EXCH2
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Sorry, all; ignore the last mail; I was having a stupid attack.

-----Original Message-----
From: Kristofer Munn
To: pgsql-hackers(at)postgreSQL(dot)org
Sent: 99/11/06 10:09
Subject: [HACKERS] Arrays broken on temp tables

Greetings. I recently encountered a problem updating an array element
on
a temp table. Instead of updating just the specified array element, it
copies the array values onto all the tuples. The command works as
expected with regular tables.

create temp table tmpArray (
id int4,
val int4[]
);
CREATE
insert into tmpArray values (1, '{1,2,3,4}');
INSERT 24630506 1
insert into tmpArray values (2, '{4,3,2,1}');
INSERT 24630507 1
insert into tmpArray values (3, '{9,10,11,12}');
INSERT 24630508 1
select * from tmpArray;
id|val
--+------------
1|{1,2,3,4}
2|{4,3,2,1}
3|{9,10,11,12}
(3 rows)

update tmpArray set val[3] = 7;
UPDATE 3
select * from tmpArray;
id|val
--+---------
1|{1,2,7,4}
2|{1,2,7,4}
3|{1,2,7,4}
(3 rows)

drop table tmpArray;
DROP
EOF

- K

Kristofer Munn * KMI * 973-509-9414 * AIM KrMunn * ICQ 352499 *
www.munn.com

************

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 1999-11-06 21:12:42 Re: [HACKERS] Arrays broken on temp tables
Previous Message Bruce Momjian 1999-11-06 20:51:36 Re: [HACKERS] Arrays broken on temp tables