Re: Question about function body checking and 8.1

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Tony Caduto <tony_caduto(at)amsoftwaredesign(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: Question about function body checking and 8.1
Date: 2005-03-23 21:02:18
Message-ID: 20050323210212.GB3962@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Mar 22, 2005 at 09:04:42PM -0600, Tony Caduto wrote:
>
> CREATE OR REPLACE FUNCTION mytest();
> RETURNS VOID as
> $$
> DECLARE
> mytestvar varchar;
> mytestvar2 integer;
> BEGIN
> mytestvarr = 'bla';
> select testfield from nonexistanttable where testfield = 2
> INTO mytestvar2;
> --The table does not exits, yet postgresql does not complain.
> END;
> $$
> LANGUAGE 'plpgsql' VOLATILE;

This is at most a warning. Just because the table doesn't exist now
doesn't mean it won't exixt when the function is run. Need to be
careful here otherwise when restoring a dump you'll end up with lots of
useless errors because the tables were created after the functions...

Hope this helps,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Lonni J Friedman 2005-03-23 21:25:54 Re: postgres oracle emulation question
Previous Message Vivek Khera 2005-03-23 20:58:00 Re: failure with pg_dump