RE: Pseudocode / Pseudo-Types

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




-----Original Message-----
From: Laurenz Albe <laurenz.albe@xxxxxxxxxxx> 
Sent: maandag 15 maart 2021 15:15
To: Bhattacharjee, Soumik <soumik.bhattacharjee@xxxxxxx>; pgsql-admin@xxxxxxxxxxxxxx
Subject: Re: Pseudocode / Pseudo-Types

On Mon, 2021-03-15 at 13:55 +0000, soumik.bhattacharjee@xxxxxxx 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



Thanks for the information...




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux