pgsql: Fix corner-case loss of precision in numeric ln().

2020-03-01 Thread Dean Rasheed
Fix corner-case loss of precision in numeric ln(). When deciding on the local rscale to use for the Taylor series expansion, ln_var() neglected to account for the fact that the result is subsequently multiplied by a factor of 2^(nsqrt+1), where nsqrt is the number of square root operations perform

Re: pgsql: Add deduplication to nbtree.

2020-03-01 Thread Tom Lane
Peter Geoghegan writes: > Add deduplication to nbtree. Coverity isn't very happy with the coding in _bt_update_posting(): *** CID 1460433: Memory - corruptions (ARRAY_VS_SINGLETON) /srv/coverity/git/pgsql-git/postgresql/src/backend/access/nbtree/nbtdedup.c: 723 in _bt_update_posting() 717

Re: pgsql: Add deduplication to nbtree.

2020-03-01 Thread Peter Geoghegan
On Sun, Mar 1, 2020 at 10:24 AM Tom Lane wrote: > I can see its point: asserting after the fact that you didn't clobber > memory isn't a terribly safe coding method, especially in a production > build where you won't even have the asserts. Not sure if there's a > better way though. I found it sl

Re: pgsql: Add deduplication to nbtree.

2020-03-01 Thread Tom Lane
Peter Geoghegan writes: > On Sun, Mar 1, 2020 at 10:24 AM Tom Lane wrote: >> I can see its point: asserting after the fact that you didn't clobber >> memory isn't a terribly safe coding method, especially in a production >> build where you won't even have the asserts. Not sure if there's a >> be

Re: pgsql: Add deduplication to nbtree.

2020-03-01 Thread Peter Geoghegan
On Sun, Mar 1, 2020 at 11:29 AM Tom Lane wrote: > Hm. That would probably be enough to shut up Coverity, but I'm unsure > whether it'd really be an improvement from the legibility and safety > viewpoints. I noticed that _bt_update_posting() behaves as if the origtuple might not be a posting list

pgsql: Remove dead code from _bt_update_posting().

2020-03-01 Thread Peter Geoghegan
Remove dead code from _bt_update_posting(). Discussion: https://postgr.es/m/CAH2-WzmAufHiOku6AGiFD=81vqs5nyj1l2ykhw1t+bh4cms...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/84ec9b231a865348f5388dcc125c084297709332 Modified Files -- sr

Re: pgsql: Add deduplication to nbtree.

2020-03-01 Thread Peter Geoghegan
On Sun, Mar 1, 2020 at 11:42 AM Peter Geoghegan wrote: > > Do you want to try coding it that way and see what it > > comes out like? > > Sure. Attached patch shows how this could work. I prefer my original approach, but I can see the argument for doing it this way. If we keep my original approac

Re: pgsql: Add deduplication to nbtree.

2020-03-01 Thread Tom Lane
Peter Geoghegan writes: > Attached patch shows how this could work. I prefer my original > approach, but I can see the argument for doing it this way. This does seem a bit duplicative ... and shouldn't both code paths include a final "Assert(d == vacposting->ndeletedtids)"? So maybe we're better

Re: pgsql: Add deduplication to nbtree.

2020-03-01 Thread Peter Geoghegan
On Sun, Mar 1, 2020 at 2:14 PM Tom Lane wrote: > > Attached patch shows how this could work. I prefer my original > > approach, but I can see the argument for doing it this way. > > This does seem a bit duplicative ... and shouldn't both code paths > include a final "Assert(d == vacposting->ndelet

Re: pgsql: Add deduplication to nbtree.

2020-03-01 Thread Peter Geoghegan
On Sun, Mar 1, 2020 at 3:01 PM Peter Geoghegan wrote: > I am happy to add parallel-to-_bt_form_posting() assertions about > alignment to _bt_form_posting(), to nail it down completely. Plus I'll > add the assertion I suggested already. Once I commit a patch with > these two new assertions, I think

pgsql: Handle logical decoding in multi-insert for catalog tuples

2020-03-01 Thread Michael Paquier
Handle logical decoding in multi-insert for catalog tuples The code path for multi-insert decoding is not stressed yet for catalogs (a future patch may introduce this capability), so no back-patch is needed. Author: Daniel Gustafsson Discussion: https://postgr.es/m/9690d72f-5c4f-4016-9572-6d16684

Re: pgsql: Revert "initdb: Change authentication defaults"

2020-03-01 Thread Andrew Dunstan
On Sat, Feb 29, 2020 at 10:41 AM Tom Lane wrote: > > Magnus Hagander writes: > > On Mon, Jul 22, 2019 at 10:29 AM Peter Eisentraut > > wrote: > >> Revert "initdb: Change authentication defaults" > >> This reverts commit 09f08930f0f6fd4a7350ac02f29124b919727198. > >> The buildfarm client needs s

Re: pgsql: Add deduplication to nbtree.

2020-03-01 Thread Tom Lane
Peter Geoghegan writes: > On Sun, Mar 1, 2020 at 3:01 PM Peter Geoghegan wrote: >> I am happy to add parallel-to-_bt_form_posting() assertions about >> alignment to _bt_form_posting(), to nail it down completely. Plus I'll >> add the assertion I suggested already. Once I commit a patch with >> th

pgsql: Fix command-line colorization on Windows with VT100-compatible e

2020-03-01 Thread Michael Paquier
Fix command-line colorization on Windows with VT100-compatible environments When setting PG_COLOR to "always" or "auto" in a Windows terminal VT100-compatible, the colorization output was not showing up correctly because it is necessary to update the console's output handling mode. This fix allows

pgsql: Fix command-line colorization on Windows with VT100-compatible e

2020-03-01 Thread Michael Paquier
Fix command-line colorization on Windows with VT100-compatible environments When setting PG_COLOR to "always" or "auto" in a Windows terminal VT100-compatible, the colorization output was not showing up correctly because it is necessary to update the console's output handling mode. This fix allows

Re: pgsql: Revert "initdb: Change authentication defaults"

2020-03-01 Thread Tom Lane
Andrew Dunstan writes: > On Sat, Feb 29, 2020 at 10:41 AM Tom Lane wrote: >> Did the buildfarm adjustments get made? (I'm assuming Andrew knows) > It's in Release 11 of the client and is mentioned in the release > notes. The release is dated last September. Making this change would > force a fl

pgsql: Remove long unused code behind a #if 0

2020-03-01 Thread Peter Eisentraut
Remove long unused code behind a #if 0 Author: Vignesh C Discussion: https://www.postgresql.org/message-id/flat/caldanm3sn4yoq-4rogb-cfe0eyw6b3mvzz8+dns9bnrwpnh...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/d433b79b89c7d429ab69cb00857a8aca45d0a