From: Franz Stuetzle <franz.stuetzle@gmx.net>
To: pgsql-sql@postgresql.org
Subject: Postgre: 8.0.1 Create Table insde a function gives strange error at execution time
Date: Sun, 27 Mar 2005 14:17:38 +0200
Message-ID: <20050327121735.AFA9853A9E@svr1.postgresql.org> (raw)
Code within a function is like this:
SELECT 1
INTO x
FROM pg_tables
where tablename = 'globals_pac_adressarten'
and tableowner = user;
IF (NOT FOUND) THEN
CREATE TEMPORARY TABLE globals_pac_adressarten
(INT_ALIAS_NAME VARCHAR(12) NOT NULL
,KOMMUNIKATION SMALLINT NOT NULL
,POSTALISCH SMALLINT NOT NULL
)
WITHOUT OIDS
ON COMMIT PRESERVE ROWS;
END IF;
When executing following errors are reported:
ERROR: syntax error at or near "$1" bei Zeichen 87
ANFRAGE: CREATE TEMPORARY TABLE globals_pac_adressarten (INT_ALIAS_NAME
VARCHAR(12) NOT NULL , $1 SMALLINT NOT NULL ,
$2 SMALLINT NOT NULL ) WITHOUT OIDS ON COMMIT PRESERVE ROWS
KONTEXT: PL/pgSQL function "padr_insert_address" line 142 at SQL statement
SQL statement "SELECT padr_insert_address('pCursor','1','1','xxx','0')"
PL/pgSQL function "test" line 6 at select into variables
ZEILE 1: ...dressarten (INT_ALIAS_NAME VARCHAR(12) NOT NULL , $1 SMALLI...
Would anybody know where those $1 and $2 come from?
If I run the "CREATE" under psql it's working OK;
Help appreciated..
Franz Stuetzle
Schertlinstr. 11-144
D-86159 Augsburg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: franz.stuetzle@gmx.net
Subject: Re: Postgre: 8.0.1 Create Table insde a function gives strange error at execution time
In-Reply-To: <20050327121735.AFA9853A9E@svr1.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox