Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lLnzU-0001mw-JA for pgsql-admin@arkaria.postgresql.org; Mon, 15 Mar 2021 14:14:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lLnzT-0003q9-Gb for pgsql-admin@arkaria.postgresql.org; Mon, 15 Mar 2021 14:14:39 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lLnzT-0003q0-8v for pgsql-admin@lists.postgresql.org; Mon, 15 Mar 2021 14:14:39 +0000 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lLnzR-0007gC-45 for pgsql-admin@postgresql.org; Mon, 15 Mar 2021 14:14:38 +0000 Received: by mail-ed1-x532.google.com with SMTP id h10so17490103edt.13 for ; Mon, 15 Mar 2021 07:14:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=5/fM3C2SpT3d/HPnT3EWibwyqojVkLfJOoHobw0H5Wk=; b=M2m+S23zbFP+0uY0258guf0yByhbhQXaegsRID/l5wv4td9N20jSoYYgBbBhix1+Ol CKQMVMLfpL5HZCNoS8MYHcBrcZMyGMZwlYm2pGxM6UC4iikqf9y2HTflg6AfjAEXMQAL nnqfE09J/6KFvCPeQ/Niwitg+FNE/hoJiOohNxM5cb7GXl1tySDBY9F0jg8CcNCAXNdB M/kLfWZGgNXVDkPcFmcFl/kdlyffsvrKNQzMd6DPmHWkGUym2TlUNmFjbxTPv6FvFhkP La/vh8HyyHGVYlmLyiiyC7vO2zpKYQKiREyiE//RrRnxUN0Y+B1iYxWR5dzJFPG3RG9l f3AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=5/fM3C2SpT3d/HPnT3EWibwyqojVkLfJOoHobw0H5Wk=; b=nINLzWIoGJs+BNy3nclLdUah5Mz0ag0Q5kggKtu0gvCwOqK5KhlFaIEGpwraxiUqY7 u3jrtAeFRLFwZBCWUZRjTxIiM4XFMM3STPyBs/mFebM8vrVr5mkdYzaRLb1Hg4Ei5CYj HfQr9MOq/qAa81GD8jVCKK0f7OzAoOqEXFRRuEydkpex50Eg1bah0DbXCZwo3O+MAu9i 47zEKB2Vfk4Qntl9IDkbWCDC1yMlH2PTXtL/VTa7Hgtt9RfGUmAKBbGLM3sYb0X5hq5A J54jSxlpeJNCK6/aUc4apzVCUsleJSxWnOArZMetXSGtLmkrYdsYVlFjWTKZAH4y1Jk0 13Xw== X-Gm-Message-State: AOAM532bTBf+fhEIy/4ZXj4W8MHpK3/mip89EvCjrUskX26IyP+2SMWm z3KGEt816KiQRVhVj83Cf7rIYQ== X-Google-Smtp-Source: ABdhPJwjOdTjlJR31IhguG72rvrHxbNQSan4zybSyfelCdWVdJ0jqJoSjSmpAXgwfz2f5/CawgGtng== X-Received: by 2002:a05:6402:484:: with SMTP id k4mr29793079edv.321.1615817675616; Mon, 15 Mar 2021 07:14:35 -0700 (PDT) Received: from localhost.localdomain (217-149-171-45.nat.highway.telekom.at. [217.149.171.45]) by smtp.gmail.com with ESMTPSA id ho11sm7162610ejc.112.2021.03.15.07.14.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Mar 2021 07:14:35 -0700 (PDT) Message-ID: Subject: Re: Pseudocode / Pseudo-Types From: Laurenz Albe To: soumik.bhattacharjee@kpn.com, pgsql-admin@postgresql.org Date: Mon, 15 Mar 2021 15:14:34 +0100 In-Reply-To: <7af47a45b89d4ce2bd4a03179e6bb373@kpn.com> References: <7af47a45b89d4ce2bd4a03179e6bb373@kpn.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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