Re: plan invalidation vs stored procedures

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martin Pihlak <martin(dot)pihlak(at)gmail(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: plan invalidation vs stored procedures
Date: 2008-08-05 13:51:17
Message-ID: 4793.1217944277@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Martin Pihlak <martin(dot)pihlak(at)gmail(dot)com> writes:
> create function foo() returns integer as $$ begin return 1; end; $$ language plpgsql;
> CREATE FUNCTION
> prepare c1 as select * from foo();
> PREPARE
> execute c1;
> foo
> -----
> 1
> (1 row)

> drop function foo();
> DROP FUNCTION
> create function foo() returns integer as $$ begin return 2; end; $$ language plpgsql;
> CREATE FUNCTION
> execute c1;
> psql:test.sql:11: ERROR: cache lookup failed for function 36555

This is simply a bad, wrong, stupid way to do it. Why do you not use
CREATE OR REPLACE FUNCTION?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Markus Wanner 2008-08-05 13:57:32 Re: Automatic Client Failover
Previous Message Kevin Grittner 2008-08-05 13:44:58 Re: IN vs EXISTS equivalence