Hey again,

Received this error:

Aug  6 16:24:55 thunder postgres[7835]: [11-1] ERROR:  variable not
found in subplan target lists 

during this query:

   $dbh->do( qq/
DELETE FROM temp_obs_v
WHERE file_id IN
   (SELECT file_id
    FROM temp_obs_v NATURAL JOIN files
    WHERE  group_id = $group_id
       AND pair_id  = $pair_id) /);

on the 15th iteration (the previous 14 worked fine).

It is repeatable.  Something stupid again (other than the duplicate
indexes)?

tassiv=# explain DELETE FROM temp_obs_i  
tassiv-# WHERE file_id IN 
tassiv-#    (SELECT file_id 
tassiv(#     FROM temp_obs_i NATURAL JOIN files
tassiv(#     WHERE  group_id = 3 
tassiv(#        AND pair_id  = 25) 
tassiv-# ;
ERROR:  variable not found in subplan target lists

tassiv=# \d temp_obs_i
                     Table "public.temp_obs_i"
 Column  |  Type   |                   Modifiers                    
---------+---------+------------------------------------------------
 x       | real    | not null
 y       | real    | not null
 imag    | real    | not null
 smag    | real    | not null
 loc     | spoint  | not null
 obs_id  | integer | not null default nextval('"obs_id_seq"'::text)
 file_id | integer | not null
 use     | boolean | default false
 solve   | boolean | default false
 star_id | integer | 
 mag     | real    | 
Indexes:
    "temp_obs_i_file_id_index" btree (file_id)
    "temp_obs_i_index" gist (loc)
    "temp_obs_i_loc_index" gist (loc)
    "temp_obs_i_obs_id_index" btree (obs_id)
Foreign-key constraints:
    "temp_obs_i_files_constraint" FOREIGN KEY (file_id) REFERENCES
files(file_id) ON DELETE CASCADE Inherits: obs_root

tassiv=# \d files
                                    Table "public.files"
  Column  |           Type           |                       Modifiers  
                   
----------+--------------------------+---------------------------------
---------------------- file_id  | integer                  | not null
default nextval('"files_file_id_seq"'::text) group_id | integer         
        |  pair_id  | integer                  | 
 date     | timestamp with time zone | not null
 name     | character varying        | not null
 ra_min   | real                     | default 0
 ra_max   | real                     | default 0
 dec_min  | real                     | default 0
 dec_max  | real                     | default 0
Indexes:
    "files_pkey" primary key, btree (file_id)
    "files_name_key" unique, btree (name)
    "files_id_index" btree (file_id, group_id, pair_id)
    "files_range_index" btree (ra_min, ra_max, dec_min, dec_max)
Foreign-key constraints:
    "$1" FOREIGN KEY (group_id) REFERENCES groups(group_id) ON DELETE
CASCADE    "$2" FOREIGN KEY (pair_id) REFERENCES pairs(pair_id) ON
DELETE CASCADE



-- 
 19:43:52 up 5 days, 12:30,  3 users,  load average: 2.11, 2.07, 2.01
Wed, 6 Aug 2003 19:57:02 -0600
Robert Creager <Robert_Creager@LogicalChaos.org>
7.4 Beta1: variable not found in subplan target lists
Robert Creager <Robert_Creager@LogicalChaos.org> writes:
> tassiv=# explain DELETE FROM temp_obs_i  
> tassiv-# WHERE file_id IN 
> tassiv-#    (SELECT file_id 
> tassiv(#     FROM temp_obs_i NATURAL JOIN files
> tassiv(#     WHERE  group_id = 3 
> tassiv(#        AND pair_id  = 25) 
> tassiv-# ;
> ERROR:  variable not found in subplan target lists

Mph, looks like I broke something with the IN-optimization work.
Thanks for the test case --- will look into it.

			regards, tom lane

Thu, 07 Aug 2003 09:42:00 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: 7.4 Beta1: variable not found in subplan target lists 
Robert Creager <Robert_Creager@LogicalChaos.org> writes:
> Aug  6 16:24:55 thunder postgres[7835]: [11-1] ERROR:  variable not
> found in subplan target lists 

I believe I've fixed this as of cvs tip.  Thanks for the test case.

			regards, tom lane

Thu, 07 Aug 2003 17:23:01 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: 7.4 Beta1: variable not found in subplan target lists 