cockroachdb / cockroachdb/cockroach

pgwire: CALL statement is returning RowDescription messages

Open
#151,432 0 comments 0 reactions 0 assignees View on GitHub
A-sql-pgcompat A-sql-pgwire branch-release-25.3 C-cleanup E-quick-win O-qa T-sql-queries
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

When executing the CALL command, CockroachDB returns RowDescription messages. PostgreSQL does not return RowDescription messages after CALL commands.

Here's a pgwire test that shows the behavior:

```
# Create the test table
send
Query {"String": "CREATE TABLE mn (m INT PRIMARY KEY, n INT)"}
----

until
ReadyForQuery
----
{"Type":"CommandComplete","CommandTag":"CREATE TABLE"}
{"Type":"ReadyForQuery","TxStatus":"I"}

# Create PLpgSQL stored procedure that:
# 1. Takes an integer parameter as base value
# 2. Inserts a row using the parameter
# 3. Commits the transaction
# 4. Inserts another row using parameter + 1000
send
Query {"String": "CREATE OR REPLACE PROCEDURE p(base_val INT) LANGUAGE plpgsql AS $$ BEGIN INSERT INTO mn VALUES (base_val, base_val * 10); COMMIT; INSERT INTO mn VALUES (base_val + 1000, (base_val + 1000) * 10); END $$"}
----

until
ReadyForQuery
----
{"Type":"CommandComplete","CommandTag":"CREATE PROCEDURE"}
{"Type":"ReadyForQuery","TxStatus":"I"}

# Execute the stored procedure using simple query protocol
send
Query {"String": "CALL p(1)"}
----

until
ReadyForQuery
----
{"Type":"RowDescription","Fields":null}
{"Type":"RowDescription","Fields":null}
{"Type":"CommandComplete","CommandTag":"CALL"}
{"Type":"ReadyForQuery","TxStatus":"I"}
```

When watching the same sequence of commands sent to PostgreSQL 16.9 with Wireshark, it does not return RowDescription messages after the CALL statement.

Jira issue: CRDB-53274

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.