The server version reported is 250300. Tests fail with the error:
psycopg.errors.OperatorIntervention: this schema change is
disallowed because table "execmany" is locked and this operation cannot
automatically unlock the table
DETAIL: To unlock the table, execute `ALTER TABLE execmany SET (schema_locked = false);`
After the schema change completes, we recommend setting it back to
true with `ALTER TABLE execmany SET (schema_locked = true);`.
HINT: Locking the table improves changefeed performance; see
https://www.cockroachlabs.com/docs/dev/changefeed-best-practices.html#lock-the-schema-on-changefeed-watched-tables
@pytest.fixture(scope="session")
def _execmany(svcconn):
- cur = svcconn.cursor()
- cur.execute(
+ svcconn.execute(
"""
drop table if exists execmany;
create table execmany (id serial primary key, num integer, data text)
@pytest.fixture(scope="function")
def execmany(svcconn, _execmany):
- cur = svcconn.cursor()
- cur.execute("truncate table execmany")
+ svcconn.execute("delete from execmany")
def ph(cur: Any, query: str) -> str: