Re: function with different return type depending on parameter?

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: function with different return type depending on parameter?
Дата
Msg-id CAFj8pRB9NvoYROx4zbUrAqqN2ypR2DuiAOgxC=FumJbsu-hVUw@mail.gmail.com
обсуждение исходный текст
Ответ на function with different return type depending on parameter?  (James Harper <james.harper@bendigoit.com.au>)
Список pgsql-general
Hello

no it is not possible

Regards

Pavel

p.s. result - type must be known before execution (when execution plan is created)


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 по дате отправления:

Предыдущее
От: Rémi Cura
Дата:
Сообщение: Re: function with different return type depending on parameter?
Следующее
От: Glyn Astill
Дата:
Сообщение: Re: pgsql and asciidoc output