Thread: BUG

BUG

From
"Mendola Gaetano"
Date:
Hi all,
I'm using pgAdmin 1.4.12 and Postgres 7.3.2

I create a function that return a SETOF:

CREATE OR REPLACE FUNCTION foo ( )
RETURNS SETOF public.foo_type AS'
DECLARE
BEGIN

    RETURN ;
END;
' LANGUAGE 'plpgsql';


if I try to edit this function inside pgAdmin the redefinition
fail, pgAdmin try to recreate this function in the following way:


CREATE OR REPLACE FUNCTION public.foo( )
RETURNS public.foo_type AS '
DECLARE
BEGIN

    RETURN ;
END;
' LANGUAGE 'plpgsql';


the SETOF is not there anymore

and correctly postgres say that the new definition change
the return type.


Gaetano


Re: BUG

From
"Dave Page"
Date:
Hi,

Unfortunately pgAdmin doesn't fully support set returning functions yet
- in fact the latest versions only indicate that a function is an srf,
they are not clev er enough to edit or create them correctly yet.
Hopefully this will be fixed soon.

Frank: Are you interested in looking at this?

Regards, Dave.

> -----Original Message-----
> From: Mendola Gaetano [mailto:mendola@bigfoot.com]
> Sent: 22 April 2003 14:30
> To: pgadmin-support@postgresql.org
> Subject: [pgadmin-support] BUG
>
>
> Hi all,
> I'm using pgAdmin 1.4.12 and Postgres 7.3.2
>
> I create a function that return a SETOF:
>
> CREATE OR REPLACE FUNCTION foo ( )
> RETURNS SETOF public.foo_type AS'
> DECLARE
> BEGIN
>
>     RETURN ;
> END;
> ' LANGUAGE 'plpgsql';
>
>
> if I try to edit this function inside pgAdmin the
> redefinition fail, pgAdmin try to recreate this function in
> the following way:
>
>
> CREATE OR REPLACE FUNCTION public.foo( )
> RETURNS public.foo_type AS '
> DECLARE
> BEGIN
>
>     RETURN ;
> END;
> ' LANGUAGE 'plpgsql';
>
>
> the SETOF is not there anymore
>
> and correctly postgres say that the new definition change
> the return type.
>
>
> Gaetano
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an
> appropriate subscribe-nomail command to
> majordomo@postgresql.org so that your message can get through
> to the mailing list cleanly
>


Re: BUG

From
"Dave Page"
Date:
 
-----Original Message-----
From: frank_lupo [mailto:frank_lupo@email.it]
Sent: 08 May 2003 15:49
To: Dave Page
Cc: mendola; pgadmin-support
Subject: RE: [pgadmin-support] BUG

Hi Dave,
 
I look this problem but i d'not understand the code. In pgschema is not possible to specify the RetSet when add new function. It is an error or never has not been completed the adding function?
 
int retun sql definetion
Public Property Get SQL(Optional OrReplace As Boolean = False) As String
...
 
current
  szSQL = szSQL & " RETURNS " & szReturns
 
new
  szSQL = szSQL & " RETURNS " 
  if bRetSet then   szSQL = szSQL & " SETOF " 
  szSQL = szSQL & szReturns
is correct this code?
 
If I remember correctly, the code will recognise set returning functions (SRFs), generate the SQL for them, and mark them as such in the properties dialogue, you just can't create them yet in pgAdmin. That would be nice to have for the release if you want to fix it :-)
 
Regards, Dave.