pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feed@> (contains)
3+ messages / 3 participants
[nested] [flat]
Commits from this thread:
2019-09-23 13cd97e6c8 216bcf5838 7cd99d3947 184b5fad00 65cddf70aa 70c1245064 0652c3992e Doc: clarify handling of duplicate elements in array containment tests.
* @> (contains)
@ 2019-08-18 15:13 PG Doc comments form <noreply@postgresql.org>
0 siblings, 1 reply; 3+ messages in thread
From: PG Doc comments form @ 2019-08-18 15:13 UTC (permalink / raw)
To: pgsql-docs@lists.postgresql.org; +Cc: php.pl.prices@gmail.com
The following documentation comment has been logged on the website:
Page: https://www.postgresql.org/docs/9.6/functions-array.html
Description:
Hi.
Noticed strange thin with @>
Query "select '{1,2}'::int[] @> '{1,2,2,2,2,2,2,2}'::int[]" returns true,
but first array contains even less elements then second.
I think it's a bug in "contains" logic, but don't know where to submit it.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: @> (contains)
@ 2019-08-18 16:19 David G. Johnston <david.g.johnston@gmail.com>
parent: PG Doc comments form <noreply@postgresql.org>
0 siblings, 1 reply; 3+ messages in thread
From: David G. Johnston @ 2019-08-18 16:19 UTC (permalink / raw)
To: php.pl.prices@gmail.com; pgsql-docs@lists.postgresql.org
On Sun, Aug 18, 2019 at 8:53 AM PG Doc comments form <noreply@postgresql.org>
wrote:
> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/9.6/functions-array.html
> Description:
>
> Hi.
> Noticed strange thin with @>
> Query "select '{1,2}'::int[] @> '{1,2,2,2,2,2,2,2}'::int[]" returns true,
> but first array contains even less elements then second.
> I think it's a bug in "contains" logic, but don't know where to submit it.
>
Its a valid interpretation of "contains", for this purpose each array is
treated like a set (ignoring the cardinality of elements, and overall
dimensionality), but it needs to be documented as behaving that way on that
page. I don't see that its documented anywhere for that matter. The
source code documents that dimensions are ignored but is silent on
duplication of elements:
array_contain_compare:
/*-----------------------------------------------------------------------------
* array overlap/containment comparisons
* These use the same methods of comparing array elements as array_eq.
* We consider only the elements of the arrays, ignoring dimensionality.
*----------------------------------------------------------------------------
*/
David J.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: @> (contains)
@ 2019-09-23 16:56 Tom Lane <tgl@sss.pgh.pa.us>
parent: David G. Johnston <david.g.johnston@gmail.com>
0 siblings, 0 replies; 3+ messages in thread
From: Tom Lane @ 2019-09-23 16:56 UTC (permalink / raw)
To: David G. Johnston <david.g.johnston@gmail.com>; +Cc: php.pl.prices@gmail.com; pgsql-docs@lists.postgresql.org
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Sun, Aug 18, 2019 at 8:53 AM PG Doc comments form <noreply@postgresql.org>
>> Noticed strange thin with @>
>> Query "select '{1,2}'::int[] @> '{1,2,2,2,2,2,2,2}'::int[]" returns true,
>> but first array contains even less elements then second.
>> I think it's a bug in "contains" logic, but don't know where to submit it.
> Its a valid interpretation of "contains", for this purpose each array is
> treated like a set (ignoring the cardinality of elements, and overall
> dimensionality), but it needs to be documented as behaving that way on that
> page.
Done now.
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2019-09-23 16:56 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-08-18 15:13 @> (contains) PG Doc comments form <noreply@postgresql.org>
2019-08-18 16:19 ` David G. Johnston <david.g.johnston@gmail.com>
2019-09-23 16:56 ` Tom Lane <tgl@sss.pgh.pa.us>
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