| From: | Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us> | 
|---|---|
| To: | Kristofer Munn <kmunn(at)munn(dot)com> | 
| Cc: | pgsql-hackers(at)postgreSQL(dot)org | 
| Subject: | Re: [HACKERS] Arrays broken on temp tables | 
| Date: | 1999-11-06 20:51:36 | 
| Message-ID: | 199911062051.PAA08845@candle.pha.pa.us | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-hackers | 
> 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
Bug confirmed.  Wow, that is strange.  There isn't anything about temp
table that would suggest this would happen. I will keep the bug report
and try to figure it out in the future.
-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist(at)candle(dot)pha(dot)pa(dot)us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Ansley, Michael | 1999-11-06 21:08:00 | RE: [HACKERS] Arrays broken on temp tables | 
| Previous Message | Bruce Momjian | 1999-11-06 20:48:05 | Re: [HACKERS] ERROR: infinite recursion in proc_exit |