From: Tom Lane <tgl@sss.pgh.pa.us>
To: Uriy Zhuravlev <u.zhuravlev@postgrespro.ru>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Some questions about the array.
Date: Mon, 21 Dec 2015 12:28:43 -0500
Message-ID: <2853.1450718923@sss.pgh.pa.us> (raw)
In-Reply-To: <6ac195fe-b835-4d2d-8edc-11db52118cbf@postgrespro.ru>
References: <2987745.PueTkqGxbO@dinodell>
<1538864.xaPm21N10Q@dinodell>
<56619AB0.2070802@sigaev.ru>
<2723429.ZaCixaFn1x@dinodell>
<6ac195fe-b835-4d2d-8edc-11db52118cbf@postgrespro.ru>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Uriy Zhuravlev <u.zhuravlev@postgrespro.ru> writes:
>> I'm dubious that the parsetree representation is well-chosen.
>> Probably a single is_slice flag would have been better.
> What do you mean? This flag is for what? You are about the A_Indices
> node(lidx_default/uidx_default)?
Yes. Those flags are partially redundant with the subtree pointers being
NULL, and there are combinations that would be invalid (such as
lidx_default being set but lidx not being null), and it's pretty unobvious
what the difference in representation is between a non-slice case and a
slice case with only the upper index provided. In fact, since you have
five syntaxes to represent, it's impossible for the two bools to
distinguish them all, which means that at least one case *must* be
identified by null-ness of a pointer contradicting what the corresponding
bool's setting would imply. So this just seems like a mess to me.
I think it would come out cleaner if you had just one bool is_slice,
which corresponds directly to whether a colon was present. The four
sub-possibilities of colon notation would be represented by combinations
of null and non-null lidx and uidx. With is_slice false, the only valid
case is lidx==NULL, uidx!=NULL, as before for non-slice notation.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
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-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, u.zhuravlev@postgrespro.ru
Subject: Re: Some questions about the array.
In-Reply-To: <2853.1450718923@sss.pgh.pa.us>
References: <2987745.PueTkqGxbO@dinodell> <1538864.xaPm21N10Q@dinodell> <56619AB0.2070802@sigaev.ru> <2723429.ZaCixaFn1x@dinodell> <6ac195fe-b835-4d2d-8edc-11db52118cbf@postgrespro.ru> <2853.1450718923@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