agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Larry Rosenman <ler@lerctr.org>
Cc: pgsql-sql@postgresql.org
Subject: Re: create index on a jsonb timestamp field?
Date: Sun, 19 May 2019 15:55:54 -0400
Message-ID: <7511.1558295754@sss.pgh.pa.us> (raw)
In-Reply-To: <8b5563be3bf7f0ae9826b223b61fa22d@lerctr.org>
References: <78a5d1232bb5ef5797a8ae6e1f23543f@lerctr.org>
	<29956.1558228655@sss.pgh.pa.us>
	<8b5563be3bf7f0ae9826b223b61fa22d@lerctr.org>

Larry Rosenman <ler@lerctr.org> writes:
> On 05/18/2019 8:17 pm, Tom Lane wrote:
>> BTW, I'd had the idea that the GENERATED option in PG v13 would allow
>> setting up this sort of case without bothering with a handwritten 
>> trigger, but it seems not:
>> 
>> regression=# create table foo(data jsonb, ts timestamptz GENERATED
>> ALWAYS AS ((data->>'ts')::timestamptz) stored);
>> psql: ERROR:  generation expression is not immutable
>> 
>> I wonder if that's really necessary to insist on?

> Good question.  Is that something the project is going to look into?

Well, I was just asking the question, not opining on whether it
was right or wrong.  GENERATED is a SQL-spec feature, and it might
be that the semantics the spec calls for wouldn't work without
the restriction.  I've not looked...

			regards, tom lane





view thread (5+ messages)

Message-ID: <7511.1558295754@sss.pgh.pa.us>
Permalink:  ../7511.1558295754@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/7511.1558295754@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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, ler@lerctr.org
  Subject: Re: create index on a jsonb timestamp field?
  In-Reply-To: <7511.1558295754@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 agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox