Re: Resolve UNKNOWN type to relevant type instead of text type while bulk update using values

2023-01-06 Thread Ashutosh Bapat
d as ANYNULLTYPE if specific type information is not available. This problem wouldn't arise then. Of course that's a lot of code to fix seemingly rare problem so may not be worth it still. -- Best Wishes, Ashutosh Bapat

Re: Logical replication timeout problem

2023-01-05 Thread Ashutosh Bapat
's a significant code. I don't think PostgreSQL has a facility to induce a delay at a particular place in the code. -- Best Wishes, Ashutosh Bapat

Timeout when changes are filtered out by the core during logical replication

2022-12-22 Thread Ashutosh Bapat
Hi All, A customer ran a script dropping a few dozens of users in a transaction. Before dropping a user they change the ownership of the tables owned by that user to another user and revoking all the accesses from that user in the same transaction. There were a few thousand tables whose privileges

Re: Exit walsender before confirming remote flush in logical replication

2022-12-22 Thread Ashutosh Bapat
that publisher cannot be stopped if large delay-time is > specified. I think the current behaviour is an artifact of using the same WAL sender code for both logical and physical replication. I agree with you that the logical WAL sender need not wait for all the WAL to be replayed downstream. I have not reviewed the patch though. -- Best Wishes, Ashutosh Bapat

Re: Infinite Interval

2022-12-12 Thread Ashutosh Bapat
nge. The patch uses both months and days together to avoid this problem. Please feel free to complete the patch, work on review comments etc. I will help as and when I find time. -- Best Wishes, Ashutosh Bapat From 09a8fef224a3682059fe1adf42957f693a41d242 Mon Sep 17 00:00:00 2001 From: Ashutosh B

Re: Creating HeapTuple from char and date values

2022-12-08 Thread Ashutosh Bapat
rent configurations? is myValue a char *? I think you need to use CStringGetTextDatum instead of CStringGetDatum. -- Best Wishes, Ashutosh Bapat

Re: Missing MaterialPath support in reparameterize_path_by_child

2022-12-06 Thread Ashutosh Bapat
On Mon, Dec 5, 2022 at 8:13 PM Tom Lane wrote: > > Ashutosh Bapat writes: > > partition-wise join should be willing to fallback to non-partitionwise > > join in such a case. After spending a few minutes with the code, I > > think generate_partitionwise_join

Re: Missing MaterialPath support in reparameterize_path_by_child

2022-12-05 Thread Ashutosh Bapat
On Fri, Dec 2, 2022 at 9:13 PM Tom Lane wrote: > > Ashutosh Bapat writes: > > On Fri, Dec 2, 2022 at 8:25 AM Tom Lane wrote: > >> Unfortunately, I don't have an example that produces such a > >> failure against HEAD. It seems certain to me that such cases &

Re: Avoid streaming the transaction which are skipped (in corner cases)

2022-12-02 Thread Ashutosh Bapat
dXactNeedsSkip(), one which accepts a XLogRecordBuffer and other which accepts XLogReaderState. Then use those. That way at least we have logic unified as to which XLogRecPtr to use. -- Best Wishes, Ashutosh Bapat

Re: Missing MaterialPath support in reparameterize_path_by_child

2022-12-02 Thread Ashutosh Bapat
aths under appendrel has certainly expanded a lot because of partitioned table optimizations. The patch looks good to me. -- Best Wishes, Ashutosh Bapat

Re: Logical Replication Custom Column Expression

2022-12-02 Thread Ashutosh Bapat
On Wed, Nov 30, 2022 at 2:09 PM Stavros Koureas wrote: > > > > Στις Τρί 29 Νοε 2022 στις 3:27 μ.μ., ο/η Ashutosh Bapat > έγραψε: > > That would be too restrictive - not necessarily in your application > > but generally. There could be some tables where consolidating

Re: Logical Replication Custom Column Expression

2022-11-29 Thread Ashutosh Bapat
postgresql.org/wiki/Mailing_Lists. -- Best Wishes, Ashutosh Bapat

Re: Avoid distributing new catalog snapshot again for the transaction being decoded.

2022-11-25 Thread Ashutosh Bapat
SetupHistoricSnapshot(). But I didn't find a path through which SetupHistoricSnapshot() is called from SnapBuildCommitTxn(). Either I missed some code path or it's not needed. Can you please enlighten me? -- Best Wishes, Ashutosh Bapat On Fri, Nov 25, 2022 at 2:28 PM houzj.f...@fujitsu.com wrote

Re: Avoid streaming the transaction which are skipped (in corner cases)

2022-11-25 Thread Ashutosh Bapat
on in the streaming case > and also added an assert inside ReorderBufferForget() to ensure that > the transaction should have never been streamed. > > -- > Regards, > Dilip Kumar > EnterpriseDB: http://www.enterprisedb.com -- Best Wishes, Ashutosh Bapat

Re: Logical Replication Custom Column Expression

2022-11-25 Thread Ashutosh Bapat
on. In this example, do all the tables that a subscription subscribes to need that additional column or somehow the pglogical receiver will figure out which tables have that column and populate rows accordingly? My further fear is that the subscriber will also need to match the subscription column along with the rest of PK so as not to update rows from other subscriptions. -- Best Wishes, Ashutosh Bapat

Re: postgres_fdw binary protocol support

2022-11-22 Thread Ashutosh Bapat
reat to get some feedback and understand, > whether this is a welcome feature, before proceeding with all of the > abovementioned. > About the patch itself, I see a lot of if (binary) {} else {} block which are repeated. It will be good if we can add functions/macros to avoid duplication. -- Best Wishes, Ashutosh Bapat

Re: Catalog_xmin is not advanced when a logical slot is lost

2022-11-21 Thread Ashutosh Bapat
On Mon, Nov 21, 2022 at 5:39 PM Alvaro Herrera wrote: > > On 2022-Nov-21, Ashutosh Bapat wrote: > > > I think the condition should be > > > > if (!XLogRecPtrIsInvalid(invalidated_at_lsn)) LSN and XID are > > different data types. > > Yeah, this bit is wrong

Re: Logical Replication Custom Column Expression

2022-11-21 Thread Ashutosh Bapat
arios, on one subscriber a given upstream may be tenant 1 but on some other it could be 2. But I don't think we allow specifying subscription options for a single table. AFAIU, the origin ids are available as part of the commit record which contained this change; that's how conflict resolution is supposed to know it. So somehow the subscriber will need to fetch those from there and set the tenant. -- Best Wishes, Ashutosh Bapat

Re: Catalog_xmin is not advanced when a logical slot is lost

2022-11-21 Thread Ashutosh Bapat
e = WALAVAIL_REMOVED; we should also check restart_lsn. I would write this as bool invalidated_slot = false; then under spinlock invalidated_slot = XLogRecPtrIsInvalid(s->data.restart_lsn) && !XLogRecPtrIsInvalid(s->data.invalidated_at); if (invalidated_slot) continue. -- Best Wishes, Ashutosh Bapat

Re: Odd behavior with pg_stat_statements and queries called from SQL functions

2022-11-17 Thread Ashutosh Bapat
t if the two functions have different number of parameters in different > orders? $1 could mean different things in different cases, and good luck > finding out which one it is. At least with the parameter name you have a > chance to figure out what the parameter was exactly. > Reporting one of the parameters as is is a problem yes. Can the parameters be converted into some normailzed form like replacing parameters with ? (or some constant string indicating parameter) everywhere. -- Best Wishes, Ashutosh Bapat

const qualifier for list APIs

2022-11-16 Thread Ashutosh Bapat
. But SonarQube does complain about it. -- Best Wishes, Ashutosh Bapat

Re: Limit of WAL LSN value of type pg_lsn

2022-10-31 Thread Ashutosh Bapat
m/postgresql-backup-strategy-recovery-pitr-wal/ to be a good start. But there are many others which seem to be useful too. -- Best Wishes, Ashutosh Bapat

Re: PostgreSQL Logical decoding

2022-10-10 Thread Ashutosh Bapat
gical change, logical replication deals with transferring these changes to another server and applying those there. So they work in tandem; just one without the other can not be used. So I am confused about your requirements. -- Best Wishes, Ashutosh Bapat

Re: confirmed_flush_lsn shows LSN of the data that has not yet been received by the logical subscriber.

2022-09-21 Thread Ashutosh Bapat
On Mon, Sep 19, 2022 at 8:09 PM Ashutosh Sharma wrote: > > On Mon, Sep 19, 2022 at 5:24 PM Ashutosh Bapat > wrote: > > > > On Mon, Sep 19, 2022 at 1:43 PM Ashutosh Sharma > > wrote: > > > > > > On Fri, Sep 9, 2022 at 5:36 PM Ashutosh Bapat > >

Re: confirmed_flush_lsn shows LSN of the data that has not yet been received by the logical subscriber.

2022-09-19 Thread Ashutosh Bapat
On Mon, Sep 19, 2022 at 1:43 PM Ashutosh Sharma wrote: > > On Fri, Sep 9, 2022 at 5:36 PM Ashutosh Bapat > wrote: > > > > On Thu, Sep 8, 2022 at 8:32 PM Ashutosh Sharma > > wrote: > > > > > > On Thu, Sep 8, 2022 at 6:23 PM Ashutosh Bapat > >

Re: confirmed_flush_lsn shows LSN of the data that has not yet been received by the logical subscriber.

2022-09-09 Thread Ashutosh Bapat
On Thu, Sep 8, 2022 at 8:32 PM Ashutosh Sharma wrote: > > On Thu, Sep 8, 2022 at 6:23 PM Ashutosh Bapat > wrote: > > > > On Thu, Sep 8, 2022 at 4:14 PM Ashutosh Sharma > > wrote: > > > > > > Hi All, > > > > > > The logica

Re: confirmed_flush_lsn shows LSN of the data that has not yet been received by the logical subscriber.

2022-09-08 Thread Ashutosh Bapat
A useful effect of this is to reduce WAL retention by moving restart_lsn based on the latest confirmed_flush_lsn. -- Best Wishes, Ashutosh Bapat

Re: Add semi-join pushdown to postgres_fdw

2022-08-29 Thread Ashutosh Bapat
gt; 10)) AND ((date(c5) = '1970-01-17'::date)) -(14 rows) + Relations: (public.ft1 t1) SEMI JOIN (public.ft2 t2) + Remote SQL: SELECT r1."C 1", r1.c2, r1.c3, r1.c4, r1.c5, r1.c6, r1.c7, r1.c8 FROM "S 1"."T 1" r1 WHERE ((r1."C 1" < 20)) AND (EXISTS (SELECT NULL FROM "S 1"."T 1" r3 WHERE ((r3."C 1" > 10)) AND ((date(r3.c5) = '1970-01-17'::date)) AND ((r1.c3 = r3.c3 ORDER BY r1."C 1" ASC NULLS LAST +(4 rows) date_in | s |1 | [0:0]={cstring} date_in which will be used to cast a test to date is not immutable. So the query should't be pushed down. May not be a problem with your patch. Can you please check? -- Best Wishes, Ashutosh Bapat

Re: Improve description of XLOG_RUNNING_XACTS

2022-07-27 Thread Ashutosh Bapat
Masahiko Sawada wrote: > On Thu, Jul 21, 2022 at 10:13 PM Ashutosh Bapat > wrote: > > > > Hi > > > > On Thu, Jul 21, 2022 at 6:44 AM Masahiko Sawada > wrote: > > > > > > Hi, > > > > > > I realized that standby_desc_running_xact

Re: Improve description of XLOG_RUNNING_XACTS

2022-07-21 Thread Ashutosh Bapat
be more verbose and print "subxid overflowed" instead of "subxid ovf". -- Best Wishes, Ashutosh Bapat

Re: Make COPY extendable in order to support Parquet and other formats

2022-06-22 Thread Ashutosh Bapat
tever other format is. I understand that that's not going to be as efficient as dumping directly in the desired format. -- Best Wishes, Ashutosh Bapat

Re: Make COPY extendable in order to support Parquet and other formats

2022-06-21 Thread Ashutosh Bapat
uet or other formats? Of course the later is much larger in scope compared to the first one. But there may already be efforts underway [1] https://www.postgresql.org/about/news/parquet-s3-fdw-01-was-newly-released-2179/ I have not used it myself or worked with it. -- Best Wishes, Ashutosh Bapat

Re: doc phrase: "inheritance child"

2022-05-24 Thread Ashutosh Bapat
Hi Justin, @@ -7306,7 +7306,7 @@ SCRAM-SHA-256$iteration count: Normally there is one entry, with stainherit = false, for each table column that has been analyzed. - If the table has inheritance children, a second entry with + If the table has inheritance children or partitions, a

Re: Tracking notnull attributes inside Var

2022-05-17 Thread Ashutosh Bapat
ls or not. This is interesting. It might have impact on set_plan_references and planner's ability to search and match expressions. But if we take the approach I have suggested earlier, this question will not arise. -- Best Wishes, Ashutosh Bapat

Re: Allowing REINDEX to have an optional name

2022-05-10 Thread Ashutosh Bapat
On Tue, May 10, 2022 at 7:30 PM Simon Riggs wrote: > On Tue, 10 May 2022 at 14:47, Ashutosh Bapat > wrote: > > > > On Tue, May 10, 2022 at 2:43 PM Simon Riggs > > wrote: > > > > > > A minor issue, and patch. > > > > > > REIND

Re: Allowing REINDEX to have an optional name

2022-05-10 Thread Ashutosh Bapat
skipped. the syntax looks unintuitive. I think REINDEX DATABASE reindexing the current database is a good usability improvement in itself. But skipping the shared catalogs needs an explicity syntax. Not sure how feasible it is but something like REINDEX DATABASE skip SHARED/SYSTEM. -- Best Wishes, Ashutosh Bapat

Re: Proposal: add a debug message about using geqo

2022-05-10 Thread Ashutosh Bapat
ning PostgreSQL, user can determine the suitable value of > geqo_threshold parameter. > > Best regards. > > -- > KAWAMOTO Masaya > SRA OSS, Inc. Japan -- Best Wishes, Ashutosh Bapat

Re: Add pg_strtoupper and pg_strtolower functions

2022-05-02 Thread Ashutosh Bapat
e places in the code. Converting pg_toupper and pg_tolower to "inline" might save cost similarly and also avoid code duplication? -- Best Wishes, Ashutosh Bapat

Re: Progress report removal of temp files and temp relation files using ereport_startup_progress

2022-05-02 Thread Ashutosh Bapat
ontents of the directory to estimate how much it should wait. -- Best Wishes, Ashutosh Bapat

Re: How to simulate sync/async standbys being closer/farther (network distance) to primary in core postgres?

2022-04-06 Thread Ashutosh Bapat
tools/libraries that can help us to do that. Googling gives OS specific tools but nothing like a C or perl library which can be used for this purpose. -- Best Wishes, Ashutosh Bapat

Re: Handle infinite recursion in logical replication setup

2022-04-05 Thread Ashutosh Bapat
nated on publisher". From that angle origin = publisher/any looks attractive. It also leaves open the possibility that the subscriber may ask changes from a set of origins or even non-publisher origins. -- Best Wishes, Ashutosh Bapat

Re: Handle infinite recursion in logical replication setup

2022-04-04 Thread Ashutosh Bapat
> > > On Wed, Mar 30, 2022 at 7:40 PM Ashutosh Bapat > > > wrote: > > > > > > > > > > The changes for the same are available int the v5 patch available at > > > > > [1]. > > > > > [1] - > > >

Re: Handle infinite recursion in logical replication setup

2022-03-30 Thread Ashutosh Bapat
*/ +boolonly_local; /* publish only locally generated data */ Are we using this anywhere. I couldn't spot any usage of this member. I might be missing something though. -- Best Wishes, Ashutosh Bapat

Re: identifying unrecognized node type errors

2022-03-28 Thread Ashutosh Bapat
On Fri, Mar 25, 2022 at 7:23 PM Tom Lane wrote: > > Ashutosh Bapat writes: > > All these functions are too low level to be helpful to know. Knowing > > the caller might actually give a hint as to where the unknown node > > originated from. We may get that from t

Re: identifying unrecognized node type errors

2022-03-25 Thread Ashutosh Bapat
for the noise. > > > cheers > > > andrew > > -- > Andrew Dunstan > EDB: https://www.enterprisedb.com > > > -- Best Wishes, Ashutosh Bapat

Support isEmptyStringInfo

2022-03-23 Thread Ashutosh Bapat
those changes in this patch. I can do that if hackers like the idea. -- Best Wishes, Ashutosh Bapat From 0ff57f4b8f0094d581806f5553397c286736 Mon Sep 17 00:00:00 2001 From: Ashutosh Bapat Date: Wed, 23 Mar 2022 17:40:44 +0530 Subject: [PATCH] isEmptyStringInfo() to check whether StringInfo has

unnecessary (same) restart_lsn handing in LogicalIncreaseRestartDecodingForSlot

2022-03-16 Thread Ashutosh Bapat
ery installed candidate is updated in the slot by LogicalConfirmReceivedLocation() when the next confirmed flush arrives. Such an update also causes a disk write which looks unnecessary. I think the function should ignore a restart_lsn older than data.restart_lsn right away at the beginning of this function. -- Best Wishes, Ashutosh Bapat

Re: Handle infinite recursion in logical replication setup

2022-03-07 Thread Ashutosh Bapat
Hi Vignesh, I agree with Peter's comment that the changes to FilterRemoteOriginData() should be part of FilterByOrigin() Further, I wonder why "onlylocal_data" is a replication slot's property. A replication slot tracks the progress of replication and it may be used by different receivers with

Re: real/float example for testlibpq3

2022-02-28 Thread Ashutosh Bapat
ad of char *. That will standardize the way to fetch real typed values in libpq. That leads to the next question. Do we need to introduce different PQget*value() for standard C/SQL data types. -- Best Wishes, Ashutosh Bapat On Fri, Feb 25, 2022 at 3:12 AM Mark Wong wrote: > > Hi everyone,

Re: postgres_fdw and skip locked

2022-02-17 Thread Ashutosh Bapat
On Wed, Feb 16, 2022 at 8:38 PM Alexander Pyhalov wrote: > > Ashutosh Bapat писал 2022-02-16 16:40: > > On Mon, Feb 14, 2022 at 4:23 PM Alexander Pyhalov > > wrote: > >> > >> Hi. > >> > >> Now select ... for update ... [skip locked|nowait]

Re: postgres_fdw and skip locked

2022-02-16 Thread Ashutosh Bapat
will work for all kinds of relations. So no problem if foreign table is pointing to something other than a table. -- Best Wishes, Ashutosh Bapat

pg_walfile_name uses XLByteToPrevSeg

2022-02-04 Thread Ashutosh Bapat
Hi All, pg_walfile_name() returns the WAL file name corresponding to the given WAL location. Per https://www.postgresql.org/docs/14/functions-admin.html --- pg_walfile_name ( lsn pg_lsn ) → text Converts a write-ahead log location to the name of the WAL file holding that location. --- The

Re: Foreign join search stops on the first try

2022-01-25 Thread Ashutosh Bapat
ms It is surprising that the planning time halves with the patch. I expected it to increase slightly since we will compute estimates thrice instead of once. What is use_remote_estimate? Is it ON/OFF? If we want to proceed along this line, we should take care not to fire more EXPLAIN queries on the foreign server. -- Best Wishes, Ashutosh Bapat

Re: generic plans and "initial" pruning

2021-12-28 Thread Ashutosh Bapat
es, we will have "pre-execution" pruning instructions that can be used to skip locking partitions? Can you please give a few examples where this approach will be useful? The benchmark is showing good results, indeed. -- Best Wishes, Ashutosh Bapat

Re: Add Boolean node

2021-12-27 Thread Ashutosh Bapat
nteger nodes. This takes the place of both of these > uses, making the intent clearer and having some amount of type safety. -- Best Wishes, Ashutosh Bapat

Re: Add new function to convert 32-bit XID to 64-bit

2021-12-24 Thread Ashutosh Bapat
better to create a new type LongTransactionId or something like to represent 64bit transaction id and then change these functions to use that. -- Best Wishes, Ashutosh Bapat

Re: Throttling WAL inserts when the standby falls behind more than the configured replica_lag_in_bytes

2021-12-23 Thread Ashutosh Bapat
mon point for all kinds of logging including VACUUM. We could accidently stall a critical VACUUM operation because of that. As Bharath described, it better be handled at the application level monitoring. -- Best Wishes, Ashutosh Bapat

Re: more descriptive message for process termination due to max_slot_wal_keep_size

2021-12-23 Thread Ashutosh Bapat
On Wed, Dec 15, 2021 at 9:42 AM Kyotaro Horiguchi wrote: > > At Tue, 14 Dec 2021 19:31:21 +0530, Ashutosh Bapat > wrote in > > On Tue, Dec 14, 2021 at 9:35 AM Kyotaro Horiguchi > > wrote: > > > > [17605] LOG: terminating process 17614 to release replication

Re: more descriptive message for process termination due to max_slot_wal_keep_size

2021-12-14 Thread Ashutosh Bapat
. > > What do you think about this? Agree. I think we should also specify the restart_lsn value which would be within max_slot_wal_keep_size for better understanding. -- Best Wishes, Ashutosh Bapat

Re: Confused comment about drop replica identity index

2021-12-14 Thread Ashutosh Bapat
ording to the comments? > Comment in code is one thing, but I think PG documentation is not covering the use case you tried. What happens when a replica identity index is dropped has not been covered either in ALTER TABLE https://www.postgresql.org/docs/13/sql-altertable.html or DROP INDEX https://www.postgresql.org/docs/14/sql-dropindex.html documentation. -- Best Wishes, Ashutosh Bapat

Re: row filtering for logical replication

2021-12-08 Thread Ashutosh Bapat
r row filtering. > > > Instead of that can we add a "TRUE" filter on all the tables > > which are part of FOR ALL TABLES publication? > > > > How? We won't have an entry for such tables in pg_publication_rel > where we store row_filter information. I missed that.

Re: row filtering for logical replication

2021-12-07 Thread Ashutosh Bapat
y case), table tbl should be > treated as no filter, and table tbl should have no filter in subscription > sub. Thoughts? > > But for now, the filter(a > 10) works both when copying initial data and > later changes. > > To fix it, I think we can check if the table is published in a 'FOR ALL > TABLES' > publication or published as part of schema in function > pgoutput_row_filter_init > (which was introduced in v44-0003 patch), also we need to make some changes in > tablesync.c. In order to check "FOR ALL_TABLES", we might need to fetch publication metdata. Instead of that can we add a "TRUE" filter on all the tables which are part of FOR ALL TABLES publication? -- Best Wishes, Ashutosh Bapat

sentPtr jumping back at the beginning of logical replication

2021-10-06 Thread Ashutosh Bapat
er reads WAL. This seems to be harmless but the logical receiver may get confused if it receives an LSN lesser than confirmed_flush. -- Best Wishes, Ashutosh Bapat

Re: Diagnostic comment in LogicalIncreaseXminForSlot

2021-09-07 Thread Ashutosh Bapat
Thanks Amit. On Tue, Sep 7, 2021 at 11:14 AM Amit Kapila wrote: > > On Mon, Sep 6, 2021 at 5:29 PM Ashutosh Bapat > wrote: > > > > Yeah, I agree. Sorry for missing that. > > > > The updated patch looks good to me. > > > > Pushed! > > -

Re: Diagnostic comment in LogicalIncreaseXminForSlot

2021-09-06 Thread Ashutosh Bapat
Yeah, I agree. Sorry for missing that. The updated patch looks good to me. On Mon, Sep 6, 2021 at 3:25 PM Amit Kapila wrote: > On Tue, Aug 17, 2021 at 11:58 AM Ashutosh Bapat > wrote: > > > > Hi Amit and Andres, > > Here's updated patch > > > > I think

Re: Push down time-related SQLValue functions to foreign server

2021-08-19 Thread Ashutosh Bapat
oreign Update on public.test (cost=100.00..137.93 rows=414 > width=50) > Remote SQL: UPDATE data.test SET t = $1::timestamp with time > zone WHERE ((t < $1::timestamp with time zone)) > > -- > Best regards, > Alexander Pyhalov, > Postgres Professional -- Best Wishes, Ashutosh Bapat

Re: Diagnostic comment in LogicalIncreaseXminForSlot

2021-08-17 Thread Ashutosh Bapat
Hi Amit and Andres, Here's updated patch On Mon, Aug 9, 2021 at 11:14 AM Ashutosh Bapat < ashutosh.ba...@enterprisedb.com> wrote: > > > On Sat, Aug 7, 2021 at 11:40 AM Andres Freund wrote: > >> Hi, >> >> On 2021-07-12 17:28:15 +0530, Ashutosh Bapat wrote:

Re: Diagnostic comment in LogicalIncreaseXminForSlot

2021-08-08 Thread Ashutosh Bapat
On Sat, Aug 7, 2021 at 11:40 AM Andres Freund wrote: > Hi, > > On 2021-07-12 17:28:15 +0530, Ashutosh Bapat wrote: > > On Mon, Jul 12, 2021 at 8:39 AM Amit Kapila > wrote: > > > > > On Mon, Jul 5, 2021 at 12:54 PM Masahiko Sawada > > > > Today, aga

Re: Diagnostic comment in LogicalIncreaseXminForSlot

2021-07-12 Thread Ashutosh Bapat
On Mon, Jul 12, 2021 at 6:23 PM Amit Kapila wrote: > On Mon, Jul 12, 2021 at 5:28 PM Ashutosh Bapat > wrote: > > > > On Mon, Jul 12, 2021 at 8:39 AM Amit Kapila > wrote: > >> > >> I have noticed that > >> a nearby function LogicalIncreaseRestar

Re: Diagnostic comment in LogicalIncreaseXminForSlot

2021-07-12 Thread Ashutosh Bapat
On Mon, Jul 12, 2021 at 8:39 AM Amit Kapila wrote: > On Mon, Jul 5, 2021 at 12:54 PM Masahiko Sawada > wrote: > > > > On Fri, May 21, 2021 at 6:00 PM Ashutosh Bapat > > wrote: > > > > > > It's there in CF. I am fine with PG-15. It will be good to pa

Re: disfavoring unparameterized nested loops

2021-06-18 Thread Ashutosh Bapat
be there's not merit in this idea, thought theoretically it sounds fine to me. [1] https://pi3.informatik.uni-mannheim.de/~moer/Publications/vldb18_smpl_synop.pdf -- Best Wishes, Ashutosh Bapat

Re: Case expression pushdown

2021-06-15 Thread Ashutosh Bapat
ot;S 1"."T 1" SET c2 = (CASE WHEN (c2 > 0) > THEN c2 ELSE 0 END) WHERE (("C 1" > 1000)) > > > -- > Best regards, > Alexander Pyhalov, > Postgres Professional -- Best Wishes, Ashutosh Bapat

Re: Function scan FDW pushdown

2021-06-15 Thread Ashutosh Bapat
see this working with other FDWs? If we come up with the right approach we could use it for 1. pushing down queries with IN () clause 2. joining a small local table with a large foreign table by sending the local table rows down to the foreign server. -- Best Wishes, Ashutosh Bapat

Re: postgres_fdw: Handle boolean comparison predicates

2021-05-31 Thread Ashutosh Bapat
for them. > > I am adding this to the commitfest 2021-07. -- Best Wishes, Ashutosh Bapat

Re: Diagnostic comment in LogicalIncreaseXminForSlot

2021-05-21 Thread Ashutosh Bapat
On Fri, May 21, 2021 at 11:26 AM Amit Kapila wrote: > On Thu, May 20, 2021 at 5:43 PM Ashutosh Bapat > wrote: > > > > Hi > > LogicalIncreaseRestartDecodingForSlot() has a debug log to report a > > new restart_lsn. But the corresponding function for catalog_x

Diagnostic comment in LogicalIncreaseXminForSlot

2021-05-20 Thread Ashutosh Bapat
Hi LogicalIncreaseRestartDecodingForSlot() has a debug log to report a new restart_lsn. But the corresponding function for catalog_xmin. Here's a patch to add the same. -- Best Wishes, Ashutosh Bapat From 5d211016367fe352871647225ead64a2215c3184 Mon Sep 17 00:00:00 2001 From: Ashutosh Bapat

Re: postgres_fdw - should we tighten up batch_size, fetch_size options against non-numeric values?

2021-05-18 Thread Ashutosh Bapat
y test case as this change is a trivial thing. > If required, I can add one. That will help to make sure that we preserve the behaviour even through code changes. -- Best Wishes, Ashutosh Bapat

Re: postgres_fdw - should we tighten up batch_size, fetch_size options against non-numeric values?

2021-05-17 Thread Ashutosh Bapat
errors. We could define defGetUInt so that we could mention non-negative in the error message. Whether or not we do that, this looks good. -- Best Wishes, Ashutosh Bapat

Re: Query regarding RANGE Partitioning

2021-05-07 Thread Ashutosh Bapat
s equal > to the upper bound of that column then > the next column will be considered. > > So, In case of insertion of row (300, 50). Based on the understanding, > partition 'r3' should have rejected it. r3 contains (300, 0) to (300, 200) which contains (300, 50). First key 300 is equal to upper bound 300, so it compares 50, which is less than the upper bound of the second column. Am I missing something? -- Best Wishes, Ashutosh Bapat

Re: RFC: Detailed reorder buffer stats dumps

2021-05-05 Thread Ashutosh Bapat
ot be useful for the connections which are using normal backends to get logical changes through built-in functions. -- Best Wishes, Ashutosh Bapat

Re: Skip temporary table schema name from explain-verbose output.

2021-04-27 Thread Ashutosh Bapat
ts. You could add a flag to EXPLAIN to mask pg_temp name but that's probably an overkill. Filtering is a better option for tests. -- Best Wishes, Ashutosh Bapat

Re: CTE push down

2021-04-14 Thread Ashutosh Bapat
t and second time when scanning the materialized result. volatile quals may produce different results when run multiple times. > > Is there something else I miss? > Does somebody work on alternative solution or see issues in such > approach? IMO, a POC patch will help understand your idea. -- Best Wishes, Ashutosh Bapat

Re: CREATE SEQUENCE with RESTART option

2021-04-07 Thread Ashutosh Bapat
s://www.postgresql.org/docs/13/sql-altersequence.html together. At best CREATE SEQUENCE START ... RESTART ... can be a shorthand for CREATE SEQUENCE ... START; ALTER SEQUENCE ... RESTART run back to back. So it looks useful but in rare cases. Said all that I agree that if we are supporting CREATE SEQUENCE ... RESTART then we should document it, correctly. If that's not the intention, we should disallow RESTART with CREATE SEQUENCE. -- Best Wishes, Ashutosh Bapat

Re: UniqueKey on Partitioned table.

2021-03-31 Thread Ashutosh Bapat
ugh a key will start as a singleton it might EC partners later and thus thus unique key will transition to all the members. With that logic UniqueKey should use just ECs instead of bare expressions. -- Best Wishes, Ashutosh Bapat

Re: cursor already in use, UPDATE RETURNING bug?

2021-03-31 Thread Ashutosh Bapat
it to be closed automatically when the function finishes. But that's not what is documented at https://www.postgresql.org/docs/13/plpgsql-cursors.html. -- Best Wishes, Ashutosh Bapat

Re: UniqueKey on Partitioned table.

2021-03-29 Thread Ashutosh Bapat
gt;eq_classes longer) if we don't have > one , then I just used one Expr instead for this case. > However during the > test, I found some EquivalenceClass with only 1 EquivalenceMember > unexpectedly. > Pathkeys may induce single member ECs. Why UniqueKeys are an exception? -- Best Wishes, Ashutosh Bapat

Decoding speculative insert with toast leaks memory

2021-03-24 Thread Ashutosh Bapat
g/Diagnose-memory-leak-in-logical-replication-td6161318.html -- Best Wishes, Ashutosh Bapat diff --git a/src/backend/access/rmgrdesc/heapdesc.c b/src/backend/access/rmgrdesc/heapdesc.c index 318a281d7f..2fd01b53f5 100644 --- a/src/backend/access/rmgrdesc/heapdesc.c +++ b/src/backend/acces

Re: Why OR-clauses not getting copied into baserestrictinfo of another table whose columns are in the same EquivalenceClass?

2021-03-03 Thread Ashutosh Bapat
e care of eliminating the partitions in t2. Partition pruning will prune the partitions in t1. Partition-wise join will create joins between unpruned partitions of t1 with matching partitions of t2. Final plan will not have scans on partitions of t2 which do not match unpruned partitions of t1, effectively pruning t2 as well. You will need to set enable_partitionwise_join = true for that. -- Best Wishes, Ashutosh Bapat

Re: [PATCH] postgres-fdw: column option to override foreign types

2021-03-02 Thread Ashutosh Bapat
tems'); postgres_fdw assumes that the local type declared is semantically same as the remote type. Ideally the enum should also be declared locally and used to declare type's datatype. See how to handle UDTs in postgres_fdw at https://stackoverflow.com/questions/37734170/can-the-foreign-data-wrapper-fdw-postgres-handle-the-geometry-data-type-of-postg -- Best Wishes, Ashutosh Bapat

Re: Printing LSN made easy

2021-02-18 Thread Ashutosh Bapat
On Thu, Feb 18, 2021 at 6:19 PM Peter Eisentraut < peter.eisentr...@2ndquadrant.com> wrote: > Here is an updated patch that just introduces LSN_FORMAT_ARGS(). I > think the result is quite pleasant. > Thanks a lot Peter for producing this patch. I am fine with it. The way this is defined

Re: Keep notnullattrs in RelOptInfo (Was part of UniqueKey patch series)

2021-02-11 Thread Ashutosh Bapat
On Thu, Feb 11, 2021 at 8:22 PM Tom Lane wrote: > > Ashutosh Bapat writes: > > Can this information be part of PathTarget structure and hence part of > > RelOptInfo::reltarget, so that it can be extended to join, group and > > other kinds of RelOptInfo in future? >

Re: TRUNCATE on foreign table

2021-02-11 Thread Ashutosh Bapat
hich don't support SQL. mongo_fdw, > redis_fdw, etc... > These extensions have been used to provide SQL interfaces to the users. > It's hard for the user to run TRUNCATE after learning each database. this has some appeal. Thanks for sharing the usecases. -- Best Wishes, Ashutosh Bapat

Re: Keep notnullattrs in RelOptInfo (Was part of UniqueKey patch series)

2021-02-11 Thread Ashutosh Bapat
e-id/CAKU4AWr1BmbQB4F7j22G%2BNS4dNuem6dKaUf%2B1BK8me61uBgqqg%40mail.gmail.com >> -- >> Best Regards >> Andy Fan (https://www.aliyun.com/) > > > Add the missed patch.. > > -- > Best Regards > Andy Fan (https://www.aliyun.com/) -- Best Wishes, Ashutosh Bapat

Re: TRUNCATE on foreign table

2021-02-09 Thread Ashutosh Bapat
ble and hence it can not be executed on > > a foreign server. That's not true with TRUNCATE. > > Yeah, As you say, Applications doesn't need TRUNCATE. > We're focusing for analytical use, namely operating huge data. > TRUNCATE can erase rows faster than DELETE. The question is why can't that truncate be run on the foreign server itself rather than local server? -- Best Wishes, Ashutosh Bapat

Re: repeated decoding of prepared transactions

2021-02-09 Thread Ashutosh Bapat
On Wed, Feb 10, 2021 at 8:02 AM Amit Kapila wrote: > On Wed, Feb 10, 2021 at 12:08 AM Robert Haas > wrote: > > > > On Tue, Feb 9, 2021 at 6:57 AM Amit Kapila > wrote: > > > I think similar happens without any of the work done in PG-14 as well > > > if we restart the apply worker before the

Re: TRUNCATE on foreign table

2021-02-09 Thread Ashutosh Bapat
On Tue, Feb 9, 2021 at 5:49 PM Bharath Rupireddy wrote: > > On Tue, Feb 9, 2021 at 5:31 PM Ashutosh Bapat > wrote: > > Why would one want to truncate a foreign table instead of truncating > > actual table wherever it is? > > I think when the deletion on foreign tab

Re: TRUNCATE on foreign table

2021-02-09 Thread Ashutosh Bapat
85ff5c722b36c7a09b2dd7165 >>> >>> I have fixed the patch due to submit it to Commit Fest 2021-03. >>> >>> regards, >>> >>> -- >>> -- >>> Kazutaka Onishi >>> (oni...@heterodb.com) > > > > -- > -- > Kazutaka Onishi > (oni...@heterodb.com) > > > -- > -- > Kazutaka Onishi > (oni...@heterodb.com) -- Best Wishes, Ashutosh Bapat

Re: repeated decoding of prepared transactions

2021-02-08 Thread Ashutosh Bapat
WAL sender is restarted between sending prepare and commit prepared is a waste of network bandwidth. The wastage is proportional to the amount of changes in the transaction and number of such transactions themselves. Also this will cause performance degradation. So if we can avoid resending prepared transactions twice that will help. -- Best Wishes, Ashutosh Bapat

Re: Printing LSN made easy

2021-01-21 Thread Ashutosh Bapat
On Thu, Jan 21, 2021 at 3:53 PM Peter Eisentraut < peter.eisentr...@2ndquadrant.com> wrote: > On 2021-01-20 08:50, Ashutosh Bapat wrote: > > Thanks for looking into this. I would like to keep both the LSN_FORMAT > > and LSN_FORMAT_ARGS but with a note that the first can no

Re: Printing LSN made easy

2021-01-19 Thread Ashutosh Bapat
On Wed, Jan 20, 2021 at 11:55 AM Peter Eisentraut < peter.eisentr...@2ndquadrant.com> wrote: > On 2020-11-27 11:40, Ashutosh Bapat wrote: > > The solution seems to be simple though. In the attached patch, I have > > added two macros > > #define LSN_FORMAT "%X/%X

<    1   2   3   4   5   6   7   8   9   10   >