Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1riICI-00GFWi-NK for pgsql-general@arkaria.postgresql.org; Thu, 07 Mar 2024 18:10:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1riICG-007jsZ-Un for pgsql-general@arkaria.postgresql.org; Thu, 07 Mar 2024 18:10:25 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1riICG-007jsQ-K1 for pgsql-general@lists.postgresql.org; Thu, 07 Mar 2024 18:10:25 +0000 Received: from cloud.gatewaynet.com ([185.90.37.94]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1riICC-003Lwz-Q9 for pgsql-general@lists.postgresql.org; Thu, 07 Mar 2024 18:10:23 +0000 Content-Type: multipart/alternative; boundary="------------gmgd8A1vmPdEPPYmaR0OBViB" Message-ID: Date: Thu, 7 Mar 2024 20:10:18 +0200 MIME-Version: 1.0 Subject: Re: pl/pgsql outside the DB, (i.e. on the terminal) possible ? Content-Language: en-US To: Pavel Stehule , Christophe Pettus Cc: pgsql-general@lists.postgresql.org References: <596a6961-553e-3781-7aed-9dba969a18a5@cloud.gatewaynet.com> <405C1494-7432-442B-AB28-EE04D38E989B@thebuild.com> From: Achilleas Mantzios In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------gmgd8A1vmPdEPPYmaR0OBViB Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Στις 7/3/24 18:25, ο/η Pavel Stehule έγραψε: > > > čt 7. 3. 2024 v 16:59 odesílatel Christophe Pettus > napsal: > > > > > On Mar 7, 2024, at 06:56, Achilleas Mantzios - cloud > 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 different and > much more complex problem.  PL/pgSQL uses the PostgreSQL query > execution machinery to run pretty much anything that is not a > control structure, and the language is very focused on interacting > with the database. I doubt it would be worth anyone's time to try > to build some kind of minimal framework that implements the SPI to > allow PL/pgSQL to operate without PostgreSQL. > > > yes > > plpgsql cannot exist without Postgres. PL/pgSQL is strongly reduced > interpreted Ada language. The gcc compiler supports Ada 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. Cool, thank you. > > free pascal https://www.freepascal.org/ is good compiler and you can > write terminal applications too - with Turbo Vision Too bad, PASCAL is now neglected by most UNIs :( > > Regards > > Pavel -- Achilleas Mantzios IT DEV - HEAD IT DEPT Dynacom Tankers Mgmt (as agents only) --------------gmgd8A1vmPdEPPYmaR0OBViB Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
Στις 7/3/24 18:25, ο/η Pavel Stehule έγραψε:


č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 different and much more complex problem.  PL/pgSQL uses the PostgreSQL query execution machinery to run pretty much anything that is not a control structure, and the language is very focused on interacting with the database.  I doubt it would be worth anyone's time to try to build some kind of minimal framework that implements the SPI to allow PL/pgSQL to operate without PostgreSQL.

yes

plpgsql cannot exist without Postgres. PL/pgSQL is strongly reduced interpreted Ada language. The gcc compiler supports Ada 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.
Cool, thank you.

free pascal https://www.freepascal.org/ is good compiler and you can write terminal applications too - with Turbo Vision
Too bad, PASCAL is now neglected by most UNIs :(

Regards

Pavel
-- 
Achilleas Mantzios
 IT DEV - HEAD
 IT DEPT
 Dynacom Tankers Mgmt (as agents only)
--------------gmgd8A1vmPdEPPYmaR0OBViB--