Unrecognized format type specifier

Viewed 30

I have following procedure:

CREATE OR REPLACE PROCEDURE config.myprocedure(decision boolean default true)
 LANGUAGE plpgsql
AS $procedure$
declare

mysql text;
myfilter text;
    
begin
    begin 
        myfilter := 'cars rent.two%';     
        mysql :=  format(
            'UPDATE myschema.mytable SET active=s% where command LIKE %L ', 
            decision,
            myfilter);
           
        execute mysql.sql;    
          
    exception 
       when others then  
            raise notice 'error % > %', SQLSTATE, sqlerrm;
   end ;
    
commit; 
end;
$procedure$
;

When i try to execute it i am getting following error:

call config.myprocedure(false);

[19638]            ERR-22023: unrecognized format() type specifier " "

What i am doing wrong?

0 Answers
Related