Stored procedures in PL/PGSQL

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • FET

    Stored procedures in PL/PGSQL

    Hello,
    I am in a bit of a conflict here. I would like to know if the stored
    procedures that I write in PL/PGSQL to run on PostgreSQL 7.4.2 are
    ANSI compliant. The point of asking this question is whether my stored
    procedure needs to undergo a lot of change if I port it to some other
    database like Oracle or MSSQL Server.

    Thank you in advance,

    Best regards.
  • Stu

    #2
    Re: Stored procedures in PL/PGSQL

    The logic won't change, but the syntax will. It's kind of like asking, "if
    I write a program in C++ will it be easy to port to Java?" PL/PGSQL is a
    language, different vendors use different languages--MS SQL Server and
    Sybase use Transact-SQL (they have a shared history, that's why they use
    the same language), Oracle uses PL/SQL, Firebird uses PSQL, etc.

    As for ANSI compliant, ANSI added Persistent Stored Modules (SQL/PSM) in
    SQL99, to address the portability issue, but I don't think any vendor has
    done a complete implementation of it yet.


    Stu


    FET wrote:
    [color=blue]
    > Hello,
    > I am in a bit of a conflict here. I would like to know if the stored
    > procedures that I write in PL/PGSQL to run on PostgreSQL 7.4.2 are
    > ANSI compliant. The point of asking this question is whether my stored
    > procedure needs to undergo a lot of change if I port it to some other
    > database like Oracle or MSSQL Server.
    >
    > Thank you in advance,
    >
    > Best regards.[/color]

    Comment

    • Christopher Browne

      #3
      Re: Stored procedures in PL/PGSQL

      bilaribilari@ya hoo.com (FET) wrote:[color=blue]
      > Hello,
      > I am in a bit of a conflict here. I would like to know if the stored
      > procedures that I write in PL/PGSQL to run on PostgreSQL 7.4.2 are
      > ANSI compliant. The point of asking this question is whether my stored
      > procedure needs to undergo a lot of change if I port it to some other
      > database like Oracle or MSSQL Server.[/color]

      NO system supports an "ANSI compliant" stored procedure language at
      this point in time. Not PostgreSQL, not Oracle, not Microsoft SQL
      Server.

      It seems likely that a project may emerge in 7.6 or so to build one,
      but in view of there not being _any_ compliant system, it hasn't
      emerged as a priority.
      --
      wm(X,Y):-write(X),write( '@'),write(Y). wm('cbbrowne',' acm.org').

      Rules of the Evil Overlord #10. "I will not interrogate my enemies in
      the inner sanctum -- a small hotel well outside my borders will work
      just as well." <http://www.eviloverlor d.com/>

      Comment

      Working...