what's the scope of psql parameter values? - Mailing list pgsql-general

From Dick Wieland
Subject what's the scope of psql parameter values?
Date
Msg-id 003401c34ca4$5061a570$0200a8c0@wiley
Whole thread Raw
Responses Re: what's the scope of psql parameter values?
List pgsql-general

Hi,

 

I'm finding that the following function does not run properly ...

 

CREATE OR REPLACE FUNCTION :S.insert_scripts ( text )

RETURNS integer AS '

DECLARE

  my_script_type alias for $1;

  my_script_type_id integer;

BEGIN

    my_script_type_id := 0;

    select into   my_script_type_id   type_id     from :S.scripts_ref where

    type_name = my_script_type ;

    return my_script_type_id;

END;

' LANGUAGE 'plpgsql' ;

 

it fails on the ":S" parameter substitution in line 6.

 

wiline=# \echo :S

rwieland

wiline=# select :S.isf('update');

WARNING:  Error occurred while executing PL/pgSQL function isf

WARNING:  line 6 at select into variables

ERROR:  parser: parse error at or near ":" at character 22

 

Is this expected behavior I wonder?  Does the parameter substitution facility not extend down "into" the function space ...

 

Thanks for any comments,

 

Dick Wieland

 

---

 

pgsql-general by date:

Previous
From: "Eduardo Mylonas - Externo"
Date:
Subject: Crossed Reference Query
Next
From: Josh Berkus
Date:
Subject: We need volunteers for Comdex!