Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old November 23rd, 2005, 02:20 AM
tsarevich@gmail.com
Guest
 
Posts: n/a
Default Composite Type Argument Construction to a Function

create type my_type (my_test text, my_int integer);

create function my_function(my_type)
returns timestamp as
'begin
return (current_timestamp);
end;
'
language 'plpgsql';


In 7.3.5, we are trying to get around the 32 argument limit of the
functions WITHOUT re-compiling with a greater func_max_args (due to
operational reasons).

My question is - HOW do I construct the argument to
my_function(my_type) so that the function recognises that I am passing
into it composite data?

NB: The example function is just "junque" to test passing a composite
type to a function.

TIA

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

  #2  
Old November 23rd, 2005, 02:21 AM
Tom Lane
Guest
 
Posts: n/a
Default Re: Composite Type Argument Construction to a Function

<tsarevich@gmail.com> writes:[color=blue]
> My question is - HOW do I construct the argument to
> my_function(my_type) so that the function recognises that I am passing
> into it composite data?[/color]

Sorry, don't think you're going to have much joy on that in 7.3.

In 8.0 you could do it with a ROW() constructor, but there's no such
thing in 7.3. IIRC the only way to pass a row value as a function
argument in 7.3 is to select the row from a table, viz

select my_function(t.*) from some_table t;

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles