Re: "two time periods with only an endpoint in common do not overlap" ???

2021-10-15 Thread David G. Johnston
On Friday, October 15, 2021, Ron wrote: > > Prima facie, if you were told "numbers in the range 0-10", would you > really think, "ah, they *really* mean 0 through 9"? > > I would indeed default to both endpoints of the range being inclusive. I also begin counting at one, not zero. I’ve long got

Re: "two time periods with only an endpoint in common do not overlap" ???

2021-10-15 Thread Tom Lane
Ron writes: > OP refers to the OVERLAP operator (is it an operator), not the tsrange() > function. Indeed. SQL92 defines OVERLAP thus: 6) The result of the is the result of the following expression: ( S1 > S2 AND NOT ( S1 >= T2 AND T1 >= T2 ) )

Re: "two time periods with only an endpoint in common do not overlap" ???

2021-10-15 Thread Ron
On 10/15/21 11:08 PM, Adrian Klaver wrote: On 10/15/21 19:42, Ron wrote: The numeric ranges 0-10 and 10-19 overlap, just as the time ranges 00:01:00-00:00:02:00 overlaps 00:02:00-00:03:00. *It's the programmer's responsibility* to say what s/he really means, not for "the system" to make tha

Re: "two time periods with only an endpoint in common do not overlap" ???

2021-10-15 Thread Ron
On 10/15/21 11:35 PM, David G. Johnston wrote: On Friday, October 15, 2021, Ron > wrote: The numeric ranges 0-10 and 10-19 overlap, just as the time ranges 00:01:00-00:00:02:00 overlaps 00:02:00-00:03:00. *It's the programmer's responsibility* to say

Re: "two time periods with only an endpoint in common do not overlap" ???

2021-10-15 Thread David G. Johnston
On Friday, October 15, 2021, Ron wrote: > > The numeric ranges 0-10 and 10-19 overlap, just as the time ranges > 00:01:00-00:00:02:00 overlaps 00:02:00-00:03:00. > > *It's the programmer's responsibility* to say what s/he really means, not > for "the system" to make that choice. > The system has

Re: "two time periods with only an endpoint in common do not overlap" ???

2021-10-15 Thread Adrian Klaver
On 10/15/21 19:42, Ron wrote: The numeric ranges 0-10 and 10-19 overlap, just as the time ranges 00:01:00-00:00:02:00 overlaps 00:02:00-00:03:00. *It's the programmer's responsibility* to say what s/he really means, not for "the system" to make that choice. It is the programmers choice:

Re: "two time periods with only an endpoint in common do not overlap" ???

2021-10-15 Thread Ron
The numeric ranges 0-10 and 10-19 overlap, just as the time ranges 00:01:00-00:00:02:00 overlaps 00:02:00-00:03:00. *It's the programmer's responsibility* to say what s/he really means, not for "the system" to make that choice. On 10/15/21 1:27 PM, Brian Dunavant wrote: Think of it this way

Re: "two time periods with only an endpoint in common do not overlap" ???

2021-10-15 Thread Adrian Klaver
On 10/15/21 12:26, Guyren Howe wrote: I’m a bit confused by this conversation. Open- and closed-ended ranges behave as I would expect. What is the part that confused you? select tsrange('2016-01-10 17:00', '2016-01-11 17:00', '[)') && tsrange('2016-01-11 17:00', '2016-01-12 17:00', '[]') f

Re: Stuck: how can I disable automatic json array unwrapping?

2021-10-15 Thread Seref Arikan
As always, the solution is in the postgresql documentation. Using exists() from a filter prior to accessing an optional field solves my problem. I can have both strict mode and access to optional fields without getting an error this way. On Fri, Oct 15, 2021 at 6:50 PM Seref Arikan wrote: > I

Re: "two time periods with only an endpoint in common do not overlap" ???

2021-10-15 Thread Guyren Howe
I’m a bit confused by this conversation. Open- and closed-ended ranges behave as I would expect. select tsrange('2016-01-10 17:00', '2016-01-11 17:00', '[)') && tsrange('2016-01-11 17:00', '2016-01-12 17:00', '[]') false select tsrange('2016-01-10 17:00', '2016-01-11 17:00', '[]') && tsrange('

Re: "two time periods with only an endpoint in common do not overlap" ???

2021-10-15 Thread Brian Dunavant
Think of it this way. When someone says they have a meeting from 1-2 and another from 2-3, do those meetings overlap? They do not, because we're actually saying the first meeting is from 1:00 through 1:59:59.9. The Postgres date ranges are the same way. The starting point is inclusive, bu

Re: "two time periods with only an endpoint in common do not overlap" ???

2021-10-15 Thread Rob Sargent
I was afraid you were going to say that.  It's completely bizarre, but seems to be a "thing" in computer science. Or maybe it's a "math thing".  But an overlap implies some length. A point has no length.  Maybe think of them as abutting one another? One ends /there/, the other starts /there

Re: "two time periods with only an endpoint in common do not overlap" ???

2021-10-15 Thread Ron
On 10/15/21 8:59 AM, Adrian Klaver wrote: On 10/15/21 06:52, Ron wrote: On 10/14/21 7:02 PM, Adrian Klaver wrote: [snip] or the third example in the docs: SELECT (DATE '2001-02-16', DATE '2001-12-21') OVERLAPS    (DATE '2001-10-30', DATE '2002-10-30'); Result: true SELECT (DATE '2001-02-16

Stuck: how can I disable automatic json array unwrapping?

2021-10-15 Thread Seref Arikan
I have json data which is based on arbitrary levels of hierarchy. The json objects I need to query are at an unknown depth in the document, which means I have to use the recursive wildcard member accessor (.**) The problem is, the path to these unknown depths also contain arrays, and when .** acce

Re: PostgreSQL 14: pg_dump / pg_restore error: could not write to the communication channel: Broken pipe

2021-10-15 Thread Tom Lane
Alvaro Herrera writes: > Yeah, pg_dump in parallel mode uses a pipe to communicate between leader > and workers; the error you see is what happens when a write to the pipe > fails. It sounds to me like something in the operating system is > preventing the pipes from working properly. BTW, I thin

Re: PostgreSQL 14: pg_dump / pg_restore error: could not write to the communication channel: Broken pipe

2021-10-15 Thread Tom Lane
Alvaro Herrera writes: > On 2021-Oct-15, Nick Renders wrote: >> I have been trying to import a Postgres 11 database into Postgres 14, but >> the pg_restore command exits with the following message: >> pg_restore: error: could not write to the communication channel: Broken >> pipe >> >> It seems th

Re: postgres ssl client certificate authentification

2021-10-15 Thread Tom Lane
"Zwettler Markus (OIZ)" writes: > I am playing around with postgres ssl encryption. I am confused about client > certificate authentication: > > The second approach combines any authentication method for hostssl entries > with the verification of client certificates by setting the clientcert

postgres ssl client certificate authentification

2021-10-15 Thread Zwettler Markus (OIZ)
Hi all, I am playing around with postgres ssl encryption. I am confused about client certificate authentication: The second approach combines any authentication method for hostssl entries with the verification of client certificates by setting the clientcert authentication option to verify-

Re: "two time periods with only an endpoint in common do not overlap" ???

2021-10-15 Thread Tom Lane
Ron writes: > On 10/14/21 7:02 PM, Adrian Klaver wrote: >> SELECT (DATE '2001-10-29', DATE '2001-10-30') OVERLAPS >>    (DATE '2001-10-30', DATE '2001-10-31'); >> Result: false > Why /don't/ they overlap, given that they share a common date? They don't. Per the fine manual [1]: Each ti

Re: "two time periods with only an endpoint in common do not overlap" ???

2021-10-15 Thread Adrian Klaver
On 10/15/21 06:52, Ron wrote: On 10/14/21 7:02 PM, Adrian Klaver wrote: [snip] or the third example in the docs: SELECT (DATE '2001-02-16', DATE '2001-12-21') OVERLAPS    (DATE '2001-10-30', DATE '2002-10-30'); Result: true SELECT (DATE '2001-02-16', INTERVAL '100 days') OVERLAPS    (DA

Re: "two time periods with only an endpoint in common do not overlap" ???

2021-10-15 Thread Ron
On 10/14/21 7:02 PM, Adrian Klaver wrote: [snip] or the third example in the docs: SELECT (DATE '2001-02-16', DATE '2001-12-21') OVERLAPS    (DATE '2001-10-30', DATE '2002-10-30'); Result: true SELECT (DATE '2001-02-16', INTERVAL '100 days') OVERLAPS    (DATE '2001-10-30', DATE '2002-10-

Re: PostgreSQL 14: pg_dump / pg_restore error: could not write to the communication channel: Broken pipe

2021-10-15 Thread Alvaro Herrera
On 2021-Oct-15, Nick Renders wrote: > Hello, > > I have been trying to import a Postgres 11 database into Postgres 14, but > the pg_restore command exits with the following message: > > pg_restore: error: could not write to the communication channel: Broken > pipe > > The command I sent l

Re: PostgreSQL 14: pg_dump / pg_restore error: could not write to the communication channel: Broken pipe

2021-10-15 Thread Maciek Sakrejda
Anything interesting in the Postgres server log when this happens? On Fri, Oct 15, 2021, 05:21 Nick Renders wrote: > Hello, > > I have been trying to import a Postgres 11 database into Postgres 14, > but the pg_restore command exits with the following message: > > pg_restore: error: coul

PostgreSQL 14: pg_dump / pg_restore error: could not write to the communication channel: Broken pipe

2021-10-15 Thread Nick Renders
Hello, I have been trying to import a Postgres 11 database into Postgres 14, but the pg_restore command exits with the following message: pg_restore: error: could not write to the communication channel: Broken pipe The command I sent looks like this: /Library/PostgreSQL/14/bin/pg_restore