Re: set_config() documentation clarification

From: Chapman Flack <chap(at)anastigmatix(dot)net>
To: Joel Jacobson <joel(at)compiler(dot)org>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: set_config() documentation clarification
Date: 2021-01-05 22:07:28
Message-ID: 5FF4E320.5020407@anastigmatix.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 01/05/21 16:14, Joel Jacobson wrote:
> or maybe even WITH like this:
>
> WITH
> year % 19 AS g ,
> year / 100 AS c,
> (c - c/4 - (8*c + 13)/25 + 19*g + 15) % 30 AS h,
> h - (h/28)*(1 - (h/28)*(29/(h + 1))*((21 - g)/11)) AS i,
> year + year/4 + i + 2 - c + c/4) % 7 AS j,
> i - j AS p,
> 3 + (p + 26)/30 AS easter_month,
> 1 + (p + 27 + (p + 6)/40) % 31 AS easter_day
> SELECT make_date(year, easter_month, easter_day)

The standard indeed has such a syntax ... not for entirely arbitrary
variables like that (at least not that I've seen) but definitely for
lexically-scoped settings of things like XMLOPTION or XMLBINARY.

Regards,
-Chap

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2021-01-05 22:22:24 Re: Context diffs
Previous Message Peter Geoghegan 2021-01-05 21:54:30 Re: Deleting older versions in unique indexes to avoid page splits