#290 DELETE query with non-pushable clauses does not work

1.0 Dev Q
closed
None
5
2012-04-09
2012-04-06
No

1. Run the attached SampleDb.sql
2. create or replace function f(id int) returns int as
$$begin return 3;end $$ language plpgsql;

3. The delete queries as shown below will return the same error.
DELETE FROM EMPLOYEE E WHERE EDLEVEL > f(2);
DELETE FROM EMPLOYEE E WHERE EDLEVEL > ( SELECT AVG(EDLEVEL) FROM EMPLOYEE WHERE WORKDEPT = E.WORKDEPT );
DELETE FROM EMPLOYEE E WHERE SALARY > ( SELECT AVG(SALARY) FROM EMPLOYEE WHERE SUBSTRING(E.WORKDEPT,1,1) = SUBSTRING(WORKDEPT, 1,1) );

All of the above return : ERROR: attribute number 12 exceeds number of columns 2

Basically, when the WHERE clause is not-pushable, we get this error.

Also, the fix for this should test correctness in case of replicated tables.

Discussion

  • Amit Khandekar

    Amit Khandekar - 2012-04-06

    This script creates the tables required to reproduce.

     
  • Amit Khandekar

    Amit Khandekar - 2012-04-09

    This was accidentally created as a clone of 3515461. This is a duplicate of 3515461. Closing it.

     
  • Amit Khandekar

    Amit Khandekar - 2012-04-09
    • status: open --> closed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks