Dropped column still has value when recreated with Postgres table of 150M rows I need to set the column to NULL. Until now, this has worked, but for some reason, on this table which is much larger than the rest, it doesn't seem to be working:

ALTER TABLE "public"."WorkoutExercises" DROP COLUMN "_etl";
ALTER TABLE "public"."WorkoutExercises" ADD COLUMN "_etl" bool;


However

SELECT
    *
FROM
    "WorkoutExercises"
WHERE
    "_etl" = TRUE
LIMIT 1000;


Returns 1000 results. Why is that, and how can this be fixed?
This can only be if ...


you did not actually commit your transaction (yet) and running the second query in a different transaction.
or you have other transactions writing to the table in the meantime
or something is seriously broken
or you are dealing with two different tables:


It's worth mentioning that your ALTER TABLE commands are on "public"."WorkoutExercises", while your SELECT is on "WorkoutExercises".

Can it be, there is a second table named "WorkoutExercises" in a different schema, and that schema shows up in your current search_path before public (or public is not in the search_path at all)?

To check:

SELECT n.nspname AS schemaname, c.relname, c.relkind
FROM   pg_class c
JOIN   pg_namespace n ON n.oid = c.relnamespace
WHERE  relname = 'WorkoutExercises';


And:

SHOW search_path;