Re: Function with default value?

Поиск
Список
Период
Сортировка
От Daniel CAUNE
Тема Re: Function with default value?
Дата
Msg-id 0ITV00K44LNX4C10@VL-MO-MR002.ip.videotron.ca
обсуждение исходный текст
Ответ на Re: Function with default value?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
> -----Message d'origine-----
> De : Tom Lane [mailto:tgl@sss.pgh.pa.us]
> Envoyé : dimanche 29 janvier 2006 10:48
> À : Daniel CAUNE
> Cc : pgsql-sql@postgresql.org
> Objet : Re: [SQL] Function with default value?
>
> Daniel CAUNE <d.caune@free.fr> writes:
> > Is it possible to define a function with some default values?
> > CREATE OR REPLACE FUNCTION foo(i IN int, j IN int DEFAULT := 1)
>
> No.  But you can fake many versions of this with a family of functions:
>
> CREATE OR REPLACE FUNCTION foo(i IN int, j IN int) ...
>
> CREATE OR REPLACE FUNCTION foo(i IN int) ... return foo(i, 1) ...
>
> Remember that PG lets you "overload" a function name by using the same
> name with different parameter lists.
>
>             regards, tom lane

Yes, thanks Tom, for the second time.



В списке pgsql-sql по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Function with default value?
Следующее
От: ody quraviharto
Дата:
Сообщение: variable scooping