News for hackers. Stuff that matters.
Re:How We Went All In on sqlc/pgx for Postgres and Go by joppy on Wednesday September 08, 2021 @06:28PM (#28463829)
Arrays are nicer for the IN case because Postgres does not understand an empty list, i.e “WHERE foo IN ()” will error. Using the “WHERE foo = ANY(array)” works as expected with empty arrays.
Re:How We Went All In on sqlc/pgx for Postgres and Go by grantwu on Wednesday September 08, 2021 @07:01PM (#28464136)
Works as expected? Wouldn't that WHERE clause filter out all of the rows? Is that frequently desired behavior?
Re:How We Went All In on sqlc/pgx for Postgres and Go by ethanpailes on Wednesday September 08, 2021 @08:30PM (#28464755)
I could imagine that you're building up the array in go code and want the empty set to be handled as expected.