# Test that multiple DDL statements in the same extended request are supported send Query {"query": "DROP TABLE IF EXISTS a"} Query {"query": "DROP TABLE IF EXISTS b"} ---- until ignore=NoticeResponse ReadyForQuery ReadyForQuery ---- CommandComplete {"tag":"DROP TABLE"} ReadyForQuery {"status":"I"} CommandComplete {"tag":"DROP TABLE"} ReadyForQuery {"status":"I"} send Parse {"query": "CREATE TABLE a (a int)"} Bind Execute Parse {"query": "CREATE TABLE b (a int)"} Bind Execute Parse {"query": "SELECT 1/0"} Bind Execute Sync ---- until ReadyForQuery ---- ParseComplete BindComplete CommandComplete {"tag":"CREATE TABLE"} ParseComplete BindComplete CommandComplete {"tag":"CREATE TABLE"} ParseComplete BindComplete ErrorResponse {"fields":[{"typ":"S","value":"ERROR"},{"typ":"C","value":"XX000"},{"typ":"M","value":"division by zero"}]} ReadyForQuery {"status":"I"} send Parse {"query": "SELECT * FROM a"} Bind Execute Sync ---- until ReadyForQuery ---- ParseComplete BindComplete CommandComplete {"tag":"SELECT 0"} ReadyForQuery {"status":"I"} # Test what happens with rollback'd DDLs in extended protocol. # # Note: This only works in versions of Postgres with # https://github.com/postgres/postgres/commit/f92944137cdec3e80e826879d817a2d3dff68b5f # applied, which at the time of writing is none of them. The following output # was generated by a Postgres server built from source that included that # commit. send Query {"query": "DROP DATABASE IF EXISTS a"} Query {"query": "DROP DATABASE IF EXISTS b"} ---- until ignore=NoticeResponse ReadyForQuery ReadyForQuery ---- CommandComplete {"tag":"DROP DATABASE"} ReadyForQuery {"status":"I"} CommandComplete {"tag":"DROP DATABASE"} ReadyForQuery {"status":"I"} send Parse {"query": "SELECT 1 FROM pg_type LIMIT 0"} Bind Execute Parse {"query": "CREATE DATABASE a"} Bind Execute Parse {"query": "ROLLBACK"} Bind Execute Sync ---- until ReadyForQuery ---- ParseComplete BindComplete CommandComplete {"tag":"SELECT 0"} ParseComplete BindComplete CommandComplete {"tag":"CREATE DATABASE"} ParseComplete BindComplete NoticeResponse {"fields":[{"typ":"S","value":"WARNING"},{"typ":"C","value":"25P01"},{"typ":"M","value":"there is no transaction in progress"}]} CommandComplete {"tag":"ROLLBACK"} ReadyForQuery {"status":"I"} send Parse {"query": "CREATE DATABASE b"} Bind Execute Parse {"query": "SELECT 1 FROM pg_type LIMIT 0"} Bind Execute Parse {"query": "ROLLBACK"} Bind Execute Sync ---- until ReadyForQuery ---- ParseComplete BindComplete CommandComplete {"tag":"CREATE DATABASE"} ParseComplete BindComplete CommandComplete {"tag":"SELECT 0"} ParseComplete BindComplete NoticeResponse {"fields":[{"typ":"S","value":"WARNING"},{"typ":"C","value":"25P01"},{"typ":"M","value":"there is no transaction in progress"}]} CommandComplete {"tag":"ROLLBACK"} ReadyForQuery {"status":"I"} send Query {"query": "SELECT datname FROM pg_catalog.pg_database WHERE datname IN ('a', 'b') ORDER BY datname"} ---- until ReadyForQuery ---- RowDescription {"fields":[{"name":"datname"}]} DataRow {"fields":["a"]} DataRow {"fields":["b"]} CommandComplete {"tag":"SELECT 2"} ReadyForQuery {"status":"I"}