Skip to content

Instantly share code, notes, and snippets.

@HotFusionMan
Created November 30, 2014 03:22
Show Gist options
  • Save HotFusionMan/ac7465a76bf90ac70b39 to your computer and use it in GitHub Desktop.
Save HotFusionMan/ac7465a76bf90ac70b39 to your computer and use it in GitHub Desktop.
PostgreSQL PL/pgSQL implementation of XOR
CREATE OR REPLACE FUNCTION XOR(boolean, boolean) RETURNS boolean as $$ BEGIN RETURN ($1 and not $2) OR (not $1 and $2); END; $$ LANGUAGE 'plpgsql';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment