-
Notifications
You must be signed in to change notification settings - Fork 862
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
Unknown OID issue with Pgbouncer #649
Comments
I'm not sure but I suspect that error is coming from somewhere else in the stack. I don't see any where that would produce the text of the message you are seeing. In addition in v4 there should never be a time when pgx includes tests for pgbouncer and while not exhaustive they do successfully exercise the basic query path. ... I am unfamiliar with telegraf, but it looks like they are still using Are you sure you are running v4? |
The error message is being produced on line 160 of query.go. I thought I had upgraded to v4 in my testing, but it appears I'm still testing with v3.6. The pgbouncer plugin of telegraf does 2 queries, SHOW STATS and then SHOW POOLS. SHOW STATS fails, but the plugin never checks for the error code. The second query runs fine. So the output is just the result of the second query, with no error message produced, even though there was an error from the first query. If I just comment out the first query, the second query still runs fine. So it seems to me that it's just an issue with the SHOW STATS query. |
You are right the Beyond that, I'm pretty sure that the Anyway, I suspect that adding to that |
That was the issue. I registered pgtype.NumericOID. I also had to convert the results from strings to ints. And it worked. Thank you for investigating this, especially since it involved going through someone else's code. I will work up a pull request for telegraf. |
Hi @jackc, I'm one of the Telegraf maintainers. We're not especially concerned about introspection queries, I'm unsure the reason for skipping it other that it appears to be required for pgbouncer. If I remove the CustomConnInfo I get:
If you can help set me straight on how we could have this handled by introspection on connection it would be much appreciated. Otherwise, I'll make the change for the Int8, if I'm understanding correctly this change would take care of the potential overflow:
|
I'm not familiar enough with PgBouncer to know if it is necessary to skip the introspection queries or not. But it turned out that introspection was unneeded for pgx anyway. All supported types have a fixed OID except It's perfectly reasonable to just make the change for |
v4.1.2, but I think also v3. With newer versions of pgbouncer. I try to run telegraf, which uses the pgx library to talk with pgbouncer, I get
unknown oid: 1700, name: total_xact_count
from the querySHOW STATS
. If I log the OIDs passed toDataTypeForOID
, they are 25 and then 1700. It appears theoidToDataType
map is not initialized before this.I'm not familiar with the pgx code, this was just gleaned through printf debugging. Please let me know if I can provide any additional information.
The text was updated successfully, but these errors were encountered: