Skip to content

Instantly share code, notes, and snippets.

@wyanez
Created September 13, 2011 14:42
Show Gist options
  • Select an option

  • Save wyanez/1213966 to your computer and use it in GitHub Desktop.

Select an option

Save wyanez/1213966 to your computer and use it in GitHub Desktop.
Función que permite hacer el cast implicito de int a char en postgres 9
CREATE FUNCTION int_to_text(INT4) RETURNS TEXT AS '
SELECT textin(int4out($1));
' LANGUAGE SQL STRICT IMMUTABLE;
CREATE CAST (INT4 AS TEXT)
WITH FUNCTION int_to_text(INT4)
AS IMPLICIT;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment