Skip to content

feat: expose type OID and modifier on SimpleColumn - #1358

Open
tristan957 wants to merge 1 commit into
rust-postgres:masterfrom
tristan957:simple
Open

tristan957 wants to merge 1 commit into
rust-postgres:masterfrom
tristan957:simple

Conversation

@tristan957

Copy link
Copy Markdown
Contributor

The simple query protocol's RowDescription message carries the type OID and type modifier for each column, but SimpleColumn was dropping both. Clients rendering column types (e.g. distinguishing varchar(50) from text) need access to this metadata, matching what's already exposed on Column for the extended query protocol.

Closes: #1329

The simple query protocol's RowDescription message carries the type OID
and type modifier for each column, but SimpleColumn was dropping both.
Clients rendering column types (e.g. distinguishing varchar(50) from
text) need access to this metadata, matching what's already exposed on
Column for the extended query protocol.

Closes: rust-postgres#1329
@tristan957

tristan957 commented May 29, 2026

Copy link
Copy Markdown
Contributor Author

I see a PR was created at #1338. The PR has a lot of changes that seem strange, since this is a pretty simple change. That PR also only exposes the OID and not the type modifier. Happy to close the PR if the #1338 is a better candidate for merging.

Thanks for rust-postgres. I used it at a previous job, and it is quite nice to use.

id SERIAL,
name TEXT
name TEXT,
description VARCHAR(50)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this column to be able to test that the type modifier is not always -1.

@tristan957

Copy link
Copy Markdown
Contributor Author

Should we expose other information in https://www.postgresql.org/docs/current/protocol-message-formats.html#PROTOCOL-MESSAGE-FORMATS-ROWDESCRIPTION? The data type size, the column attribute number, format code, and the table OID sound interesting.

@tristan957

Copy link
Copy Markdown
Contributor Author

@paolobarbolini anything I can do to help push this PR along?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add type OID to SimpleColumn

1 participant