function with different return type depending on parameter?

From: James Harper <james(dot)harper(at)bendigoit(dot)com(dot)au>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: function with different return type depending on parameter?
Date: 2014-02-12 09:20:26
Message-ID: 6035A0D088A63A46850C3988ED045A4B6F39F5DE@BITCOM1.int.sbss.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rémi Cura 2014-02-12 09:23:41 Re: function with different return type depending on parameter?
Previous Message Brahim SABIRI 2014-02-12 09:09:10