Re: [GENERAL] Setting up functions in psql.

2007-02-18 Thread tonylaq
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

Re: [GENERAL] Setting up functions in psql.

2007-02-16 Thread Paul Lambert
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

Re: [GENERAL] Setting up functions in psql.

2007-02-16 Thread Tomas Vondra
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

Re: [GENERAL] Setting up functions in psql.

2007-02-16 Thread Clodoaldo
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

Re: [GENERAL] Setting up functions in psql.

2007-02-15 Thread Paul Lambert
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

Re: [GENERAL] Setting up functions in psql.

2007-02-15 Thread Tom Lane
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

[GENERAL] Setting up functions in psql.

2007-02-15 Thread Paul Lambert
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