Re: optimize lookups in snapshot [sub]xip arrays

2022-07-16 Thread Nathan Bossart
Hi Andres, Thanks for taking a look. On Fri, Jul 15, 2022 at 01:08:57PM -0700, Andres Freund wrote: > Hm. Are there any contexts where we'd not want the potential for failing due > to OOM? I'm not sure about this one. > I wonder if we additionally / alternatively could use a faster method of >

Re: Proposal to introduce a shuffle function to intarray extension

2022-07-16 Thread Tom Lane
I wrote: > On the whole, I'd vote for calling it shuffle(), and expecting that > we'd also use that name for any future generic version. Actually ... is there a reason to bother with an intarray version at all, rather than going straight for an in-core anyarray function? It's not obvious to me

Re: Proposal to introduce a shuffle function to intarray extension

2022-07-16 Thread David G. Johnston
On Sat, Jul 16, 2022 at 8:18 PM Tom Lane wrote: > Martin Kalcher writes: > > > - I added a second function sample(), because it is a lot faster to take > >some elements from an array than to shuffle the whole array and > >slice it. This function can be removed if it is not wanted. > > I

Re: Proposal to introduce a shuffle function to intarray extension

2022-07-16 Thread David G. Johnston
On Sat, Jul 16, 2022 at 7:25 PM Martin Kalcher < martin.kalc...@aboutsource.net> wrote: > > - I added a second function sample(), because it is a lot faster to take >some elements from an array than to shuffle the whole array and >slice it. This function can be removed if it is not

Re: doc: Make selectivity example match wording

2022-07-16 Thread David G. Johnston
On Sat, Jul 2, 2022 at 12:42 PM Dian M Fay wrote: > On Thu Jun 9, 2022 at 11:57 AM EDT, David G. Johnston wrote: > > Reposting this to its own thread. > > > > > https://www.postgresql.org/message-id/flat/CAKFQuwby1aMsJDMeibaBaohgoaZhivAo4WcqHC1%3D9-GDZ3TSng%40mail.gmail.com > > > > doc: make

Re: Proposal to introduce a shuffle function to intarray extension

2022-07-16 Thread Tom Lane
Martin Kalcher writes: > Am 16.07.22 um 23:56 schrieb Thomas Munro: >> I understand that this is a specialised int[] shuffle, but I wonder if >> someone would ever want to have a general array shuffle, and how that >> would work, in terms of naming convention etc. > - I am not shure about the

Re: Proposal to introduce a shuffle function to intarray extension

2022-07-16 Thread Martin Kalcher
Am 16.07.22 um 23:56 schrieb Thomas Munro: On Fri, Jul 15, 2022 at 8:36 PM Martin Kalcher wrote: I would like to see a function like this inside the intarray extension. Is there any way to get to this point? How is the process to deal with such proposals? Hi Martin, I'm redirecting this to

Re: Move Section 9.27.7 (Data Object Management Functions) to System Information Chapter

2022-07-16 Thread David G. Johnston
On Fri, Jul 15, 2022 at 12:36 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > > I would ask that we at least rename it to: > > Disk Usage Functions > > Nevermind...I identified the scope of that header incorrectly and the rename wouldn't be appropriate for the other tables in that

Re: postgres_fdw: using TABLESAMPLE to collect remote sample

2022-07-16 Thread Tom Lane
Andres Freund writes: > On 2022-02-23 00:51:24 +0100, Tomas Vondra wrote: >> And here's the slightly simplified patch, without the part adding the >> unnecessary GetServerVersion() function. > Doesn't apply anymore: http://cfbot.cputube.org/patch_37_3535.log > Marked as waiting-on-author.

Re: Proposal to introduce a shuffle function to intarray extension

2022-07-16 Thread Thomas Munro
On Fri, Jul 15, 2022 at 8:36 PM Martin Kalcher wrote: > I would like to see a function like this inside the intarray extension. > Is there any way to get to this point? How is the process to deal with > such proposals? Hi Martin, I'm redirecting this to the pgsql-hackers@ mailing list, where we

Re: remove reset_shared()

2022-07-16 Thread Nathan Bossart
On Sat, Jul 16, 2022 at 12:34:11PM -0400, Tom Lane wrote: > Pushed after fiddling with the comments. Thanks! -- Nathan Bossart Amazon Web Services: https://aws.amazon.com

Re: Use -fvisibility=hidden for shared libraries

2022-07-16 Thread Andres Freund
Hi, On 2022-03-24 16:13:31 +0100, Peter Eisentraut wrote: > On 11.01.22 03:53, Andres Freund wrote: > > Ugh. In the case of worker_spi it's because -fvisibility=hidden isn't > > applied > > to worker_spi.c at all. Which in turn is because Makefile.shlib isn't used > > at > > all for MODULES=

Re: Avoid unecessary MemSet call (src/backend/utils/cache/relcache.c)

2022-07-16 Thread Ranier Vilela
Em sáb, 16 de jul de 2022 2:58 AM, Peter Eisentraut < peter.eisentr...@enterprisedb.com> escreveu: > On 11.07.22 21:06, Ranier Vilela wrote: > > Em qui., 7 de jul. de 2022 às 14:01, Ranier Vilela > > escreveu: > > > > Attached the v1 of your patch. > > I think

Re: Bug: Reading from single byte character column type may cause out of bounds memory reads.

2022-07-16 Thread Spyridon Dimitrios Agathos
Hi all, this is to verify that the .patch proposed here: https://www.postgresql.org/message-id/flat/2318797.1638558730%40sss.pgh.pa.us fixes the issue. I applied the patch and: 1) The build type doesn't affect the result of the query result 2) The valgrind doesn't complain about out of bound

Re: The "char" type versus non-ASCII characters

2022-07-16 Thread Tom Lane
Nikolay Shaplov writes: > This leads me to an idea that may be as we fix "char" behaviour, we should > also > change it's name to something more speaking for itself. I don't think this is going to happen. It's especially not going to happen in the back branches. But in any case, what I'm

Re: The "char" type versus non-ASCII characters

2022-07-16 Thread Nikolay Shaplov
В письме от пятница, 3 декабря 2021 г. 22:12:10 MSK пользователь Tom Lane написал: > which > is that the "char" type is not very encoding-safe. charout() for > example just regurgitates the single byte as-is. I think we deemed > that okay the last time anyone thought about it, but that was when

Re: remove reset_shared()

2022-07-16 Thread Tom Lane
Pavel Borisov writes: > I see the proposed patch as uncontroversial and good enough to be > committed. It will make the code a little clearer. Personally, I don't like > leaving functions that are just wrappers for another and called only once. Yeah, I like this for a different reason: just a

Re: PSA: Autoconf has risen from the dead

2022-07-16 Thread Tom Lane
... anyway, to get back to the main point of this thread: The Autoconf developers were pretty responsive to my bug reports, and after some back-and-forth we determined that: 1. The minimum GNU m4 version for modern autoconf is 1.4.8; this is directly traceable to intentional behavioral changes

Re: System catalog documentation chapter

2022-07-16 Thread Peter Eisentraut
On 14.07.22 22:07, Bruce Momjian wrote: On Tue, Jul 12, 2022 at 05:16:41PM -0400, Bruce Momjian wrote: On Tue, Jul 12, 2022 at 08:56:01PM +0200, Peter Eisentraut wrote: On 08.07.22 18:07, Bruce Momjian wrote: so I guess we can backpatch this with no issues. It inserts a new chapter, which

Re: Moving RwF patches to a new CF

2022-07-16 Thread Peter Eisentraut
On 16.07.22 01:16, Jacob Champion wrote: My current understanding is that RwF patches can't be moved (even by the CFM). You can just reattach the existing thread to a new CF entry when you're ready, as discussed in [1]. (Reviewers can sign themselves back up; don't carry them over.) I think

Re: Avoid unecessary MemSet call (src/backend/utils/cache/relcache.c)

2022-07-16 Thread Peter Eisentraut
On 11.07.22 21:06, Ranier Vilela wrote: Em qui., 7 de jul. de 2022 às 14:01, Ranier Vilela > escreveu: Attached the v1 of your patch. I think that all is safe to switch MemSet by {0}. Here the rebased patch v2, against latest head. I have committed my