Re: pl/pgsql outside the DB, (i.e. on the terminal) possible ? - Mailing list pgsql-general

From Robert Treat
Subject Re: pl/pgsql outside the DB, (i.e. on the terminal) possible ?
Date
Msg-id CABV9wwOKuMQ-L5zRhtxAy4jLvu8RPyhOAAb3KM0nOkvYQbmfcA@mail.gmail.com
Whole thread Raw
In response to Re: pl/pgsql outside the DB, (i.e. on the terminal) possible ?  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: pl/pgsql outside the DB, (i.e. on the terminal) possible ?
List pgsql-general
On Thu, Mar 7, 2024 at 11:26 AM Pavel Stehule <pavel.stehule@gmail.com> wrote:
> čt 7. 3. 2024 v 16:59 odesílatel Christophe Pettus <xof@thebuild.com> napsal:
>> > On Mar 7, 2024, at 06:56, Achilleas Mantzios - cloud <a.mantzios@cloud.gatewaynet.com> wrote:
>> > So, I ask, have there been any efforts to bring PL/PGSQL to the terminal?
>>
>> Strictly speaking, of course, you can use PL/pgSQL from the terminal already: just use psql, connect to the
database,and create and run functions and procedures as much as you like. 
>>
>> If the question is, "Have there been any efforts to implement a PL/pgSQL interpreter without PostgreSQL?", that's a
differentand much more complex problem.  PL/pgSQL uses the PostgreSQL query execution machinery to run pretty much
anythingthat is not a control structure, and the language is very focused on interacting with the database.  I doubt it
wouldbe worth anyone's time to try to build some kind of minimal framework that implements the SPI to allow PL/pgSQL to
operatewithout PostgreSQL. 
>
>
> yes
>
> plpgsql cannot exist without Postgres. PL/pgSQL is strongly reduced interpreted Ada language. The gcc compiler
supportsAda language. 
>
> I found https://bush.sourceforge.net/bushref.html - it is interpret with Ada syntax, but it is better to learn Python
-it is easy - with a pretty big library. 
>
> free pascal https://www.freepascal.org/ is good compiler and you can write terminal applications too - with Turbo
Vision
>

Of course there's a certain amount of personal preference with all
this stuff. I started with basic and really liked it, and then had to
learn pascal and hated it so much that I decided to eschew programming
for years. If you are just trying to learn for fun, I see no reason
why SQL, paired with data in a database, wouldn't be worth spending
time on. Once you're comfortable with that, I like ruby on the command
line and it interacts nicely with databases, and also works well
within the rails console. That said, my son liked lua when he was a
kid, so yeah, there's lots of options, even if plpgsql on the command
line isn't strictly one of them.

Robert Treat
https://xzilla.net



pgsql-general by date:

Previous
From: Markur Sens
Date:
Subject: Re: pl/pgsql outside the DB, (i.e. on the terminal) possible ?
Next
From: Achilleas Mantzios
Date:
Subject: Re: pl/pgsql outside the DB, (i.e. on the terminal) possible ?