Ehmmm, sorry..
Correct syntax for select is:
select myfunc((1, 'foo')::myType);
--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Custom-types-as-parameter-in-stored-function-tp4527618p4527663.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.
Hello to everyone,
I am trying to pass custom types as parameters in stored functions, and I
tried this syntax successfully:
create type myType as (id bigint, name character varying);
create or replace myfunc(obj myType)
returns void as
begin
...
end;
select myfunc((1, 'foo')::myType;
On Mon, Jun 27, 2011 at 4:33 AM, mephysto genna...@email.it wrote:
Hello to everyone,
I am trying to pass custom types as parameters in stored functions, and I
tried this syntax successfully:
create type myType as (id bigint, name character varying);
create or replace myfunc(obj myType)
Thank you Merlin.
Now, Can I pass the select as an argument of my function?
Or must I do in other manner?
Sorry, but I am a novice.
Best regards.
Mephysto
--
View this message in context:
On Mon, Jun 27, 2011 at 2:22 PM, mephysto genna...@email.it wrote:
Thank you Merlin.
Now, Can I pass the select as an argument of my function?
sure:
select myfunc(populate_record(null::t, 'b=9, a=2'));
merlin
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make