You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
postgresql: ARRAY(SELECT ...) is generated as interface{} and unaliased column is named "exists" #4728
In the PostgreSQL engine, an ARRAY(SELECT ...) expression has two problems:
The result column is generated as interface{} instead of a slice of the subquery's column type.
When the column has no alias, it is named exists (and the Go field becomes Exists), but PostgreSQL names it array.
Relevant log output
Database schema
CREATETABLEsingers (id bigserialPRIMARY KEY);
CREATETABLEalbums (
id bigserialPRIMARY KEY,
singer_id bigintNOT NULLREFERENCES singers (id)
);
SQL queries
-- name: ListSingerAlbums :manySELECT id, ARRAY(SELECTalbums.idFROM albums WHEREalbums.singer_id=singers.id) AS album_ids
FROM singers;
-- name: ListSingerAlbumsNoAlias :manySELECT ARRAY(SELECTalbums.idFROM albums WHEREalbums.singer_id=singers.id)
FROM singers;
Activity