Re: how plsql work on postgresql

From: Michael Moore <michaeljmoore(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Selina Tech <swucareer99(at)gmail(dot)com>, "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: how plsql work on postgresql
Date: 2016-03-30 15:23:38
Message-ID: CACpWLjNM-Z34qTe4WwmbC6CdKQso6q0BRpy8bYwOxYG7w2QSbw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Tue, Mar 29, 2016 at 4:19 PM, David G. Johnston <
david(dot)g(dot)johnston(at)gmail(dot)com> wrote:

> On Tue, Mar 29, 2016 at 3:57 PM, Selina Tech <swucareer99(at)gmail(dot)com>
> wrote:
>
>> Hi, All
>>
>> I just start to learn plsql and plpgsql. There are a lot of
>> comparison of pl/sql and pl/pgsql available online. I am wondering why
>> plsql work well on Postgresql and how it work? Is the code converted to
>> plpgsql code?
>> If use postgresql database server, which one is better between
>> plsql and pl/pgsql?
>>
>>
>> Your feedback is highly appreciated.
>>
>>
> ​It isn't "plsql", just "SQL" - but I might be losing something in the
> translation. "pl/sql" is an Oracle thing that is indeed like "pl/pgsql" -
> but "pl/sql" does not directly work, let alone well, on PostgreSQL...
>
> Anyway, writing a function in "LANGUAGE sql" means you are limited to only
> those things SQL can do. Using pl/pgsql gives you access to the power of
> procedural logic among other things.
>
> There is no "better" - but the general rule is if it can be done using SQL
> then do so since you are likely to see better performance. When you need
> to do something SQL cannot do then consider pl/pgsql.
>
> David J.
>
> Like David has said, it is not clear what you are talking about.

- PL/SQL runs only on an Oracle DB
- SQL - there is a Postgres version for Postgres and an Oracle version
for Oracle
- SPL - This is a language that is added on to Postgres and it is
intended to be as much like Oracle PL/SQL as is possible. It allows people
to migrate from Oracle to Postgres with minimal changes to code.
- PL/PGSQL this is Postgres only. It is kind of like PL/SQL but also
very different. I prefer this over SPL because, IMO, it performs better.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Thomas Kellerer 2016-03-30 15:37:27 Re: how plsql work on postgresql
Previous Message David G. Johnston 2016-03-29 23:19:19 Re: how plsql work on postgresql