Add pg_ownerships and pg_privileges system views

2024-10-19 Thread Joel Jacobson
Hi hackers, Here is an attempt to revive this patch from 2021-2022, that has been ready now for a while, thanks to pg_get_acl() function that was committed in 4564f1c and d898665. I've renamed the $subject of the email thread, to match the commitfest entry: https://commitfest.postgresql.org/50/50

report a typo in WaitReadBuffers

2024-10-19 Thread Junwang Zhao
While reading the stream read interfaces, I found a typo. /* * How many neighboring-on-disk blocks can we can scatter-read into * other buffers at the same time? In this case we don't wait if we Seems the second *can* is not necessary. -- Regards Junwang Zhao

Re: BUG #18545: \dt breaks transaction, calling error when executed in SET SESSION AUTHORIZATION

2024-10-19 Thread Tom Lane
Noah Misch writes: > Thanks for debugging that. RestorePendingSyncs() also changes what > RelationInitPhysicalAddr() puts in the relcache entry, so it needs to stay > with RestoreRelationMap(). I'm attaching the fix I have in mind. Ah. No objections here. regards, tom

Re: BUG #18545: \dt breaks transaction, calling error when executed in SET SESSION AUTHORIZATION

2024-10-19 Thread Noah Misch
On Thu, Sep 19, 2024 at 05:35:33PM -0400, Tom Lane wrote: > So the fix seems clear to me: RestoreRelationMap needs to happen > before anything that could result in catalog lookups. I'm kind > of inclined to move up the adjacent restores of non-transactional > low-level stuff too, particularly Rest

Improve documentation regarding custom settings, placeholders, and the administrative functions

2024-10-19 Thread David G. Johnston
Hey! Motivated by recent user complaints regarding our documentation of behavior in this area I propose the following to shore things up a bit. There may be other places that need this coverage but it seems the most likely place our users are going to experience this behavior is in using set_conf

Re: System views for versions reporting

2024-10-19 Thread Dmitry Dolgov
> On Mon, Oct 07, 2024 at 11:26:41AM GMT, Dmitry Dolgov wrote: > > On Sun, Oct 06, 2024 at 12:01:29PM GMT, Joe Conway wrote: > > I'm not sure why ICU is "Compile Time" rather than "Run Time" when it is not > > statically linked. > > It reports U_UNICODE_VERSION at compile time. It's not necessarily

Re: Wrong security context for deferred triggers?

2024-10-19 Thread Pavel Stehule
so 19. 10. 2024 v 13:02 odesílatel Laurenz Albe napsal: > On Sat, 2024-10-19 at 06:17 +0200, Pavel Stehule wrote: > > Maybe we should document so the trigger is executed with the identity > used by DML command always, > > when the trigger function has no SECURITY DEFINER flag? > > Good idea. Ver

Re: Using read_stream in index vacuum

2024-10-19 Thread Junwang Zhao
Hi Andrey, On Sat, Oct 19, 2024 at 5:39 PM Andrey M. Borodin wrote: > > Hi hackers! > > On a recent hacking workshop [0] Thomas mentioned that patches using new API > would be welcomed. > So I prototyped streamlining of B-tree vacuum for a discussion. > When cleaning an index we must visit every

Re: New "raw" COPY format

2024-10-19 Thread Joel Jacobson
On Sat, Oct 19, 2024, at 12:13, jian he wrote: > We already make RAW and can only have one column. > if RAW has no default delimiter, then COPY FROM a text file will > become one datum value; > which makes it looks like importing a Large Object. > (https://www.postgresql.org/docs/17/lo-funcs.html)

Re: Make default subscription streaming option as Parallel

2024-10-19 Thread Dilip Kumar
On Fri, 18 Oct 2024 at 5:24 PM, Amit Kapila wrote: > On Fri, Oct 18, 2024 at 9:48 AM Dilip Kumar wrote: > > > > On Tue, Oct 8, 2024 at 3:38 PM Amit Kapila > wrote: > >> > >> On Tue, Oct 8, 2024 at 2:25 PM shveta malik > wrote: > >> > > >> > On Mon, Oct 7, 2024 at 4:03 PM vignesh C wrote: > >>

Re: Wrong security context for deferred triggers?

2024-10-19 Thread Laurenz Albe
On Sat, 2024-10-19 at 06:17 +0200, Pavel Stehule wrote: > Maybe we should document so the trigger is executed with the identity used by > DML command always, > when the trigger function has no SECURITY DEFINER flag? Good idea. Version 3 has documentation. Yours, Laurenz Albe From f6f02eec3dcb29

Re: New "raw" COPY format

2024-10-19 Thread jian he
On Sat, Oct 19, 2024 at 1:24 AM Joel Jacobson wrote: >> > Handling of e.g. JSON and other structured text files that could contain > newlines, in a seamless way seems important, so therefore the default is > no delimiter for the raw format, so that the entire input is read as one data > value for

Using read_stream in index vacuum

2024-10-19 Thread Andrey M. Borodin
Hi hackers! On a recent hacking workshop [0] Thomas mentioned that patches using new API would be welcomed. So I prototyped streamlining of B-tree vacuum for a discussion. When cleaning an index we must visit every index tuple, thus we uphold a special invariant: After checking a trailing block,

Re: New "raw" COPY format

2024-10-19 Thread Joel Jacobson
On Fri, Oct 18, 2024, at 19:24, Joel Jacobson wrote: > Attachments: > * v11-0001-Refactor-ProcessCopyOptions-introduce-CopyFormat-enu.patch > * v11-0002-Add-raw-format-to-COPY-command.patch Here is a demo of a importing a decently sized real text file, that can't currently be imported without the

Re: [BUG FIX] Fix validation of COPY options FORCE_NOT_NULL/FORCE_NULL

2024-10-19 Thread Joel Jacobson
On Sat, Oct 19, 2024, at 03:32, Michael Paquier wrote: > If this area of the code is refactored so as a different error is > triggered for these two specific queries, we'd still be alerted that > something is wrong the same way for HEAD or what you are suggesting. > I can see your argument, but it