Search Postgresql Archives

R: Re: R: Re: Weird EXECUTE ... USING behaviour

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



My issue involves the USING predicates, though.

Il giorno 13 gen, 2010 10:26 p., "Adrian Klaver" <adrian.klaver@xxxxxxxxx> ha scritto:

On 01/13/2010 09:37 AM, Vincenzo Romano wrote: > > 2010/1/13 Vincenzo Romano<vincenzo.romano@xxxxxxxxxx

CREATE OR REPLACE FUNCTION public.alter_test(tbl text)
 RETURNS void
 LANGUAGE plpgsql
AS $function$
DECLARE
 len integer :=3;
BEGIN
 RAISE NOTICE '%,%' ,len,$1;
 EXECUTE '
            alter table '||tbl||' add check(length(tc_table_code) < '||len||' )';
RETURN;
END;
$function$

Some playing around got the above to work for a test case on my machine (8.4). The substitution is done before the check is parsed.


--

Adrian Klaver adrian.klaver@xxxxxxxxx


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux