pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: soumik.bhattacharjee@kpn.com
To: pgsql-admin@postgresql.org
Subject: Re: Pseudocode / Pseudo-Types
Date: Mon, 15 Mar 2021 15:14:34 +0100
Message-ID: <f51661770a45ce6c28aa2a39badf2e7769853e42.camel@cybertec.at> (raw)
In-Reply-To: <7af47a45b89d4ce2bd4a03179e6bb373@kpn.com>
References: <7af47a45b89d4ce2bd4a03179e6bb373@kpn.com>

On Mon, 2021-03-15 at 13:55 +0000, soumik.bhattacharjee@kpn.com wrote:
> Has anybody has a use case for using Pseudocode / Pseudo-Types?
> 
> Any inputs will be helpful and if any reference sites to check some example use cases are also good to start with.
> 
> Thanks in advance...

Pseudocode, as in

  while (there is something to do)
     process_one_item();

is a tool to write down an algorithm in a way that is easy for
programmers to understand.

Pseudo-types, as in
https://www.postgresql.org/docs/current/datatype-pseudo.html
are something entirely different.

Here is a useful example:

CREATE FUNCTION successor(anyelement) RETURNS anyelement
   LANGUAGE sql AS 'SELECT $1 + 1';

SELECT successor(41);

 successor 
-----------
        42
(1 row)

SELECT successor(current_date);

 successor  
------------
 2021-03-16
(1 row)

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com






view thread (5+ messages)  latest in thread

Message-ID: <f51661770a45ce6c28aa2a39badf2e7769853e42.camel@cybertec.at>
Permalink:  ../f51661770a45ce6c28aa2a39badf2e7769853e42.camel@cybertec.at/
Also on:    postgresql.org/message-id/f51661770a45ce6c28aa2a39badf2e7769853e42.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: laurenz.albe@cybertec.at, soumik.bhattacharjee@kpn.com
  Subject: Re: Pseudocode / Pseudo-Types
  In-Reply-To: <f51661770a45ce6c28aa2a39badf2e7769853e42.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox