-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
switch postgresql plugin driver - fixes poor handling of system column types. #1617
switch postgresql plugin driver - fixes poor handling of system column types. #1617
Conversation
that handles them properly
5c1fe87
to
bccef14
Compare
@menardorama could you review? |
Just fyi, might be able to get away with just the pq driver, seems they fixed at least one of the datatypes that was a blocker. |
I just havent had the time to check |
@james-lawrence I would strongly prefer to keep the pq driver, does it only require updating the dependency? |
Depends. Not sure, assuming updating the dependency does resolve all the unsupported types then could remove some of the utility functions i had to add both for postgresql and the tests. But we'd want to keep the removal of the special cased columns. |
Willing to check next weekend. |
OK, I'm going to close the PR for the time being then while keeping the |
@sparrc did some investigating this morning. so libpq still doesn't handle datname properly. (its still returning a byte array instead of a string by default) but it does properly handle the column if you cast it in the query. (which it didn't in the past)
with pgx:
pgx just handles datname and other special postgresql typed columns correctly which makes for a much nicer experience on the end user side. I think its worth using pgx. |
@james-lawrence is this is a bug in the |
I consider it a bug unsure if the maintainers of pq will. I'm not interested in putting in the time with pq to see if it will get fixed, in the past I've had trouble getting them to make changes that could impact end users codes. changing the return type for a postgresql column type would fall into that category. |
examples of pq unwilling to change returned types: |
currently lib/pq doesn't handle name and oid types consistently making adding custom queries for other tables difficult. switching the driver resolves the issue.
I also just copied the helper code from lib/pq it was a dependency whose logic I didn't wish to change for this pr.