Re: Porting from PL/SQL to PLPGSQL

From: Jomon Skariah <jomons(at)aztec(dot)soft(dot)net>
To: josh(at)agliodbs(dot)com, pgsql-sql(at)postgresql(dot)org
Subject: Re: Porting from PL/SQL to PLPGSQL
Date: 2003-08-14 08:19:05
Message-ID: F83B457BE363174B8233DE042A1445703E2412@maya.aztec.soft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi Josh,

Thanks for your reply.

In our PL/SQL code we have used userenv('LANG') in some of the INSERT
statements.
Do we have a replacement for this..

Regards

Jomon

-----Original Message-----
From: Josh Berkus [mailto:josh(at)agliodbs(dot)com]
Sent: Thursday, August 14, 2003 1:05 AM
To: Jomon Skariah; pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] Porting from PL/SQL to PLPGSQL

Jomon,

> 1) In Exceptions ORACLE have something called WHEN OTHERS THEN cluase.I
> can't find a replacement for that in
> PostGreSQL.

PL/pgSQL currently does not handle exceptions at all. This is on the TODO
list.

> 2 Oracle have a function USERENV to get the user session
> information.Is there any replacement available in PostGres. ?

There are several variables and tools which provide current user and session

information. See the "PostgreSQL Administration" section of the
documentation.

> 3 Is there any replace available for INSTEAD OF INSERT/DELETE/UPDATE
> for triggers in PostGreSQL.

In Postgres, this is generally done through the RULES system instead of
triggers. Please lookup CREATE RULE in the online docs.

--
-Josh Berkus
Aglio Database Solutions
San Francisco

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2003-08-14 11:20:06 Re: Timezone troubles
Previous Message Tomasz Myrta 2003-08-14 06:18:46 independent sequence for each month