Re: converting Oracle to postgres - Mailing list pgsql-general

From Berend Tober
Subject Re: converting Oracle to postgres
Date
Msg-id 65271.216.238.112.88.1044647379.squirrel@$HOSTNAME
Whole thread Raw
In response to converting Oracle to postgres  (RobertD.Stewart@mail.state.ky.us)
List pgsql-general
> Here is the error I get when trying to create the trigger
> ERROR:  CreateTrigger: function set_username1() does not exist
> How do I create a function that can be seen by a trigger command.
> When I create my function I get no errors and I'm able to see the
> function.
>
>
> Here is my sql command to create my trigger
>
> CREATE TRIGGER trg_setuser1
> BEFORE INSERT
> ON eventlogs
> FOR EACH ROW
> EXECUTE PROCEDURE set_username1 ("
>   if (username is NULL) then
>     select (eventtype, message) into username from dual;
>   end if;
> END;");
>

It looks to me like your call to set_username1 in the trigger has only a
single argument, whereas the definition of the stored procedure
set_username1 has two arguments. I think PostgreSQL considers them
different functions if the argument list does not match.

>
>
>> Here is a copy of my function in oracle. ...
>
> Have you RT(Fine)M? (In particular section 19.11. "Porting from Oracle
> PL/SQL"). After you have read that, then what specifically is the
> difficulty you are having?

I apologize for being a bit of a smart-ass, but it wasn't readily
apparent to me from your original post that you had tried or read
anything to solve the problem yourself.

Regards,
Berend




pgsql-general by date:

Previous
From: Mikhail Terekhov
Date:
Subject: Re: How to make a dictoinary list of a query result
Next
From: Jonathan Ellis
Date:
Subject: corruption bug in 7.2.3-RH