Skip to content

Tag: postgresql

SQL how to select distinct several columns

lets say there are several columns (c1, c2, c3, c4) It’s okay for each column to be appeared several times, but I want to select all the columns with several columns distinct. I want SELECT c1, DISTINCT(c2, c3), c4 something like this but it doesnt work, and GROUP BY doesnt work as well. somebody help m…

When do Postgres transactions fail?

I was wondering at what point a transaction actually fails in Postgres. By this I mean stop working, and return an error. Is it after the first failed query? Does it try all queries and then return failure? Hopefully it fails fast on first failed query, but I don’t know for sure. For instance, if I have a tra…