I writing a stored procedure in postgres where I need to check if a row exists then act accordingly. something along the line.
IF SELECT * FROM foo WHERE x =
Or even simpler with EXISTS:
IF EXISTS (SELECT 1 FROM foo WHERE x = 'abc' AND y = 'xyz') THEN .... END IF;