Re: regdatabase

2025-05-19 Thread Nathan Bossart
On Mon, May 19, 2025 at 10:37:29AM +0800, jian he wrote: > I saw REGROLEOID in foreign_expr_walker, > I'm wondering whether REGDATABASEOID is reachable within foreign_expr_walker. > > not familiar with this area, also there are no coverage tests for > other reg*Const, > per > https://coverage.pos

Re: regdatabase

2025-05-18 Thread jian he
On Thu, May 8, 2025 at 11:20 PM Nathan Bossart wrote: > > On Thu, May 08, 2025 at 10:38:04PM +0900, Ian Lawrence Barwick wrote: > > Revised patch attached which adds coverage of that and also for the > > "constant of the type reg(role|database) cannot be used here" error. > > LGTM. I've marked it

Re: regdatabase

2025-05-08 Thread Nathan Bossart
On Thu, May 08, 2025 at 10:38:04PM +0900, Ian Lawrence Barwick wrote: > Revised patch attached which adds coverage of that and also for the > "constant of the type reg(role|database) cannot be used here" error. LGTM. I've marked it as ready-for-committer [0] and will plan on committing it as soon

Re: regdatabase

2025-05-08 Thread Ian Lawrence Barwick
2025年5月8日(木) 12:41 Nathan Bossart : > > On Wed, May 07, 2025 at 10:29:43AM -0400, Greg Sabino Mullane wrote: > > On Wed, May 7, 2025 at 4:55 AM Ian Lawrence Barwick > > wrote: > >> Version which applies/builds against current HEAD attached. I haven't yet > >> had a chance to look at the code beyon

Re: regdatabase

2025-05-07 Thread Nathan Bossart
On Wed, May 07, 2025 at 10:41:23PM -0500, Nathan Bossart wrote: > The attached patch should address everything I've mentioned. And this version of the patch should be free of my embarrassing copy/paste mistakes. -- nathan >From c5460d594a225d3443f901e79c6c9bc7501bd9af Mon Sep 17 00:00:00 2001 Fr

Re: regdatabase

2025-05-07 Thread Nathan Bossart
On Wed, May 07, 2025 at 10:29:43AM -0400, Greg Sabino Mullane wrote: > On Wed, May 7, 2025 at 4:55 AM Ian Lawrence Barwick > wrote: >> Version which applies/builds against current HEAD attached. I haven't yet >> had a chance to look at the code beyond fixing it, however. I spent some time on this

Re: regdatabase

2025-05-07 Thread Greg Sabino Mullane
On Wed, May 7, 2025 at 4:55 AM Ian Lawrence Barwick wrote: > Version which applies/builds against current HEAD attached. I haven't yet > had a chance to look at the code beyond fixing it, however. > I too, have wanted this over the years, so +1 on the idea. Quick review: nice patch, very thorou

Re: regdatabase

2025-05-07 Thread Jelte Fennema-Nio
On Tue, 6 May 2025 at 21:29, Nathan Bossart wrote: > > Every once in a while, I find myself wanting to use regdatabase for > something like current_database()::regdatabase, and I'm always surprised > when I inevitably rediscover that it doesn't exist. +1 for the idea. I keep running into this too

Re: regdatabase

2025-05-07 Thread Ian Lawrence Barwick
2025年5月7日(水) 10:47 Nathan Bossart : > > On Wed, May 07, 2025 at 09:18:28AM +0900, Ian Lawrence Barwick wrote: > > Hah, I put together a patch to implement just that a while back, but > > then concluded > > for some reason that it would likely be rejected so saved myself the > > humiliation of > > s

Re: regdatabase

2025-05-06 Thread Tom Lane
Nathan Bossart writes: > * Would anyone object if I put together some patches to add regdatabase? The original concept of the reg* types was to implement lookups for cases that are more complicated than "(SELECT oid FROM pg_foo WHERE fooname = 'whatever')". As an example, regprocedure would be s

Re: regdatabase

2025-05-06 Thread Nathan Bossart
On Wed, May 07, 2025 at 08:45:15AM +0900, Michael Paquier wrote: > For regdatabase, there would be at least two simplications related to > the dump of subscriptions, where we could switch the queries to the > new grammar for backend versions able to support the new grammar, > meaning that we could

Re: regdatabase

2025-05-06 Thread Nathan Bossart
On Wed, May 07, 2025 at 09:18:28AM +0900, Ian Lawrence Barwick wrote: > Hah, I put together a patch to implement just that a while back, but > then concluded > for some reason that it would likely be rejected so saved myself the > humiliation of > submitting it... > > Attaching patch for reference

Re: regdatabase

2025-05-06 Thread Ian Lawrence Barwick
2025年5月7日(水) 4:29 Nathan Bossart : > > Every once in a while, I find myself wanting to use regdatabase for > something like current_database()::regdatabase, and I'm always surprised > when I inevitably rediscover that it doesn't exist. I only found one > reference to the idea in the archives [0].

Re: regdatabase

2025-05-06 Thread Michael Paquier
On Wed, May 07, 2025 at 07:28:02AM +0900, Tatsuo Ishii wrote: > I think regdatabase is a good idea. I've also found your reference from the lists of 2019 to be the only one referring to a regdatabase. If it means that I will type less by not having to do joins with pg_database, count me in. The

Re: regdatabase

2025-05-06 Thread Tatsuo Ishii
> Every once in a while, I find myself wanting to use regdatabase for > something like current_database()::regdatabase, and I'm always surprised > when I inevitably rediscover that it doesn't exist. I only found one > reference to the idea in the archives [0]. So, I have two questions: > > * Is