Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

DELETE with subquery doesn't delete rows #105

Closed
Assignees
Labels
@jamatthews

Description

Hello, sorry to file another bug report. I have a strange issue where deleting using a subquery just... doesn't work. It runs but it doesn't delete rows that it should delete.

I have two tables which are range partitioned partitioned by the same column and I'm trying to delete from one table using a sub-query to the other table.

BEGIN;
DELETE FROM table_1 WHERE partiton_column = 1 AND id IN(
 SELECT id FROM table_2 WHERE partition_column = 1
);
DELETE 0
ROLLBACK;

but using USING

BEGIN;
DELETE FROM table_1
USING table_2
WHERE table_1.partiton_column = 1 AND table_2.partition_column = 1 AND table_1.id = table_2.id;
DELETE 9744
ROLLBACK;

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      AltStyle によって変換されたページ (->オリジナル) /