From: | "Asko Oja" <ascoja(at)gmail(dot)com> |
---|---|
To: | "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com> |
Cc: | "Martin Pihlak" <martin(dot)pihlak(at)gmail(dot)com>, "Pg Hackers" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: plan invalidation vs stored procedures |
Date: | 2008-08-05 13:17:29 |
Message-ID: | ecd779860808050617u3ff6ca92i8538e2c358303161@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi
Thanks for pointing to another thing to fix :)
postgres=# create type public.ret_status as ( status integer, status_text
text);
CREATE TYPE
postgres=# create or replace function pavel ( i_param text ) returns
public.ret_status as $$ select 200::int, 'ok'::text; $$ language sql;
CREATE FUNCTION
postgres=# create or replace function pavel ( i_param text, status OUT int,
status_text OUT text ) returns record as $$ select 200::int, 'ok'::text; $$
language sql;
ERROR: cannot change return type of existing function
HINT: Use DROP FUNCTION first.
Asko
On Tue, Aug 5, 2008 at 4:00 PM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>wrote:
> 2008/8/5 Martin Pihlak <martin(dot)pihlak(at)gmail(dot)com>:
> > Pavel Stehule wrote:
> >> Hello
> >>
> >> try version 8.3. There lot of dependencies are solved.
> >>
> >
> > Yes, 8.3 was the version I was testing with. Same results on the HEAD:
> >
> > $ psql -e -f test.sql
> > select version();
> > version
> >
> >
> --------------------------------------------------------------------------------------------------------------------------
> > PostgreSQL 8.4devel on i686-pc-linux-gnu, compiled by GCC gcc (GCC)
> 4.1.3 20070929 (prerelease)
> > (Ubuntu 4.1.2-16ubuntu2)
> > (1 row)
> >
> > 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
> >
> > regards,
> > Martin
> >
>
> use CREATE OR REPLACE FUNCTION syntax without DROP FUNCTION, CREATE
> FUNCTION ..
>
> Regards
> Pavel Stehule
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>
From | Date | Subject | |
---|---|---|---|
Next Message | Magnus Hagander | 2008-08-05 13:29:51 | Re: Parsing of pg_hba.conf and authentication inconsistencies |
Previous Message | Pavel Stehule | 2008-08-05 13:00:55 | Re: plan invalidation vs stored procedures |