Title: sqlc doesn't handle oid types correctly with pgx/v4 · Issue #2667 · sqlc-dev/sqlc · GitHub
Open Graph Title: sqlc doesn't handle oid types correctly with pgx/v4 · Issue #2667 · sqlc-dev/sqlc
X Title: sqlc doesn't handle oid types correctly with pgx/v4 · Issue #2667 · sqlc-dev/sqlc
Description: Version 1.20.0 What happened? From this discord thread: https://discord.com/channels/946447283321438248/1145749639916683305 It looks like sqlc-generated Go code tries to use a non-existent pgtype.Uint32 for cid and oid database types whe...
Open Graph Description: Version 1.20.0 What happened? From this discord thread: https://discord.com/channels/946447283321438248/1145749639916683305 It looks like sqlc-generated Go code tries to use a non-existent pgtype.U...
X Description: Version 1.20.0 What happened? From this discord thread: https://discord.com/channels/946447283321438248/1145749639916683305 It looks like sqlc-generated Go code tries to use a non-existent pgtype.U...
Opengraph URL: https://github.com/sqlc-dev/sqlc/issues/2667
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"sqlc doesn't handle oid types correctly with pgx/v4","articleBody":"### Version\r\n\r\n1.20.0\r\n\r\n### What happened?\r\n\r\nFrom this discord thread: https://discord.com/channels/946447283321438248/1145749639916683305\r\n\r\nIt looks like sqlc-generated Go code tries to use a non-existent `pgtype.Uint32` for `cid` and `oid` database types when configured for `pgx/v4` which imports from `github.com/jackc/pgtype` (see https://github.com/sqlc-dev/sqlc/blob/v1.20.0/internal/codegen/golang/postgresql_type.go#L481).\r\n\r\nNote that with `pgx/v5` configured, sqlc imports from `github.com/jackc/pgx/v5/pgtype` which does appear to have the `pgtype.Uint32` type.\r\n\r\nSee the playground link for an example.\r\n\r\n### Relevant log output\r\n\r\n_No response_\r\n\r\n### Database schema\r\n\r\n_No response_\r\n\r\n### SQL queries\r\n\r\n_No response_\r\n\r\n### Configuration\r\n\r\n_No response_\r\n\r\n### Playground URL\r\n\r\nhttps://play.sqlc.dev/p/e8c728dddddc0248aae7194bc4d0fac902cc43ae72c2d726a2d7f10c683f82e2\r\n\r\n### What operating system are you using?\r\n\r\n_No response_\r\n\r\n### What database engines are you using?\r\n\r\nPostgreSQL\r\n\r\n### What type of code are you generating?\r\n\r\nGo","author":{"url":"https://github.com/andrewmbenton","@type":"Person","name":"andrewmbenton"},"datePublished":"2023-08-28T21:47:30.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/2667/sqlc/issues/2667"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:0e1a57d9-0fde-4c33-d882-043f362866d9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9016:13B2CF:554B27:728ED0:6A51CB68 |
| html-safe-nonce | 02fcb5ebfe50017b0bb5227fd3cebec30f94a0b51d68147da105c05707d79e22 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MDE2OjEzQjJDRjo1NTRCMjc6NzI4RUQwOjZBNTFDQjY4IiwidmlzaXRvcl9pZCI6IjQ4MDA4OTA3NTQyMTI5NDA2NDgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | c861a31743c3c36d5f3c9a9597dd045e4bcfc3fbe53622d0f66edab4a538021a |
| hovercard-subject-tag | issue:1870555321 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/sqlc-dev/sqlc/2667/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a3c37798ced969e014256e6c6e2ee53c22db08434ec5d95405fe2c5777781e25/sqlc-dev/sqlc/issues/2667 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a3c37798ced969e014256e6c6e2ee53c22db08434ec5d95405fe2c5777781e25/sqlc-dev/sqlc/issues/2667 |
| og:image:alt | Version 1.20.0 What happened? From this discord thread: https://discord.com/channels/946447283321438248/1145749639916683305 It looks like sqlc-generated Go code tries to use a non-existent pgtype.U... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | andrewmbenton |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/sqlc-dev/sqlc git https://github.com/sqlc-dev/sqlc.git |
| octolytics-dimension-user_id | 136738596 |
| octolytics-dimension-user_login | sqlc-dev |
| octolytics-dimension-repository_id | 193160679 |
| octolytics-dimension-repository_nwo | sqlc-dev/sqlc |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 193160679 |
| octolytics-dimension-repository_network_root_nwo | sqlc-dev/sqlc |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width