Re: [GENERAL] Custom types as parameter in stored function

2011-06-27 Thread mephysto
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.

[GENERAL] Custom types as parameter in stored function

2011-06-27 Thread mephysto
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;

Re: [GENERAL] Custom types as parameter in stored function

2011-06-27 Thread Merlin Moncure
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)

Re: [GENERAL] Custom types as parameter in stored function

2011-06-27 Thread mephysto
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:

Re: [GENERAL] Custom types as parameter in stored function

2011-06-27 Thread Merlin Moncure
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