o int[][].
- Original Message
From: Robert Haas
To: Sophie Yang
Cc: Pavel Stehule ; 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 at 8:32 PM, Sophie Yang wrote:
>
> I was wonderin
On Thu, Mar 5, 2009 at 8:32 PM, Sophie Yang 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.
ckers@postgresql.org
Sent: Thursday, March 5, 2009 12:06:24 AM
Subject: Re: [HACKERS] Use array in a dynamic statement
Hello
you can't to use parameters inside literal. There hasn't any sense (to
8.3, 8.4 will support USING).
you have to use serialisation to string and quoting.
some like
CREAT
Hello
you can't to use parameters inside literal. There hasn't any sense (to
8.3, 8.4 will support USING).
you have to use serialisation to string and quoting.
some like
CREATE OR REPLACE FUNCTION foo(int[])
RETURNS SETOF int AS $$
DECLARE r record;
BEGIN
FOR r IN EXECUTE
'
Sophie Yang wrote:
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_up
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 s