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?
Thanks,
Sophie
- Original Message
From: Pavel Stehule pavel.steh...@gmail.com
To: Sophie Yang yangsop
[][].
- Original Message
From: Robert Haas robertmh...@gmail.com
To: Sophie Yang yangsop...@yahoo.com
Cc: Pavel Stehule pavel.steh...@gmail.com; pgsql-hackers@postgresql.org
Sent: Thursday, March 5, 2009 6:51:48 PM
Subject: Re: [HACKERS] Use array in a dynamic statement
On Thu, Mar 5, 2009
Hi,
I am trying to implement a PL/PgSQL function as following:
CREATE OR REPLACE FUNCTION sort_by_d_idx (nids INT[][], tbl_name VARCHAR)
RETURNS varchar[]
AS $$
DECLARE
result varchar[];
BEGIN
EXECUTE 'SELECT ARRAY(SELECT t.idx FROM generate_series(array_lower($1,1),
array_upper($1,1)) AS