Re: converting Oracle to postgres

From: "Berend Tober" <btober(at)seaworthysys(dot)com>
To: <RobertD(dot)Stewart(at)mail(dot)state(dot)ky(dot)us>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: converting Oracle to postgres
Date: 2003-02-07 19:49:39
Message-ID: 65271.216.238.112.88.1044647379.squirrel@$HOSTNAME
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-general by date

  From Date Subject
Next Message Jonathan Ellis 2003-02-07 20:10:38 corruption bug in 7.2.3-RH
Previous Message Mikhail Terekhov 2003-02-07 19:27:23 Re: How to make a dictoinary list of a query result