-
Notifications
You must be signed in to change notification settings - Fork 916
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exposing the Field and table object ID's #363
Comments
As far as I can tell, yes, that is among the many things that |
It is't a pretty solution but..Something like adding a field_oid_hack=true parameter to the sql.Open string argument. db, err := sql.Open("postgres", "user=pqgotest dbname=pqgotest field_oid_hack=true") The parameter would cause the Rows.Columns() function to instead of just returning a column name return a comma separated string with all the interesting values. |
I think that could technically work but that's not what I would consider "a sensible API". Maybe a non- |
No, i agree. |
I wonder if we couldn't change database/sql to add a method to Rows() which would allows drivers to export an |
I commented on golang/go/#5606 suggesting roughly the above. The issue has been open for quite some time, though, so I'm not sure if anything will come of it. |
Looking at:
http://www.postgresql.org/docs/current/static/protocol-message-formats.html
Scrolling down to:
RowDescription (B)
One can see that postgres does submit the id of the column & table of each result field.
looking at the function parseMeta:
https://github.com/lib/pq/blob/master/conn.go#L1401
We ignore the 6 bytes that is the column & table id could we expose these Id's in the api somehow? Or would that be hinderd by go's sql package?
The text was updated successfully, but these errors were encountered: