what's the scope of psql parameter values?

From: "Dick Wieland" <dick(dot)wieland(at)wiline(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: what's the scope of psql parameter values?
Date: 2003-07-17 20:45:09
Message-ID: 003401c34ca4$5061a570$0200a8c0@wiley
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

---

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Josh Berkus 2003-07-17 20:48:14 We need volunteers for Comdex!
Previous Message Eduardo Mylonas - Externo 2003-07-17 20:38:56 Crossed Reference Query