You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add CheckTableNotInUse calls in DROP TABLE and DROP INDEX.
Recent releases had a check on rel->rd_refcnt in heap_drop_with_catalog,
but failed to cover the possibility of pending trigger events at DROP time.
(Before 8.4 we didn't even check the refcnt.) When the trigger events were
eventually fired, you'd get "could not open relation with OID nnn" errors,
as in recent report from strk. Better to throw a suitable error when the
DROP is attempted.
Also add a similar check in DROP INDEX.
Back-patch to all supported branches.
Copy file name to clipboardExpand all lines: src/interfaces/ecpg/test/expected/sql-fetch.stderr
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -138,10 +138,10 @@
138
138
[NO_PID]: sqlca: code: 0, state: 00000
139
139
[NO_PID]: ecpg_execute on line 53: using PQexec
140
140
[NO_PID]: sqlca: code: 0, state: 00000
141
-
[NO_PID]: ecpg_check_PQresult on line 53: bad response - ERROR: cannot drop "my_table" because it is being used by active queries in this session
141
+
[NO_PID]: ecpg_check_PQresult on line 53: bad response - ERROR: cannot DROP TABLE "my_table" because it is being used by active queries in this session
142
142
[NO_PID]: sqlca: code: 0, state: 00000
143
-
[NO_PID]: raising sqlstate 55006 (sqlcode -400): cannot drop "my_table" because it is being used by active queries in this session on line 53
143
+
[NO_PID]: raising sqlstate 55006 (sqlcode -400): cannot DROP TABLE "my_table" because it is being used by active queries in this session on line 53
144
144
[NO_PID]: sqlca: code: -400, state: 55006
145
-
SQL error: cannot drop "my_table" because it is being used by active queries in this session on line 53
145
+
SQL error: cannot DROP TABLE "my_table" because it is being used by active queries in this session on line 53
0 commit comments