Re: can function arguments have the type tablename.columnname%TYPE?

Поиск
Список
Период
Сортировка
От Guillaume Lelarge
Тема Re: can function arguments have the type tablename.columnname%TYPE?
Дата
Msg-id 4BE97DF6.3030607@lelarge.info
обсуждение исходный текст
Ответ на Re: can function arguments have the type tablename.columnname%TYPE?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: can function arguments have the type tablename.columnname%TYPE?  ("Igor Neyman" <ineyman@perceptron.com>)
Список pgsql-general
Le 11/05/2010 16:16, Tom Lane a écrit :
> Guillaume Lelarge <guillaume@lelarge.info> writes:
>> Le 11/05/2010 10:28, Dino Vliet a écrit :
>>> I'm writing a plpgsql function in pgadminIII and want to know if the arguments can have the following type:
>>>
>>> tablename.columnname%TYPE
>
>> No, this construct is only available *inside* a PL/pgsql function body
>
> That's incorrect: you can use it in a function declaration too.
>

Oh sure. With body, I meant the part between the two $$. But you're
right, I should have said "inside the declare and body parts of a
PL/pgsql function".

> Not sure what the OP's problem is exactly --- it might be specific to
> pgAdmin.

IIUC, he means doing something like this:

CREATE FUNCTION f1(arg1 table.column%TYPE ...

Which, AFAICT, is not possible. And you can't do that with pgAdmin, but
you can use the %TYPE in the declare and body parts in pgAdmin.


--
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com

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

Предыдущее
От: Glen Barber
Дата:
Сообщение: PostgreSQL 9.0 beta1 and pg_upgrade
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: Run Vacuum Through JDBC