vgarvardt / pgx-helpers

Various helpers for jackc/pgx PostgreSQL driver for Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Determining string or int from FieldDescription.Format

syacko opened this issue · comments

I have reviewed the FieldDescription struct and was unable to determine the usage of the format. I was hoping it could be used for determining the output format (string or int) for some utilities that I'm working on for data. When I review the values, I see a value of 0 and 1. Comparing them to int and string based (varchar) fields in the database, they don't always match. If there is documentation, I was not able to find it. Any insight on the field and whether it should be used for my purpose would be great.

TBH I can not answer your question. I think github.com/jackc/pgproto3 is better place to ask this question as this field comes from this package. Based on DataTypeOID field name I assume type is the object ID owned by DB instance - https://www.postgresql.org/docs/current/catalog-pg-type.html

Thank you.