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 1riGm1-00G5TE-Vp for pgsql-general@arkaria.postgresql.org; Thu, 07 Mar 2024 16:39:14 +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 1riGlz-006nYx-Qx for pgsql-general@arkaria.postgresql.org; Thu, 07 Mar 2024 16:39:12 +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 1riGlz-006nYo-C6 for pgsql-general@lists.postgresql.org; Thu, 07 Mar 2024 16:39:11 +0000 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1riGlv-003L8z-T2 for pgsql-general@lists.postgresql.org; Thu, 07 Mar 2024 16:39:10 +0000 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a458850dbddso178151066b.0 for ; Thu, 07 Mar 2024 08:39:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709829547; x=1710434347; darn=lists.postgresql.org; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=B0J0C8iNrn/JNkYGyANE75IKI+YYOvJ38ujnAhoIyig=; b=AG/FDy5MwucTezGxxBJlJ9MdS9Hraj/jy2nMZ1i+K11/6rQ3Yj6un2cMub6TvkM8fH l+dE/fSkczylzhzsUuux8BP20bNC8RWgUdDCsHqeM1Rk7vyJ0uhXcKUZmurld6jC3MQ0 stZGIIw3aEBDh5IlZ+FGNSN0vw+yZW9EXsqJcXCm7f/na0d+LZ15NJ44B9kQuDoqfdo+ yCRNBuwf0YPQRHgN3joaej1Nq4jvT9QjJS5sErGnBILienazN36EhuWWmnjTTGOStfp/ iTgE0SG/51teummDY7hQAxx0o+PZi76gPbnO+nHXXoTf55uf6gyry9Z1ibQh/VNsqb+m NsGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709829547; x=1710434347; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=B0J0C8iNrn/JNkYGyANE75IKI+YYOvJ38ujnAhoIyig=; b=ZqfgF2XQM4Lju1DF6Ee6/u1apNxxRwAWFUMVPfnqhreJdIL+7kOrFHF7Ghua37/Foc Nr3oWny4YqEuQxF2HJVF3R99dT8Sl9/NgT6z5lZQRxNy05aPXV9ID9cHbNCVV2jYSzPW SUntzx2z3VNFVA3z7m9VDu12ae+QN9+06+FAjQB6/wWpmXMYPoZ6CF0H4DBRpXUQfAzY 69ku0rVVe3KUnLJ1zSd1zaOLGhwxmc+SZnY6Znlpt/7JCxVLZ/XTOCBahlctNAY8KwX9 bNgZwKPcH7/ftbrCojNto4dMRf3rUH19vmz/otEutSb5O6QU7ldrJlH+Z2588FPNBXu9 rZIw== X-Gm-Message-State: AOJu0YyWaL/q6O+OYe9iuZaK27Rqgjtz5H5jFDuScYtNWDIwruq62amo es9nP4PbCRySQIIrNWZnTOQBzgckWO59ieJ3mRo+pkQa7Ptpx58uc2nmKVoQu/M= X-Google-Smtp-Source: AGHT+IGkadquYKOB7MSvzdEU2nOq9fNYwwfEnD2CRkx1F51pqXaGNkUmt5ObhMRcHClKVxHX1vbM4w== X-Received: by 2002:a17:906:aac8:b0:a3f:9f38:ded with SMTP id kt8-20020a170906aac800b00a3f9f380dedmr11527995ejb.69.1709829547294; Thu, 07 Mar 2024 08:39:07 -0800 (PST) Received: from smtpclient.apple ([2a02:2149:8642:fc00:c7c:e4bf:2345:7bed]) by smtp.gmail.com with ESMTPSA id bw16-20020a170906c1d000b00a3fb9f1f10csm8408658ejb.161.2024.03.07.08.39.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Mar 2024 08:39:06 -0800 (PST) From: Markur Sens Message-Id: <27B68073-77D0-443B-9102-078C2D780FC2@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_D2DC10FE-EB1F-4B43-BCDA-ECE93D78696D" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.300.61.1.2\)) Subject: Re: pl/pgsql outside the DB, (i.e. on the terminal) possible ? Date: Thu, 7 Mar 2024 18:38:54 +0200 In-Reply-To: <596a6961-553e-3781-7aed-9dba969a18a5@cloud.gatewaynet.com> Cc: pgsql-general@lists.postgresql.org To: Achilleas Mantzios - cloud References: <596a6961-553e-3781-7aed-9dba969a18a5@cloud.gatewaynet.com> X-Mailer: Apple Mail (2.3774.300.61.1.2) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_D2DC10FE-EB1F-4B43-BCDA-ECE93D78696D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 7 Mar 2024, at 4:56=E2=80=AFPM, Achilleas Mantzios - cloud = wrote: >=20 > Hello >=20 > I notice both my kids struggling with either C or Python as first = programming languages. I believe both are unsuitable for use as = introductory languages to college juniors. https://scratch.mit.edu/ would be more suitable, maybe ?=20 >=20 > Python IMHO is too advanced, too rich, weird indentation rules, no = simple for loop etc. >=20 > C, ok, punishing little kids with segmentation faults, calling by = value VS by reference and 3ple pointers is pure sadism. >=20 > So this brings me to memory good old PASCAL from the time I was = junior, circa 1986. PL/SQL resembles PASCAL heavily. Everything seems = well defined, strong typing, simplicity, I think it has everything a = programming language should have in order to be taught as an = introductory language. But it lacks IO and file handling. >=20 > So, I ask, have there been any efforts to bring PL/PGSQL to the = terminal? Imho the best you can do is bash + psql + pl/pgsql , via heredocs . pql <=20 > Thanks! >=20 >=20 >=20 --Apple-Mail=_D2DC10FE-EB1F-4B43-BCDA-ECE93D78696D Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On 7 Mar 2024, at 4:56=E2=80=AFPM, Achilleas Mantzios = - cloud <a.mantzios@cloud.gatewaynet.com> wrote:

Hello

I notice both = my kids struggling with either C or Python as first programming = languages. I believe both are unsuitable for use as introductory = languages to college = juniors.

https://scratch.mit.edu/ would = be more suitable, maybe ? 


Python IMHO is too advanced, too rich, weird = indentation rules, no simple for loop etc.

C, ok, punishing = little kids with segmentation faults, calling by value VS by reference = and 3ple pointers is pure sadism.

So this brings me to memory = good old PASCAL from the time I was junior, circa 1986. PL/SQL resembles = PASCAL heavily. Everything seems well defined, strong typing, = simplicity, I think it has everything a programming language should have = in order to be taught as an introductory language. But it lacks IO and = file handling.

So, I ask, have there been any efforts to bring = PL/PGSQL to the = terminal?

Imho the best = you can do is bash + psql + pl/pgsql , via heredocs .
pql = <<EOF
<pgsql code.
EOF
It does = require lot=E2=80=99s of care with variables  though https://www.depesz.com/2023/05/28/variables-in-psql-how-to-use-them/



Thanks!




= --Apple-Mail=_D2DC10FE-EB1F-4B43-BCDA-ECE93D78696D--