pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Lewis <mlewis@entrata.com>
Cc: PostgreSQL General <pgsql-general@lists.postgresql.org>
Subject: Re: Default values in functions
Date: Wed, 29 Dec 2021 19:28:07 -0500
Message-ID: <2184626.1640824087@sss.pgh.pa.us> (raw)
In-Reply-To: <CAHOFxGo0oC=vU8NXXGPMMWGxWxzu917EE-ZFD5OW0T6pE7CzHQ@mail.gmail.com>
References: <CAHOFxGpqLtuayEUxVZ5wmpdTp+y6m_VbVWw=zhCrNi1_TcEeQQ@mail.gmail.com>
	<2179735.1640820664@sss.pgh.pa.us>
	<CAHOFxGo0oC=vU8NXXGPMMWGxWxzu917EE-ZFD5OW0T6pE7CzHQ@mail.gmail.com>

Michael Lewis <mlewis@entrata.com> writes:
> Understood. My hope is to pass a parameter that gets overridden by the
> default so that I can pass other parameters that come after.

As David explained, function parameters don't work that way.
You could mechanize something like substitute-a-default-for-
null-input, but you'll have to do it with explicit logic.

			regards, tom lane





view thread (8+ messages)  latest in thread

Message-ID: <2184626.1640824087@sss.pgh.pa.us>
Permalink:  ../2184626.1640824087@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2184626.1640824087@sss.pgh.pa.us

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, mlewis@entrata.com
  Subject: Re: Default values in functions
  In-Reply-To: <2184626.1640824087@sss.pgh.pa.us>
  References: <CAHOFxGpqLtuayEUxVZ5wmpdTp+y6m_VbVWw=zhCrNi1_TcEeQQ@mail.gmail.com> <2179735.1640820664@sss.pgh.pa.us> <CAHOFxGo0oC=vU8NXXGPMMWGxWxzu917EE-ZFD5OW0T6pE7CzHQ@mail.gmail.com> <2184626.1640824087@sss.pgh.pa.us>

* 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