Re: Porting from PL/SQL to PLPGSQL

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

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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2003-08-13 19:38:29 Re: Why table has drop, but the foreign key still there?
Previous Message krystoffff 2003-08-13 18:54:16 Re: How to optimize this query ?