Skip site navigation (1) Skip section navigation (2)

Problems with function while migrating from Windows to Linux

From: "Jan Peters" <petersjan(at)gmx(dot)at>
To: pgsql-sql(at)postgresql(dot)org
Subject: Problems with function while migrating from Windows to Linux
Date: 2008-04-22 09:47:27
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql
Hello list,
after developping my application in a Windows environment I am now migrating to the production Linux webserver. I backed up my database, functions and schemas and imported them again via pgAdmin III, because the first application which I used to do the transfer did not move the variable aliases within the function. So what I have (what is running under Windows) is:


getgv_neu(id int4, tablename text, runde1 int4, runde2 int4) returns int4:


tablename1 varchar := quote_ident(tablename);
result_aktiva integer;
result_passiva integer;
sum integer;
EXECUTE 'SELECT getaktiva(' || id|| ',' || runde1 || ',' || runde2 || ') ;' INTO result_aktiva;
if result_aktiva < -100000 THEN
RETURN result_aktiva;
EXECUTE 'SELECT getpassiva(\'' || tablename1 || '\',' || id || ');' INTO result_passiva;
sum = result_aktiva - result_passiva;


when I do e.g. a "select getgv_neu(5,'company_5',1,0)" I get the error message:

ERROR:  syntax error at or near "$4" at character 81
QUERY:  SELECT  'SELECT getaktiva(' ||  $1 || ',' ||  $2  || ',' ||  $3  || ') ;' INTO  $4
CONTEXT:  PL/pgSQL function "getgv_neu" line 7 at execute statement

What might be the problem here? Any ideas? I am stuck...

Thanks again in advance

Jan Peters-Anders

GMX startet Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein:


pgsql-sql by date

Next:From: Nacef LABIDIDate: 2008-04-22 09:54:26
Subject: After updating dataset the record goes to the end of the dataset
Previous:From: Theerasak ManeeneimDate: 2008-04-22 01:09:09
Subject: Error: could not find pathkey item to sort

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group