Title: [PostgresSQL] Failure to use GROUP BY for column output names when using subqueries · Issue #1886 · sqlc-dev/sqlc · GitHub
Open Graph Title: [PostgresSQL] Failure to use GROUP BY for column output names when using subqueries · Issue #1886 · sqlc-dev/sqlc
X Title: [PostgresSQL] Failure to use GROUP BY for column output names when using subqueries · Issue #1886 · sqlc-dev/sqlc
Description: Version 1.15.0 What happened? When using a subquery, if I specify an output column name for GROUP BY, sqlc cannot compile it. if I execute SQL directly, it works fine. I am aware that when using PostgreSQL, column output names can be spe...
Open Graph Description: Version 1.15.0 What happened? When using a subquery, if I specify an output column name for GROUP BY, sqlc cannot compile it. if I execute SQL directly, it works fine. I am aware that when using Po...
X Description: Version 1.15.0 What happened? When using a subquery, if I specify an output column name for GROUP BY, sqlc cannot compile it. if I execute SQL directly, it works fine. I am aware that when using Po...
Opengraph URL: https://github.com/sqlc-dev/sqlc/issues/1886
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[PostgresSQL] Failure to use GROUP BY for column output names when using subqueries","articleBody":"### Version\n\n1.15.0\n\n### What happened?\n\nWhen using a subquery, if I specify an output column name for GROUP BY, sqlc cannot compile it. if I execute SQL directly, it works fine.\r\n\r\nI am aware that when using PostgreSQL, column output names can be specified as GROUP BY. However, if I am mistaken, please let me know.\r\n\r\n\r\n\n\n### Relevant log output\n\n_No response_\n\n### Database schema\n\n```sql\nCREATE TABLE spam (\r\n id SERIAL PRIMARY KEY\r\n);\n```\n\n\n### SQL queries\n\n```sql\n-- name: Spam :many\r\nSELECT\r\n s.id AS \"s_id\"\r\nFROM\r\n -- Using subqueries doesn't work.\r\n (\r\n SELECT\r\n spam.id\r\n\tFROM spam\r\n ) AS \"s\"\r\n-- Change this to s.id and it will work.\r\nGROUP BY s_id;\n```\n\n\n### Configuration\n\n_No response_\n\n### Playground URL\n\nhttps://play.sqlc.dev/p/b3ae0c313bd30c061316dc729e285eba780ba4c7c94e4a44eaac81c619ce9c99\n\n### What operating system are you using?\n\nmacOS\n\n### What database engines are you using?\n\nPostgreSQL\n\n### What type of code are you generating?\n\nGo","author":{"url":"https://github.com/voluntas","@type":"Person","name":"voluntas"},"datePublished":"2022-10-07T04:32:53.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/1886/sqlc/issues/1886"}
| 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:55984e03-e97f-7250-3efb-a0a433ec57ee |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CAD2:1D5589:EB097A:13C1424:6A52923B |
| html-safe-nonce | a99cac223af096bdd48ddd38cb848d61c6874f7dada42b7e802043f0ac02f7de |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQUQyOjFENTU4OTpFQjA5N0E6MTNDMTQyNDo2QTUyOTIzQiIsInZpc2l0b3JfaWQiOiI3NDAxMjQ1Mzk2MTA0ODExMDY3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | c8d18c40d92c1211669c4ebce53743e5653605ad8c0853c890cff3d894cac9c7 |
| hovercard-subject-tag | issue:1400605611 |
| 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/1886/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9e0c0cf3457dfe257000c126430475490c66ed540193d09d11af4730da5efd5f/sqlc-dev/sqlc/issues/1886 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9e0c0cf3457dfe257000c126430475490c66ed540193d09d11af4730da5efd5f/sqlc-dev/sqlc/issues/1886 |
| og:image:alt | Version 1.15.0 What happened? When using a subquery, if I specify an output column name for GROUP BY, sqlc cannot compile it. if I execute SQL directly, it works fine. I am aware that when using Po... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | voluntas |
| 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 | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width