Re: Delegating superuser tasks to new security roles (Was: Granting control of SUSET gucs to non-superusers)

2021-07-22 Thread Mark Dilger
> On Jul 22, 2021, at 11:21 AM, Robert Haas wrote: > > When we come to the > third thing the patch includes in this category, creating and dropping > event triggers, I *really* don't understand why that one is considered > host security. That one isn't touching the filesystem even to the >

Re: truncating timestamps on arbitrary intervals

2021-07-22 Thread John Naylor
On Thu, Jul 22, 2021 at 4:49 PM Bauyrzhan Sakhariyev < baurzhansahar...@gmail.com> wrote: > Not related to negative interval - I created a PR for adding zero check for stride https://github.com/postgres/postgres/pull/67 and after getting it closed I stopped right there - 1 line check doesn't worth

Re: Have I found an interval arithmetic bug?

2021-07-22 Thread Zhihong Yu
On Wed, Jul 21, 2021 at 6:43 PM Bruce Momjian wrote: > On Wed, Jul 21, 2021 at 06:39:26PM -0700, Bryn Llewellyn wrote: > > Your statement > > > > > > “months-to-days conversion is almost always an approximation, while > the > > days to seconds conversion is almost always accurate.” > > >

Re: Corrected documentation of data type for the logical replication message formats.

2021-07-22 Thread Peter Smith
I think the patch maybe is not quite correct for all the flags. For example, @@ -7607,44 +7615,44 @@ are available since protocol version 3. Int8 -Flags; currently unused (must be 0). +Flags (uint8); currently unused. AFAIK, even though the flags are

Re: Have I found an interval arithmetic bug?

2021-07-22 Thread Zhihong Yu
On Thu, Jul 22, 2021 at 2:59 PM Zhihong Yu wrote: > > > On Wed, Jul 21, 2021 at 6:43 PM Bruce Momjian wrote: > >> On Wed, Jul 21, 2021 at 06:39:26PM -0700, Bryn Llewellyn wrote: >> > Your statement >> > >> > >> > “months-to-days conversion is almost always an approximation, while >> the >>

Re: Autovacuum on partitioned table (autoanalyze)

2021-07-22 Thread Andres Freund
Hi, On 2021-04-08 01:20:14 -0400, Alvaro Herrera wrote: > On 2021-Apr-07, Alvaro Herrera wrote: > > > OK, I bit the bullet and re-did the logic in the way I had proposed > > earlier in the thread: do the propagation on the collector's side, by > > sending only the list of ancestors: the collector

Re: Incorrect usage of strtol, atoi for non-numeric junk inputs

2021-07-22 Thread Michael Paquier
On Thu, Jul 22, 2021 at 09:42:00AM -0400, Alvaro Herrera wrote: > May I suggest for the second sentence something like "If the parsing is > successful, returns true and stores the result in *result if that's > given; if parsing fails, returns false" Sounds fine to me. Thanks. -- Michael

Avoiding data loss with synchronous replication

2021-07-22 Thread Bossart, Nathan
Hi hackers, As previously discussed [0], canceling synchronous replication waits can have the unfortunate side effect of making transactions visible on a primary server before they are replicated. A failover at this time would cause such transactions to be lost. The proposed solution in the

Re: Delegating superuser tasks to new security roles (Was: Granting control of SUSET gucs to non-superusers)

2021-07-22 Thread Robert Haas
On Thu, Jul 22, 2021 at 3:00 PM Stephen Frost wrote: > I'm a bit on the fence about the documentation side... I could be > convinced either way, really, but I generally agree that it'd be good to > pick one and be consistent. I don't think the places where we do/don't > mention it were done for

Re: truncating timestamps on arbitrary intervals

2021-07-22 Thread Bauyrzhan Sakhariyev
> No, the boundary is intentionally the earlier one: I found that commit in GitHub, thanks for pointing it out. When I test locally *origin_in_the_future *case I get different results for positive and negative intervals (see queries #1 and #2 from above, they have same timestamp, origin and

Re: Slightly improve initdb --sync-only option's help message

2021-07-22 Thread Bossart, Nathan
On 7/6/21, 7:02 PM, "Gurjeet Singh" wrote: > I think it would be helpful if the help message was slightly more > descriptive. Some options: > > Used in patch: > only sync data directory; does not modify any data > > To match the wording of --sync-only option: > write contents of data

Re: Rename of triggers for partitioned tables

2021-07-22 Thread Alvaro Herrera
I pushed this patch with some minor corrections (mostly improved the message wording.) Thanks -- Álvaro Herrera Valdivia, Chile — https://www.EnterpriseDB.com/ "En las profundidades de nuestro inconsciente hay una obsesiva necesidad de un universo lógico y coherente. Pero el

Re: Use WaitLatch for {pre, post}_auth_delay instead of pg_usleep

2021-07-22 Thread Bossart, Nathan
On 7/12/21, 9:00 AM, "Bharath Rupireddy" wrote: > As suggested in [1], starting a new thread for discussing $subject > separately. {pre, post}_auth_delay waiting logic currently uses > pg_usleep which can't detect postmaster death. So, there are chances > that some of the backends still stay in

Re: Avoid repeated PQfnumber() in pg_dump

2021-07-22 Thread Bossart, Nathan
On 7/15/21, 12:48 PM, "Daniel Gustafsson" wrote: > While unlikely to be common, very wide tables aren’t unheard of. Either way, > I > think it has merit to pull out the PQfnumber before the loop even if it’s a > wash performance wise for many users, as it’s a pattern used elsewhere in >

Re: Rename of triggers for partitioned tables

2021-07-22 Thread Alvaro Herrera
On 2021-Jul-22, Alvaro Herrera wrote: > I pushed this patch with some minor corrections (mostly improved the > message wording.) Hmm, the sorting fails for Czech or something like that. Will fix ... -- Álvaro Herrera 39°49'30"S 73°17'W — https://www.EnterpriseDB.com/

Re: logical replication empty transactions

2021-07-22 Thread Peter Smith
I have reviewed the v9 patch and my feedback comments are below: // 1. Apply v9 gave multiple whitespace warnings $ git apply v9-0001-Skip-empty-transactions-for-logical-replication.patch v9-0001-Skip-empty-transactions-for-logical-replication.patch:479: indent with spaces. * If the

Re: [POC] verifying UTF-8 using SIMD instructions

2021-07-22 Thread John Naylor
On Wed, Jul 21, 2021 at 8:08 PM Thomas Munro wrote: > > On Thu, Jul 22, 2021 at 6:16 AM John Naylor > One question is whether this "one size fits all" approach will be > extensible to wider SIMD. Sure, it'll just take a little more work and complexity. For one, 16-byte SIMD can operate on

Re: row filtering for logical replication

2021-07-22 Thread Amit Kapila
On Tue, Jul 20, 2021 at 4:33 PM Dilip Kumar wrote: > > On Tue, Jul 20, 2021 at 3:43 PM Tomas Vondra > wrote: > > > > Do we log the TOAST-ed values that were not updated? > > No, we don't, I have submitted a patch sometime back to fix that [1] > That patch seems to log WAL for key unchanged

Re: window build doesn't apply PG_CPPFLAGS correctly

2021-07-22 Thread Andrew Dunstan
On 7/22/21 12:06 AM, Pavel Stehule wrote: > Hi > > I tried to write test for plpgsql debug API, where I need to access to > plpgsql.h > > I have line > > PG_CPPFLAGS = -I$(top_srcdir)/src/pl/plpgsql/src > > that is working well on unix, but it do nothing on windows > > [00:05:14] Project

Re: proposal: enhancing plpgsql debug API - returns text value of variable content

2021-07-22 Thread Aleksander Alekseev
Hi Pavel, >> I am sending an enhanced patch about the regress test for plpgsql's debug API. Thanks for the test! I noticed some little issues with formatting and typos. The corrected patch is attached. > override CPPFLAGS := $(CPPFLAGS) -I$(top_srcdir)/src/pl/plpgsql/src You probably already

Re: Delegating superuser tasks to new security roles (Was: Granting control of SUSET gucs to non-superusers)

2021-07-22 Thread vignesh C
On Thu, Jul 1, 2021 at 9:42 PM Mark Dilger wrote: > > > > > On Jun 29, 2021, at 6:25 PM, Mark Dilger > > wrote: > > > > Please find attached a new set of patches. > > And again, this time attaching a fifth patch which includes the work to allow > users who belong to the right security role to

Re: Enhanced error message to include hint messages for redundant options error

2021-07-22 Thread vignesh C
On Thu, Jul 15, 2021 at 5:12 PM vignesh C wrote: > > On Thu, Jul 15, 2021 at 1:40 PM Dean Rasheed wrote: > > > > On Tue, 13 Jul 2021 at 15:30, vignesh C wrote: > > > > > > On Tue, Jul 13, 2021 at 4:25 PM Dean Rasheed > > > wrote: > > > > > > > > As it stands, the improvements from (3) seem

Re: .ready and .done files considered harmful

2021-07-22 Thread Dipesh Pandit
Hi, > some comments on v2. Thanks for your comments. I have incorporated the changes and updated a new patch. Please find the details below. > On the timeline switch, setting a flag should be enough, I don't think > that we need to wake up the archiver. Because it will just waste the > scan

Re: alter table set TABLE ACCESS METHOD

2021-07-22 Thread Justin Pryzby
On Thu, Jul 22, 2021 at 10:37:12AM +0530, vignesh C wrote: > On Fri, Jul 16, 2021 at 9:19 AM Justin Pryzby wrote: > > > > rebased. > > > > Also, there were two redundant checks for multiple SET ACCESS METHOD > > commands. > > But one of them wasn't hit if the ALTER was setting the current AM due

Re: window build doesn't apply PG_CPPFLAGS correctly

2021-07-22 Thread Pavel Stehule
čt 22. 7. 2021 v 14:04 odesílatel Andrew Dunstan napsal: > > On 7/22/21 12:06 AM, Pavel Stehule wrote: > > Hi > > > > I tried to write test for plpgsql debug API, where I need to access to > > plpgsql.h > > > > I have line > > > > PG_CPPFLAGS = -I$(top_srcdir)/src/pl/plpgsql/src > > > > that is

Re: postgresql.conf.sample missing units

2021-07-22 Thread Pavel Luzanov
On 21.07.2021 17:33, John Naylor wrote: I pushed this and backpatched to v12. I also extracted just the "bytes" part and applied it to v11. It's a little more complicated, but it's the right decision. Thank you. Pavel Luzanov Postgres Professional: https://postgrespro.com The Russian

RE: Skipping logical replication transactions on subscriber side

2021-07-22 Thread houzj.f...@fujitsu.com
On July 20, 2021 9:26 AM Masahiko Sawada wrote: > On Mon, Jul 19, 2021 at 8:38 PM houzj.f...@fujitsu.com > wrote: > > > > On July 19, 2021 2:40 PM Masahiko Sawada > wrote: > > > I've attached the updated version patch that incorporated all > > > comments I got so far except for the clearing

Re: [BUG]Update Toast data failure in logical replication

2021-07-22 Thread Amit Kapila
On Thu, Jun 3, 2021 at 5:15 PM Dilip Kumar wrote: > > On Wed, Jun 2, 2021 at 7:23 PM Dilip Kumar wrote: > > > > On Wed, Jun 2, 2021 at 7:20 PM Kuntal Ghosh > > wrote: > > > > > > On Wed, Jun 2, 2021 at 3:10 PM Dilip Kumar wrote: > > > > > > > > Yes, you are right. I will change it in the

Use quick select instead of qsort to get median

2021-07-22 Thread houzj.f...@fujitsu.com
Hi, When I was writing an extension which need to get the median of an array, I tried to find if postgres provide some api that can do that. I found all the places in postgres invoke qsort() and then get the median. I was thinking can we do better by using "quick select" and is it worth it.

Re: Use quick select instead of qsort to get median

2021-07-22 Thread John Naylor
On Thu, Jul 22, 2021 at 8:07 AM houzj.f...@fujitsu.com < houzj.f...@fujitsu.com> wrote: > > Hi, > > When I was writing an extension which need to get the median of an array, I > tried to find if postgres provide some api that can do that. I found all the > places in postgres invoke qsort() and

Re: BUG #15293: Stored Procedure Triggered by Logical Replication is Unable to use Notification Events

2021-07-22 Thread Davide Fasolo
Should Arthur patch be included in PostgreSQL 14 - Beta 4?

Re: Transactions and indexes

2021-07-22 Thread Chris Cleveland
Thank you. Does this mean I can implement the index AM and return TIDs without having to worry about transactions at all? Also, as far as I can tell, the only way that TIDs are removed from the index is in ambulkdelete(). Is this accurate? Does that mean that my index will be returning TIDs for

Re: Transactions and indexes

2021-07-22 Thread Chris Cleveland
> > Are you implementing a new index AM or a new table AM? Discarding data > based on something like a relevance score doesn't seem like something > that either API provides for. Indexes in Postgres can be lossy, but > that in itself doesn't change the result of queries. > (Sorry if this doesn't

Outdated comment in get_agg_clause_costs

2021-07-22 Thread David Rowley
I noticed that get_agg_clause_costs still claims that it recursively finds Aggrefs in the expression tree, but I don't think that's been true since 0a2bc5d61. I've attached a patch that adjusts the comment so it's more aligned to what it now does. David

Re: Followup Timestamp to timestamp with TZ conversion

2021-07-22 Thread Tom Lane
Peter Volk writes: > The problem is that I have a 60TB+ PG installation for which we need to > modify all of the timestamp columns to timestamp with tz. The data in the > columns are already in UTC so we can benefit from the patch listed above. > Yet there are 2 cases in which we are having an

Re: Incorrect usage of strtol, atoi for non-numeric junk inputs

2021-07-22 Thread Alvaro Herrera
On 2021-Jul-21, Michael Paquier wrote: > +/* > + * option_parse_int > + * > + * Parse an integer for a given option. Returns true if the parsing > + * could be done with optionally *result holding the parsed value, and > + * false on failure. > + */ May I suggest for the second sentence

Re: window build doesn't apply PG_CPPFLAGS correctly

2021-07-22 Thread Alvaro Herrera
On 2021-Jul-22, Pavel Stehule wrote: > čt 22. 7. 2021 v 14:04 odesílatel Andrew Dunstan > napsal: > > Almost everything in the Makefiles is not used by the MSVC buid system. > > Using this one seems likely to be quite difficult, since the syntax for > > the MSVC compiler command line is very

Re: [BUG]Update Toast data failure in logical replication

2021-07-22 Thread Dilip Kumar
On Thu, Jul 22, 2021 at 4:11 PM Amit Kapila wrote: > > On Thu, Jun 3, 2021 at 5:15 PM Dilip Kumar wrote: > > > > On Wed, Jun 2, 2021 at 7:23 PM Dilip Kumar wrote: > > > > > > On Wed, Jun 2, 2021 at 7:20 PM Kuntal Ghosh > > > wrote: > > > > > > > > On Wed, Jun 2, 2021 at 3:10 PM Dilip Kumar

Re: psql - add SHOW_ALL_RESULTS option

2021-07-22 Thread Fabien COELHO
Ok. I noticed. The patch got significantly broken by the watch pager commit. I also have to enhance the added tests (per Peter request). I wrote a test to check psql query cancel support. I checked that it fails against the patch that was reverted. Maybe this is useful. Here is the

Re: WIP: Relaxing the constraints on numeric scale

2021-07-22 Thread Dean Rasheed
On Wed, 21 Jul 2021 at 22:33, Tom Lane wrote: > > I took a brief look at this and have a couple of quick suggestions: > Thanks for looking at this! > * As you mention, keeping some spare bits in the typmod might come > in handy some day, but as given this patch isn't really doing so. > I think

Re: Detecting File Damage & Inconsistencies

2021-07-22 Thread Simon Riggs
On Wed, 14 Jul 2021 at 05:01, Amit Kapila wrote: > The patch is simple but its use doesn't seem to be very clear. You > have mentioned its use for future PITR patches and Craig mentioned > some use cases in logical decoding and it appears to me that to > support the use cases mentioned by Craig,

Re: row filtering for logical replication

2021-07-22 Thread Dilip Kumar
On Thu, Jul 22, 2021 at 5:15 PM Amit Kapila wrote: > > On Tue, Jul 20, 2021 at 4:33 PM Dilip Kumar wrote: > > > > On Tue, Jul 20, 2021 at 3:43 PM Tomas Vondra > > wrote: > > > > > > Do we log the TOAST-ed values that were not updated? > > > > No, we don't, I have submitted a patch sometime back

Re: psql - add SHOW_ALL_RESULTS option

2021-07-22 Thread Pavel Stehule
čt 22. 7. 2021 v 16:49 odesílatel Fabien COELHO napsal: > > Hello, > > > Minimally for PSQL_WATCH_PAGER, the pager should exit after some time, > but > > before it has to repeat data reading. Elsewhere the psql will hang. > > Sure. The "pager.pl" script I sent exits after reading a few lines. >

Re: window build doesn't apply PG_CPPFLAGS correctly

2021-07-22 Thread Andrew Dunstan
On 7/22/21 8:11 AM, Pavel Stehule wrote: > > > čt 22. 7. 2021 v 14:04 odesílatel Andrew Dunstan > napsal: > > > On 7/22/21 12:06 AM, Pavel Stehule wrote: > > Hi > > > > I tried to write test for plpgsql debug API, where I need to > access to >

Re: printf %s with NULL pointer (was Re: BUG #17098: Assert failed on composing an error message when adding a type to an extension being dropped)

2021-07-22 Thread Tom Lane
Peter Eisentraut writes: > On 14.07.21 18:26, Tom Lane wrote: >> https://git.musl-libc.org/cgit/musl/tree/src/stdio/vfprintf.c#n593 >> case 's': >> a = arg.p ? arg.p : "(null)"; > Similar here: > https://github.com/ensc/dietlibc/blob/master/lib/__v_printf.c#L188 I also took a look at μClibc,

Followup Timestamp to timestamp with TZ conversion

2021-07-22 Thread Peter Volk
Hi, this is a followup to a performance optimization during the conversion of a column from a timestamp column to a "timestamp with tz" column. The initial patch I am referring to is this one: https://git.postgresql.org/gitweb/?p=postgresql.git=commitdiff=3c59263#patch4 and the previous

Re: psql - add SHOW_ALL_RESULTS option

2021-07-22 Thread Fabien COELHO
Hello, Minimally for PSQL_WATCH_PAGER, the pager should exit after some time, but before it has to repeat data reading. Elsewhere the psql will hang. Sure. The "pager.pl" script I sent exits after reading a few lines. can be solution to use special mode for psql, when psql will do write

pg_amcheck: Fix block number parsing on command line

2021-07-22 Thread Peter Eisentraut
It seems to me that when using the pg_amcheck --startblock and --endblock options on platforms where sizeof(long) == 4, you cannot specify higher block numbers (unless you do tricks with negative numbers). The attached patch should fix this by using strtoul() instead of strtol(). I also

Re: Rename of triggers for partitioned tables

2021-07-22 Thread Arne Roland
Hi, looking at the patch, I realized the renametrig_partition could use an index leading with tgparentid, without the need to traverse the child tables. Since we still need to lock them, there is likely no practical performance gain. But I am surprised there is no unique index on

Re: psql - add SHOW_ALL_RESULTS option

2021-07-22 Thread Pavel Stehule
čt 22. 7. 2021 v 16:58 odesílatel Fabien COELHO napsal: > > >> Ok. I noticed. The patch got significantly broken by the watch pager > >> commit. I also have to enhance the added tests (per Peter request). > > > > I wrote a test to check psql query cancel support. I checked that it > fails > >

Re: psql - add SHOW_ALL_RESULTS option

2021-07-22 Thread Pavel Stehule
čt 22. 7. 2021 v 17:23 odesílatel Pavel Stehule napsal: > > > čt 22. 7. 2021 v 16:58 odesílatel Fabien COELHO > napsal: > >> >> >> Ok. I noticed. The patch got significantly broken by the watch pager >> >> commit. I also have to enhance the added tests (per Peter request). >> > >> > I wrote a

Re: Delegating superuser tasks to new security roles (Was: Granting control of SUSET gucs to non-superusers)

2021-07-22 Thread Robert Haas
On Fri, May 28, 2021 at 1:42 PM Mark Dilger wrote: > > pg_logical_replication would not be safe to delegate that way: > > https://postgr.es/m/flat/CACqFVBbx6PDq%2B%3DvHM0n78kHzn8tvOM-kGO_2q_q0zNAMT%2BTzdA%40mail.gmail.com > > Oh, I agree that this patch set does not go the extra step to make it

Re: logical replication empty transactions

2021-07-22 Thread Ajin Cherian
On Thu, Jul 22, 2021 at 6:11 PM Peter Smith wrote: > > Hi Ajin. > > I have reviewed the v8 patch and my feedback comments are below: > > // > > 1. Apply v8 gave multiple whitespace warnings. > > -- > > 2. Commit comment - wording > > If (when processing a COMMIT / PREPARE message) we

Re: Numeric x^y for negative x

2021-07-22 Thread Dean Rasheed
On Thu, 22 Jul 2021 at 06:13, Yugo NAGATA wrote: > > Thank you for updating the patch. I am fine with the additional comments. > I don't think there is any other problem left, so I marked it > Ready-for-Committers. > Thanks for looking. Barring any further comments, I'll push this in a few

Re: Hook for extensible parsing.

2021-07-22 Thread Julien Rouhaud
On Thu, Jul 22, 2021 at 12:01:34PM +0530, vignesh C wrote: > > 1) CFBOT showed the following compilation errors in windows: Thanks for looking at it. I'm aware of this issue on windows, but as mentioned in the thread the new contrib is there to demonstrate how the new infrastructure works. If

Re: Add proper planner support for ORDER BY / DISTINCT aggregates

2021-07-22 Thread David Rowley
On Thu, 22 Jul 2021 at 02:01, Ronan Dunklau wrote: > I tested the 0001 patch against both HEAD and my proposed bugfix for > postgres_fdw. > > There is a problem that the ordered aggregate is not pushed down anymore. The > underlying Sort node is correctly pushed down though. > > This comes from

Re: Add proper planner support for ORDER BY / DISTINCT aggregates

2021-07-22 Thread Ronan Dunklau
Le jeudi 22 juillet 2021, 09:38:50 CEST David Rowley a écrit : > On Thu, 22 Jul 2021 at 02:01, Ronan Dunklau wrote: > > I tested the 0001 patch against both HEAD and my proposed bugfix for > > postgres_fdw. > > > > There is a problem that the ordered aggregate is not pushed down anymore. > > The

Re: Case expression pushdown

2021-07-22 Thread Alexander Pyhalov
Tom Lane писал 2021-07-21 19:49: Gilles Darold writes: I'm attaching the v5 patch again as it doesn't appears in the Latest attachment list in the commitfest. So this has a few issues: Hi. 1. In foreign_expr_walker, you're failing to recurse to either the "arg" or "defresult" subtrees

Re: psql - add SHOW_ALL_RESULTS option

2021-07-22 Thread Pavel Stehule
čt 22. 7. 2021 v 11:00 odesílatel Fabien COELHO napsal: > > Hello Pavel, > > >> The newly added PSQL_WATCH_PAGER feature which broke the patch does not > >> seem to be tested anywhere, this is tiring:-( > > > > Do you have any idea how this can be tested? > > The TAP patch sent by Peter on this

Re: printf %s with NULL pointer (was Re: BUG #17098: Assert failed on composing an error message when adding a type to an extension being dropped)

2021-07-22 Thread Peter Eisentraut
On 14.07.21 18:26, Tom Lane wrote: Peter Eisentraut writes: In this particular case, I would for example be quite curious how those alternative minimal C libraries such as musl-libc handle this. Interesting question, so I took a look:

Re: Hook for extensible parsing.

2021-07-22 Thread vignesh C
On Sat, Jun 12, 2021 at 1:59 PM Julien Rouhaud wrote: > > On Tue, Jun 08, 2021 at 12:16:48PM +0800, Julien Rouhaud wrote: > > On Sun, Jun 06, 2021 at 02:50:19PM +0800, Julien Rouhaud wrote: > > > On Sat, May 01, 2021 at 03:24:58PM +0800, Julien Rouhaud wrote: > > > > > > > > I'm attaching some

Re: ORDER BY pushdowns seem broken in postgres_fdw

2021-07-22 Thread Ronan Dunklau
Le jeudi 22 juillet 2021, 02:16:52 CEST Ranier Vilela a écrit : > Unfortunately your patch does not apply clear into the head. > So I have a few suggestions on v2, attached with the .txt extension to > avoid cf bot. > Please, if ok, make the v3. Hum weird, it applied cleanly for me, and was

Re: Kerberos delegation support in libpq and postgres_fdw

2021-07-22 Thread Peifeng Qiu
Hi all. I've slightly modified the patch to support "gssencmode" and added TAP tests. Best regards, Peifeng Qiu From: Peifeng Qiu Sent: Tuesday, July 20, 2021 11:05 AM To: pgsql-hackers@lists.postgresql.org ; Magnus Hagander ; Stephen Frost ; Tom Lane

Re: ORDER BY pushdowns seem broken in postgres_fdw

2021-07-22 Thread Ranier Vilela
Em qui., 22 de jul. de 2021 às 04:00, Ronan Dunklau escreveu: > Le jeudi 22 juillet 2021, 02:16:52 CEST Ranier Vilela a écrit : > > Unfortunately your patch does not apply clear into the head. > > So I have a few suggestions on v2, attached with the .txt extension to > > avoid cf bot. > >

Re: psql - add SHOW_ALL_RESULTS option

2021-07-22 Thread Fabien COELHO
Hello Pavel, The newly added PSQL_WATCH_PAGER feature which broke the patch does not seem to be tested anywhere, this is tiring:-( Do you have any idea how this can be tested? The TAP patch sent by Peter on this thread is a very good start. It requires some pager that doesn't use blocking

Re: postgres_fdw: Handle boolean comparison predicates

2021-07-22 Thread Ronan Dunklau
Le lundi 31 mai 2021, 18:51:57 CEST Emre Hasegeli a écrit : > > Please add this patch to the commitfest so that it's not forgotten. It > > will be considered as a new feature so will be considered for commit > > after the next commitfest. > > I did [1]. You can add yourself as a reviewer. > > >

Re: A (but copied many) typo of char-mapping tables

2021-07-22 Thread Peter Eisentraut
On 16.07.21 10:02, Kyotaro Horiguchi wrote: While I looked into a .map file in src/backend/utils/mb/Unicode, I notice of a typo in it. > static const pg_mb_radix_tree euc_jp_from_unicode_tree = > { > .. > 0x, /* offset of table for 1-byte inputs */ > ... > 0x0040, /* offset

Re: ORDER BY pushdowns seem broken in postgres_fdw

2021-07-22 Thread David Rowley
On Thu, 22 Jul 2021 at 19:00, Ronan Dunklau wrote: > Please find it reattached. +-- This will not be pushed either +explain verbose select * from ft2 order by c1 using operator(public.<^); + QUERY PLAN

Re: .ready and .done files considered harmful

2021-07-22 Thread Jeevan Ladhe
Thanks, Dipesh. The patch LGTM. Some minor suggestions: + * + * "nextLogSegNo" identifies the next log file to be archived in a log + * sequence and the flag "dirScan" specifies a full directory scan to find + * the next log file. IMHO, this comment should go atop of pgarch_readyXlog() as a

Re: logical replication empty transactions

2021-07-22 Thread Peter Smith
Hi Ajin. I have reviewed the v8 patch and my feedback comments are below: // 1. Apply v8 gave multiple whitespace warnings. -- 2. Commit comment - wording If (when processing a COMMIT / PREPARE message) we find there had been no other change for that transaction, then do not send

Re: BUG #15293: Stored Procedure Triggered by Logical Replication is Unable to use Notification Events

2021-07-22 Thread Artur Zakirov
Hello hackers, On Wed, Jul 14, 2021 at 11:30 AM Sergey Fedchenko wrote: > > Hi all! I still can reproduce it on 14beta1 version. I adapted a patch I > found in this thread > https://github.com/seregayoga/postgres/commit/338bc33f2cf77edde7c45bfdfb9f39a92ec57eb8 > . It solved this bug for me

Re: dynamic result sets support in extended query protocol

2021-07-22 Thread vignesh C
On Tue, Jun 29, 2021 at 7:10 PM Peter Eisentraut wrote: > > Here is an updated patch with some merge conflicts resolved, to keep it > fresh. It's still pending in the commit fest from last time. > > My focus right now is to work on the "psql - add SHOW_ALL_RESULTS > option" patch

Re: psql - add SHOW_ALL_RESULTS option

2021-07-22 Thread Pavel Stehule
Hi čt 22. 7. 2021 v 7:52 odesílatel Fabien COELHO napsal: > > >>> The patch does not apply on Head anymore, could you rebase and post a > >>> patch. I'm changing the status to "Waiting for Author". > >> > >> Ok. I noticed. The patch got significantly broken by the watch pager > >> commit. I

Re: A qsort template

2021-07-22 Thread Thomas Munro
On Thu, Jun 17, 2021 at 1:20 PM Thomas Munro wrote: > On Thu, Jun 17, 2021 at 1:14 PM Tom Lane wrote: > > The big problem in my mind, which would not be alleviated in the > > slightest by having a separate file, is that it'd be easy to miss > > removing entries if they ever become obsolete. > >

Re: [PATCH] Finally split StdRdOptions into HeapOptions and ToastOptions

2021-07-22 Thread Nikolay Shaplov
В письме от среда, 14 июля 2021 г. 15:09:12 MSK пользователь vignesh C написал: > The patch does not apply on Head anymore, could you rebase and post a > patch. I'm changing the status to "Waiting for Author". Thank you for notification. I've tried to rebase it and found out that some options

Re: ORDER BY pushdowns seem broken in postgres_fdw

2021-07-22 Thread Ronan Dunklau
Le jeudi 22 juillet 2021, 09:44:54 CEST David Rowley a écrit : > +-- This will not be pushed either > +explain verbose select * from ft2 order by c1 using operator(public.<^); > + QUERY PLAN >

Re: refactoring basebackup.c

2021-07-22 Thread Robert Haas
On Thu, Jul 22, 2021 at 1:14 PM tushar wrote: > On 7/19/21 8:29 PM, Dilip Kumar wrote: > > I am not sure why this is working, from the code I could not find if > > the backup target is server then are we doing anything with the -R > > option or we are just silently ignoring it > > OK, in an

Re: Rename of triggers for partitioned tables

2021-07-22 Thread Alvaro Herrera
On 2021-Jul-22, Arne Roland wrote: > > Hi, > > looking at the patch, I realized the renametrig_partition could use an index > leading with tgparentid, without the need to traverse the child tables. Since > we still need to lock them, there is likely no practical performance gain. > But I am

Re: truncating timestamps on arbitrary intervals

2021-07-22 Thread Bauyrzhan Sakhariyev
Is date_bin supposed to return the beginning of the bin? And does the sign of an interval define the "direction" of the bin? Judging by results of queries #1 and #2, sign of interval decides a direction timestamp gets shifted to (in both cases ts < origin) but when ts >origin (queries #3 and #4)

Re: refactoring basebackup.c

2021-07-22 Thread tushar
On 7/19/21 8:29 PM, Dilip Kumar wrote: I am not sure why this is working, from the code I could not find if the backup target is server then are we doing anything with the -R option or we are just silently ignoring it OK, in an  another scenario  I can see , "-t server" working with

Re: Rename of triggers for partitioned tables

2021-07-22 Thread Arne Roland
From: Alvaro Herrera Sent: Thursday, July 22, 2021 18:20 To: Arne Roland Subject: Re: Rename of triggers for partitioned tables If we have good use for such an index, I don't see why we can't add it. But I'm not sure that it is justified -- certainly if the only benefit is to make ALTER TRIGGER

Re: truncating timestamps on arbitrary intervals

2021-07-22 Thread John Naylor
On Thu, Jul 22, 2021 at 12:24 PM Bauyrzhan Sakhariyev < baurzhansahar...@gmail.com> wrote: > > Is date_bin supposed to return the beginning of the bin? Thanks for testing! And yes. > And does the sign of an interval define the "direction" of the bin? No, the boundary is intentionally the

Re: Delegating superuser tasks to new security roles (Was: Granting control of SUSET gucs to non-superusers)

2021-07-22 Thread Mark Dilger
> On Jul 22, 2021, at 8:29 AM, Robert Haas wrote: > > I don't think that we want to commit a patch to add a > pg_logical_replication role that can "eventually" be made staff to > delegate to non-superusers. Certainly not. What I meant on May 28 by "eventually" was that the patch set

Re: Delegating superuser tasks to new security roles (Was: Granting control of SUSET gucs to non-superusers)

2021-07-22 Thread Robert Haas
On Thu, Jul 1, 2021 at 11:59 AM Mark Dilger wrote > > On Jun 29, 2021, at 6:25 PM, Mark Dilger > > wrote: > > Please find attached a new set of patches. > > And again, this time attaching a fifth patch which includes the work to allow > users who belong to the right security role to SET and

Re: window build doesn't apply PG_CPPFLAGS correctly

2021-07-22 Thread Andrew Dunstan
On 7/22/21 9:41 AM, Alvaro Herrera wrote: > On 2021-Jul-22, Pavel Stehule wrote: > >> čt 22. 7. 2021 v 14:04 odesílatel Andrew Dunstan >> napsal: >>> Almost everything in the Makefiles is not used by the MSVC buid system. >>> Using this one seems likely to be quite difficult, since the syntax

Re: window build doesn't apply PG_CPPFLAGS correctly

2021-07-22 Thread Pavel Stehule
čt 22. 7. 2021 v 20:52 odesílatel Andrew Dunstan napsal: > > On 7/22/21 9:41 AM, Alvaro Herrera wrote: > > On 2021-Jul-22, Pavel Stehule wrote: > > > >> čt 22. 7. 2021 v 14:04 odesílatel Andrew Dunstan > >> napsal: > >>> Almost everything in the Makefiles is not used by the MSVC buid system. >

Re: Delegating superuser tasks to new security roles (Was: Granting control of SUSET gucs to non-superusers)

2021-07-22 Thread Stephen Frost
Greetings, * Robert Haas (robertmh...@gmail.com) wrote: > On Thu, Jul 1, 2021 at 11:59 AM Mark Dilger > wrote > > > On Jun 29, 2021, at 6:25 PM, Mark Dilger > > > wrote: > > > Please find attached a new set of patches. > > > > And again, this time attaching a fifth patch which includes the

Re: Rename of triggers for partitioned tables

2021-07-22 Thread Alvaro Herrera
On 2021-Jul-22, Arne Roland wrote: > alter table middle disable trigger b; > creates the same kind of inconsistency > alter trigger b on middle rename to something; > does. > With other words: enableing/disabling non-topmost triggers should be > forbidden as well. I'm not so sure about that ...

Re: proposal: enhancing plpgsql debug API - returns text value of variable content

2021-07-22 Thread Pavel Stehule
čt 22. 7. 2021 v 14:54 odesílatel Aleksander Alekseev < aleksan...@timescale.com> napsal: > Hi Pavel, > > >> I am sending an enhanced patch about the regress test for plpgsql's > debug API. > > Thanks for the test! I noticed some little issues with formatting and > typos. The corrected patch is

Re: pg_amcheck: Fix block number parsing on command line

2021-07-22 Thread Mark Dilger
> On Jul 22, 2021, at 7:56 AM, Peter Eisentraut > wrote: > > Please check that it's up to speed. > <0001-pg_amcheck-Fix-block-number-parsing-on-command-line.patch> This looks correct to me. Thanks for the fix. Your use of strtoul compares favorably to that in pg_resetwal in that you are

Re: Rename of triggers for partitioned tables

2021-07-22 Thread Alvaro Herrera
On 2021-Jul-22, Arne Roland wrote: > Since it is sort of the same problem, I think it might be worthwhile > to address it as well within this patch. Adding two to four ereports > doesn't sound like scope creeping to me, even though it touches > completely different code. I'll look into that as

Re: Rename of triggers for partitioned tables

2021-07-22 Thread Alvaro Herrera
On 2021-Jul-22, Arne Roland wrote: > I just noticed that apparently the > ALTER TABLE [ IF EXISTS ] [ ONLY ] name [ ENABLE | DISABLE ] TRIGGER ... > syntax albeit looking totally different and it already recurses, it > has precisely the same issue with pg_dump. In that case the ONLY > syntax

Re: Rename of triggers for partitioned tables

2021-07-22 Thread Arne Roland
From: Alvaro Herrera Sent: Thursday, July 22, 2021 19:33 To: Arne Roland Subject: Re: Rename of triggers for partitioned tables On 2021-Jul-22, Arne Roland wrote: > Since it is sort of the same problem, I think it might be worthwhile > to address it as well within this patch. Adding two to four

Re: Delegating superuser tasks to new security roles (Was: Granting control of SUSET gucs to non-superusers)

2021-07-22 Thread Robert Haas
On Thu, Jul 22, 2021 at 1:29 PM Mark Dilger wrote: > Certainly not. What I meant on May 28 by "eventually" was that the patch set > (posted May 25 and named "v3") had not yet implemented such security, as I > was fishing for comments from the community about whether the basic division > of

Re: Column Filtering in Logical Replication

2021-07-22 Thread Alvaro Herrera
One thing I just happened to notice is this part of your commit message : REPLICA IDENTITY columns are always replicated : irrespective of column names specification. ... for which you don't have any tests -- I mean, create a table with a certain REPLICA IDENTITY and later try to publish a set

Re: Followup Timestamp to timestamp with TZ conversion

2021-07-22 Thread Robert Haas
On Thu, Jul 22, 2021 at 11:29 AM Tom Lane wrote: > As a thought experiment to prove that this is an issue, suppose that > somebody invented an unsigned integer type, and made the cast from > regular int4 follow the rules of a C cast, so that e.g. -1 becomes > 2^32-1. Given that, an ALTER TYPE

Re: Followup Timestamp to timestamp with TZ conversion

2021-07-22 Thread Tom Lane
Robert Haas writes: > I agree that it doesn't follow in general. I think it does in the case > of timestamp and timestamptz, because I don't think either the choice > of time zone or the fact that we're reckoning relative to a time zone > can change which of two timestamps is considered earlier.

Re: Added schema level support for publication.

2021-07-22 Thread Greg Nancarrow
On Fri, Jul 23, 2021 at 10:56 AM tanghy.f...@fujitsu.com wrote: > > > After applying your V13 patch. I noticed that if I specify duplicate schema > names when using "ALTER PUBLICATION ... SET SCHEMA ...", I would get the > following error message: > > postgres=# ALTER PUBLICATION pub1 SET

Re: row filtering for logical replication

2021-07-22 Thread Amit Kapila
On Thu, Jul 22, 2021 at 8:06 PM Dilip Kumar wrote: > > On Thu, Jul 22, 2021 at 5:15 PM Amit Kapila wrote: > > > > On Tue, Jul 20, 2021 at 4:33 PM Dilip Kumar wrote: > > > > > > On Tue, Jul 20, 2021 at 3:43 PM Tomas Vondra > > > wrote: > > > > > > > > Do we log the TOAST-ed values that were not

Re: logical replication empty transactions

2021-07-22 Thread Greg Nancarrow
On Thu, Jul 22, 2021 at 11:37 PM Ajin Cherian wrote: > I have some minor comments on the v9 patch: (1) Several whitespace warnings on patch application (2) Suggested patch comment change: BEFORE: The current logical replication behaviour is to send every transaction to subscriber even though

  1   2   >