Re: to_date() and to_timestamp() with negative years

2021-11-03 Thread Adrian Klaver
On 11/3/21 19:12, Bryn Llewellyn wrote: /adrian.kla...@aklaver.com wrote:/ Back to the point about separators, the "Current" doc has this bullet: « A separator (a space or non-letter/non-digit character) in the template string of to_timestamp and to_date 

Re: to_date() and to_timestamp() with negative years

2021-11-03 Thread Bryn Llewellyn
> adrian.kla...@aklaver.com wrote: > > On 11/3/21 17:00, Adrian Klaver wrote: >> On 11/3/21 15:56, Bryn Llewellyn wrote: t...@sss.pgh.pa.us wrote: > >>> And you have to have some kind of separator between the years substring and >>> the adjacent one(s) even to succeed with years that

Re: Error with Insert from View with ON Conflict

2021-11-03 Thread Peter Geoghegan
On Wed, Nov 3, 2021 at 2:18 PM Steve Baldwin wrote: > I'm pretty sure the 'alias' for the '.. on conflict do update ..' needs to be > 'excluded' (i.e. checks = excluded.checks, ...). Check the docs. That's right . The excluded.* pseudo-table isn't exactly the same thing as the target table --

Re: to_date() and to_timestamp() with negative years

2021-11-03 Thread Adrian Klaver
On 11/3/21 17:00, Adrian Klaver wrote: On 11/3/21 15:56, Bryn Llewellyn wrote: t...@sss.pgh.pa.us wrote: And you have to have some kind of separator between the years substring and the adjacent one(s) even to succeed with years that have more than four digits. Another usage note stresses

Re: to_date() and to_timestamp() with negative years

2021-11-03 Thread Adrian Klaver
On 11/3/21 15:56, Bryn Llewellyn wrote: t...@sss.pgh.pa.us wrote: Adrian Klaver writes: Haven't had time to work through what the above is actually doing. I think the first two are explained by 489c9c340: Also, arrange for the combination of a negative year and an explicit "BC"

Re: to_date() and to_timestamp() with negative years

2021-11-03 Thread Bryn Llewellyn
> t...@sss.pgh.pa.us wrote: > > Adrian Klaver writes: >> Haven't had time to work through what the above is actually doing. > > I think the first two are explained by 489c9c340: > >Also, arrange for the combination of a negative year and an >explicit "BC" marker to cancel out and

Re: to_date() and to_timestamp() with negative years

2021-11-03 Thread Tom Lane
Adrian Klaver writes: > Haven't had time to work through what the above is actually doing. I think the first two are explained by 489c9c340: Also, arrange for the combination of a negative year and an explicit "BC" marker to cancel out and produce AD. This is how the

Re: to_date() and to_timestamp() with negative years

2021-11-03 Thread Adrian Klaver
On 11/3/21 1:39 PM, Bryn Llewellyn wrote: /adrian.kla...@aklaver.com wrote:/ /Bryn wrote:/ In what PG version did you run your test? I'm not surprised that grandfathered-in "solution" that I described will never go away—despite its questionable

Re: Error with Insert from View with ON Conflict

2021-11-03 Thread Steve Baldwin
I'm pretty sure the 'alias' for the '.. on conflict do update ..' needs to be 'excluded' (i.e. checks = excluded.checks, ...). Check the docs. Steve On Thu, Nov 4, 2021 at 8:05 AM Alex Magnum wrote: > Hi, > I am trying to do an upsert using a view but for some reason get errors. > All works

Error with Insert from View with ON Conflict

2021-11-03 Thread Alex Magnum
Hi, I am trying to do an upsert using a view but for some reason get errors. All works fine without the ON CONFLICT INSERT INTO http_stats SELECT * FROM view_http_stats AS V WHERE month =date_trunc('month',now()) ON CONFLICT (url,ip,month) DO UPDATE SET last_update = now(), checks

Re: to_date() and to_timestamp() with negative years

2021-11-03 Thread Bryn Llewellyn
adrian.kla...@aklaver.com wrote: > Bryn wrote: > >>> t...@sss.pgh.pa.us wrote: >>> >>> Bryn Llewellyn writes: Is there any chance that you might be bold and simply make negative "year" values illegal in "to_date()" and "to_timestamp()" — just as they already are in

Re: Regex for (A) and (B) to find in Bus Stop (A) or (B)

2021-11-03 Thread David G. Johnston
On Wednesday, November 3, 2021, David G. Johnston < david.g.johns...@gmail.com> wrote: > On Wednesday, November 3, 2021, Shaozhong SHI > wrote: > >> What is the regex for (A) and (B) to find in Bus Stop (A) or (B)? >> > > Not tested… > > ^Bus\sStop\s\((\w)\)\sor\((\w)\)$ > > The \s can just

Re: Regex for (A) and (B) to find in Bus Stop (A) or (B)

2021-11-03 Thread David G. Johnston
On Wednesday, November 3, 2021, Shaozhong SHI wrote: > What is the regex for (A) and (B) to find in Bus Stop (A) or (B)? > Not tested… ^Bus\sStop\s\((\w)\)\sor\((\w)\)$ The \s can just written as a space though the above seems clearer in email (though it allows for non-space whitespace too)

Regex for (A) and (B) to find in Bus Stop (A) or (B)

2021-11-03 Thread Shaozhong SHI
What is the regex for (A) and (B) to find in Bus Stop (A) or (B)? Regards, David

Regex for (A) and (B) to find in Bus Stop (A) or (B)

2021-11-03 Thread Shaozhong SHI
What is the regex for (A) and (B) to find in Bus Stop (A) or (B)? Regards, David

Re: to_date() and to_timestamp() with negative years

2021-11-03 Thread Adrian Klaver
On 11/3/21 11:18, Bryn Llewellyn wrote: t...@sss.pgh.pa.us wrote: Bryn Llewellyn writes: Is there any chance that you might be bold and simply make negative "year" values illegal in "to_date()" and "to_timestamp()" — just as they already are in "make_timestamp()", "make_timestamptz()", and

Re: Selectivity and row count estimates for JSONB columns

2021-11-03 Thread Tom Lane
Joel Perren writes: > - generic_restriction_selectivity() returns the default value (0.01) for > data types that Postgres doesn't collect standard MCV and/or histogram > statistics for. I think this is what happens with Table B which (quite > correctly) does not have these statistics in pg_stats

Re: to_date() and to_timestamp() with negative years

2021-11-03 Thread Bryn Llewellyn
> t...@sss.pgh.pa.us wrote: > > Bryn Llewellyn writes: >> Is there any chance that you might be bold and simply make negative "year" >> values illegal in "to_date()" and "to_timestamp()" — just as they already >> are in "make_timestamp()", "make_timestamptz()", and the "from text" >>

Re: to_date() and to_timestamp() with negative years

2021-11-03 Thread Tom Lane
Bryn Llewellyn writes: > Is there any chance that you might be bold and simply make negative "year" > values illegal in "to_date()" and "to_timestamp()" — just as they already are > in "make_timestamp()", "make_timestamptz()", and the "from text" typecasts to > date-time moment values? Uh,

to_date() and to_timestamp() with negative years

2021-11-03 Thread Bryn Llewellyn
I'm quoting here from "Usage notes for date/time formatting" just below "Table 9.25. Template Pattern Modifiers for Date/Time Formatting" here: https://www.postgresql.org/docs/current/functions-formatting.html#FUNCTIONS-FORMATTING-DATETIMEMOD-TABLE on the page "9.8. Data Type Formatting

Re: Doubt in pgbouncer

2021-11-03 Thread Ninad Shah
There is no equation to determine the best value. It depends on your environment. Regards, Ninad Shah On Wed, 3 Nov 2021 at 19:18, Rama Krishnan wrote: > > Hi All, > > What is the limit value for fixing connection timeout issues? > > As i searched in google and verified pgbouncer document >

Doubt in pgbouncer

2021-11-03 Thread Rama Krishnan
Hi All, What is the limit value for fixing connection timeout issues? As i searched in google and verified pgbouncer document client_login_timeout If a client connects but does not manage to log in in this amount of time, it will be disconnected. Mainly needed to avoid dead connections stalling

Re: develop a extension with cpp?

2021-11-03 Thread huangning...@yahoo.com
Thank you.  On Wednesday, November 3, 2021, 06:20:18 AM GMT+8, Dmitry Igrishin wrote: вт, 2 нояб. 2021 г. в 20:12, huangning...@yahoo.com : > > Hi >    if i can develop a extension with cpp language? Sure, you can. Please, see example -- https://github.com/dmitigr/pgnso