Re: Avoid a possible out-of-bounds access (src/backend/optimizer/util/relnode.c)

2023-09-23 Thread Etsuro Fujita
Hi, On Sat, Sep 23, 2023 at 9:59 PM Ranier Vilela wrote: > Per Coverity. > CID 1518088 (#2 of 2): Improper use of negative value (NEGATIVE_RETURNS) > > The function bms_singleton_member can returns a negative number. > > /* > * Get a child rel for rel2 with the relids. See above comments. > */ >

Re: [HACKERS] Should logtape.c blocks be of type long?

2023-09-23 Thread Michael Paquier
On Thu, Sep 21, 2023 at 09:53:02PM -0700, Peter Geoghegan wrote: > No new thoughts. I'm still all in favor of this. Thanks for picking it up. Okay, thanks. I guess that nobody would complain if I were to apply that.. > At some point we should completely ban the use of "long". Indeed, or Windows

Re: nbtree's ScalarArrayOp array mark/restore code appears to be buggy

2023-09-23 Thread Peter Geoghegan
On Sat, Sep 23, 2023 at 11:47 AM Peter Geoghegan wrote: > The fix for this should be fairly straightforward. We must teach > _bt_restore_array_keys() to distinguish "past the end of the array" > from "after the start of the array", so that doesn't spuriously skip a > required call to _bt_preproces

Re: Eager page freeze criteria clarification

2023-09-23 Thread Melanie Plageman
On Mon, Aug 28, 2023 at 4:30 PM Melanie Plageman wrote: > On Mon, Aug 28, 2023 at 12:26 PM Robert Haas wrote: > > In row D, your algorithms are all bad, really bad. I don't quite > > understand how it can be that bad, actually. > > So, I realize now that this test was poorly designed. I meant it

Re: bug fix and documentation improvement about vacuumdb

2023-09-23 Thread Nathan Bossart
On Fri, Sep 22, 2023 at 02:58:20PM +0200, Daniel Gustafsson wrote: > I had a look at this and tweaked the testcase a bit to make the diff smaller, > as well as removed the (in some cases) superfluous space in the generated SQL > query mentioned upthread. The attached two patches is what I propose

Re: nbtree's ScalarArrayOp array mark/restore code appears to be buggy

2023-09-23 Thread Peter Geoghegan
On Fri, Sep 22, 2023 at 8:17 PM Peter Geoghegan wrote: > My suspicion is that bugfix commit 70bc5833 missed some subtlety > around what we need to do to make sure that the array keys stay "in > sync" with the scan. I'll have time to debug the problem some more > tomorrow. I've figured out what's

Re: Should rolpassword be toastable?

2023-09-23 Thread Alexander Lakhin
23.09.2023 17:39, Tom Lane wrote: I'm also now more than just slightly skeptical about whether pg_database should have a toast table. Has anybody tried, say, storing a daticurules field wide enough to end up out-of-line? I tried, but failed, because pg_database accessed in InitPostgres() befor

Re: Should rolpassword be toastable?

2023-09-23 Thread Tom Lane
Alexander Lakhin writes: > When playing with oversized tuples, I've found that it's possible to set > such oversized password for a user, that could not be validated. > For example: > ... > psql -U "test_user" -c "SELECT 1" > psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed:

Should rolpassword be toastable?

2023-09-23 Thread Alexander Lakhin
Hello hackers, When playing with oversized tuples, I've found that it's possible to set such oversized password for a user, that could not be validated. For example: SELECT format('CREATE ROLE test_user LOGIN PASSWORD ''SCRAM-SHA-256$' || repeat('0', 200) || '4096:NuDacwYSUxeOeFUEf3ivTQ==$Wg

Avoid a possible out-of-bounds access (src/backend/optimizer/util/relnode.c)

2023-09-23 Thread Ranier Vilela
Hi, Per Coverity. CID 1518088 (#2 of 2): Improper use of negative value (NEGATIVE_RETURNS) The function bms_singleton_member can returns a negative number. /* * Get a child rel for rel2 with the relids. See above comments. */ if (rel2_is_simple) { int varno = bms_singleton_member(child_relids2)