Re: function with different return type depending on parameter? - Mailing list pgsql-general

From Rémi Cura
Subject Re: function with different return type depending on parameter?
Date
Msg-id CAJvUf_tXRjjJhyKW65nk504WbKXZau1zoQB3L4m8R2XwBnjnEQ@mail.gmail.com
Whole thread Raw
In response to function with different return type depending on parameter?  (James Harper <james.harper@bendigoit.com.au>)
List pgsql-general


2014-02-12 10:20 GMT+01:00 James Harper <james.harper@bendigoit.com.au>:
is it possible to have a function that can return a different type depending on the parameters? Eg (approximately)

if param = "one" then return 1
if param = "two" then return "2"
if param = "three" then return 3.0
etc

I can't see any variant type

thanks

James






--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

pgsql-general by date:

Previous
From: James Harper
Date:
Subject: function with different return type depending on parameter?
Next
From: Pavel Stehule
Date:
Subject: Re: function with different return type depending on parameter?