On Feb 16, 12:06 am, [EMAIL PROTECTED] (Paul Lambert)
wrote:
> Tom Lane wrote:
> > Paul Lambert <[EMAIL PROTECTED]> writes:
> >> What I am confused about is: Why does the creation of a function fail if
> >> a table it uses does not exist when the function itself is creating the
> >> table further u
Tomas Vondra wrote:
AutoDRS=# select "fnLoadAppraisals"();
ERROR: relation with OID 18072 does not exist
CONTEXT: SQL function "fnLoadAppraisals" statement 5
18072 is the OID of table appraisals_temp_load
If I run the code within the function by itself, i.e. copy and paste
the 6 lines of
AutoDRS=# select "fnLoadAppraisals"();
ERROR: relation with OID 18072 does not exist
CONTEXT: SQL function "fnLoadAppraisals" statement 5
18072 is the OID of table appraisals_temp_load
If I run the code within the function by itself, i.e. copy and paste
the 6 lines of SQL int psql it runs
2007/2/16, Paul Lambert <[EMAIL PROTECTED]>:
In setting up some functions to load data from a csv file, I'm doing the
following in psql on Weendoze:
AutoDRS=# CREATE OR REPLACE FUNCTION "fnLoadAppraisals"()
AutoDRS-# RETURNS void AS
AutoDRS-# $BODY$
AutoDRS$# DROP TABLE IF EXISTS apprais
Tom Lane wrote:
Paul Lambert <[EMAIL PROTECTED]> writes:
What I am confused about is: Why does the creation of a function fail if
a table it uses does not exist when the function itself is creating the
table further up to where it references it?
Because the function isn't actually being *exec
Paul Lambert <[EMAIL PROTECTED]> writes:
> What I am confused about is: Why does the creation of a function fail if
> a table it uses does not exist when the function itself is creating the
> table further up to where it references it?
Because the function isn't actually being *executed*, only
s
In setting up some functions to load data from a csv file, I'm doing the
following in psql on Weendoze:
AutoDRS=# CREATE OR REPLACE FUNCTION "fnLoadAppraisals"()
AutoDRS-# RETURNS void AS
AutoDRS-# $BODY$
AutoDRS$# DROP TABLE IF EXISTS appraisals_temp_load;
AutoDRS$# CREATE TABLE a