Re: Use array in a dynamic statement

From: Sophie Yang <yangsophie(at)yahoo(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Use array in a dynamic statement
Date: 2009-03-06 05:11:53
Message-ID: 475092.1627.qm@web53712.mail.re2.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


I don't see how the problem can be solved by merging the function logic into the calling function. The int[][] array is supplied by user, and I still have the issue to pass it into a dynamic statement, no matter in which function, unless I serialize it to string and deserialize back to int[][].

----- Original Message ----
From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Sophie Yang <yangsophie(at)yahoo(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>; pgsql-hackers(at)postgresql(dot)org
Sent: Thursday, March 5, 2009 6:51:48 PM
Subject: Re: [HACKERS] Use array in a dynamic statement

On Thu, Mar 5, 2009 at 8:32 PM, Sophie Yang <yangsophie(at)yahoo(dot)com> wrote:
>
> I was wondering why USING clause is not supported in pl/pgsql dynamic statement. Serialization is the option I tried to avoid, but it seems there is no better approach available.
>
> Just to say a few more about the usage of my function. In dag_tree_1, (rid, rtid) is the primary key, which identifies a node in a tree structure. The idx field is a kind of dewy index. for example:
> rid rtid idx
> 1123 1 0000.0006.0033
> 3231 1 0000.0006
> 786 6 0000.0007.8853
> 80923 2 0000.0007.8853.2382
>
> The function takes in a list of rid and rtid pair (nids), sort them by the length of the dewy index, which is equivalent to sort the nodes by their tree depth. That's what I try to achieve. Maybe someone has different idea to implement the function?

Well the function is pretty simple. Maybe you could merge the logic
encapsulated by the function into the containing query?

...Robert

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message A. Kretschmer 2009-03-06 06:14:20 Re: Validating problem in the isn contrib module
Previous Message Robert Lor 2009-03-06 04:39:48 Additional DTrace Probes