Skip to content

Instantly share code, notes, and snippets.

@nicgrayson
Last active January 3, 2016 09:49
Show Gist options
  • Select an option

  • Save nicgrayson/8445089 to your computer and use it in GitHub Desktop.

Select an option

Save nicgrayson/8445089 to your computer and use it in GitHub Desktop.
SELECT setting INTO version FROM pg_settings WHERE name='server_version_num';
IF version < 90000 THEN
DROP LANGUAGE IF EXISTS plpgsql;
CREATE LANGUAGE plpgsql;
ELSE
DROP EXTENSION IF EXISTS plpgsql;
CREATE EXTENSION plpgsql;
END IF;
[error] ERROR: syntax error at or near "IF"
[error] Position: 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment