Re: Support ALTER SUBSCRIPTION ... ADD/DROP PUBLICATION ... syntax

2021-02-12 Thread japin
Thanks for your review again. On Wed, 10 Feb 2021 at 21:49, Bharath Rupireddy wrote: > On Fri, Feb 5, 2021 at 6:51 PM japin wrote: >> On Fri, 05 Feb 2021 at 17:50, Bharath Rupireddy >> wrote: >> We will get cell == NULL when we iterate all items in publist. I use it &g

Re: Support ALTER SUBSCRIPTION ... ADD/DROP PUBLICATION ... syntax

2021-02-17 Thread japin
On Tue, 16 Feb 2021 at 09:58, Bharath Rupireddy wrote: > On Mon, Feb 15, 2021 at 8:13 AM Bharath Rupireddy > wrote: >> >> On Sat, Feb 13, 2021 at 11:41 AM japin wrote: >> > > IIUC, with the current patch, the new ALTER SUBSCRIPTION ... ADD/DROP >> > >

Re: Fix typo about WalSndPrepareWrite

2021-02-17 Thread japin
n the comment. > After review the code. It says "just as it's done in XLogSendPhysical", not fill out the sendtime with XLogSendPhysical. My bad. Sorry for the noise. I will close this cf entry. -- Regrads, Japin Li. ChengDu WenWu Information Technology Co.,Ltd.

Re: NOT VALID for Unique Indexes

2021-02-27 Thread japin
On Fri, 26 Feb 2021 at 17:36, Simon Riggs wrote: > On Mon, Jan 18, 2021 at 11:19 PM japin wrote: >> >> >> On Fri, 15 Jan 2021 at 00:22, Simon Riggs >> wrote: >> > As you may be aware the NOT VALID qualifier currently only applies to >> > CH

Use macros for calculating LWLock offset

2020-11-18 Thread japin
    LWLockInitialize(&lock->lock, LWTRANCHE_PREDICATE_LOCK_MANAGER); -- Best regards Japin Li diff --git a/src/backend/storage/lmgr/lwlock.c b/src/backend/storage/lmgr/lwlock.c index 2fa90cc095..108e652179 100644 --- a/src/backend/storage/lmgr/lwlock.c +++ b/src/b

Re: Terminate the idle sessions

2020-11-19 Thread japin
/* * (5) turn off the idle-in-transaction timeout */ ``` Please mention about idle-session timeout and check another comment. Thanks! Add the comment for idle-session timeout. -- Best regards Japin Li >From ca226701bd04d7c7f766776094610ef6a3e96279 Mon Sep 17 00:00

Re: EXPLAIN/EXPLAIN ANALYZE REFRESH MATERIALIZED VIEW

2021-01-08 Thread japin
* NB: We count on this to protect us against problems with refreshing the -* data using TABLE_INSERT_FROZEN. -*/ - CheckTableNotInUse(matviewRel, "REFRESH MATERIALIZED VIEW"); + relowner = matviewRel->rd_rel->relowner; After apply the patch, there i

Re: EXPLAIN/EXPLAIN ANALYZE REFRESH MATERIALIZED VIEW

2021-01-08 Thread japin
On Fri, 08 Jan 2021 at 17:24, Bharath Rupireddy wrote: > On Fri, Jan 8, 2021 at 1:50 PM japin wrote: >> Thanks for updating the patch! >> >> + /* Get the data generating query. */ >> + dataQuery = get_matview_query(stm

Re: EXPLAIN/EXPLAIN ANALYZE REFRESH MATERIALIZED VIEW

2021-01-08 Thread japin
On Sat, 09 Jan 2021 at 09:38, Bharath Rupireddy wrote: > On Fri, Jan 8, 2021 at 9:50 PM japin wrote: >> > Attaching v3 patches, please consider these for further review. >> > >> >> I find that both the declaration and definition of >> match_matview_wit

Re: Added schema level support for publication.

2021-01-11 Thread japin
her, see \d+ > t1, there will not be any associated publication in the output > 6) execute alter subscription refresh publication on the subscriber, > with the expectation that it should not receive the data from the > publisher for the table t1 since it's dropped from the publication in > (5) > 7) insert into table t1 on the publisher > 8) still the newly inserted data in (7) from the publisher, will be > received into the table t1 in the subscriber > > IIUC, the behaviour of ALTER PUBLICATION DROP TABLE from the docs and > the above use case, it looks like a bug to me. If I'm wrong, can > someone correct me? > Yes, if we modify the publication, we should refresh the subscription on each subscriber. It looks strange for me, especially for partitioned tables [1]. > Thoughts? > Can we trace the different between publication and subscription, and auto-refresh subscription on subscriber? [1] https://www.postgresql.org/message-id/flat/1D6DCFD2-0F44-4A18-BF67-17C2697B1631%40hotmail.com -- Regrads, Japin Li. ChengDu WenWu Information Technology Co.,Ltd.

Re: Logical Replication - behavior of ALTER PUBLICATION .. DROP TABLE and ALTER SUBSCRIPTION .. REFRESH PUBLICATION

2021-01-11 Thread japin
replicate the records. As I said in [1], if we don't insert a new data in step-5, it will not replicate the records. In both cases, the AlterSubscription_refresh() call RemoveSubscriptionRel() and logicalrep_worker_stop_at_commit(). However, if we insert a data in step-5, it doesn't work a

Re: Logical Replication - behavior of ALTER PUBLICATION .. DROP TABLE and ALTER SUBSCRIPTION .. REFRESH PUBLICATION

2021-01-11 Thread japin
On Tue, 12 Jan 2021 at 13:39, Amit Kapila wrote: > On Tue, Jan 12, 2021 at 9:58 AM japin wrote: >> >> >> On Tue, 12 Jan 2021 at 11:37, Amit Kapila wrote: >> > On Mon, Jan 11, 2021 at 6:51 PM Bharath Rupireddy >> > wrote: >> >> >> >&g

Re: Logical Replication - behavior of ALTER PUBLICATION .. DROP TABLE and ALTER SUBSCRIPTION .. REFRESH PUBLICATION

2021-01-12 Thread japin
gt;> true in pgoutput_change(). Maybe the walsender should look at the >> catalogue pg_publication_rel in is_publishable_relation()? >> > > We must be somewhere checking pg_publication_rel before sending the > decoded change because otherwise, we would have sent the c

Re: Logical Replication - behavior of ALTER PUBLICATION .. DROP TABLE and ALTER SUBSCRIPTION .. REFRESH PUBLICATION

2021-01-12 Thread japin
On Tue, 12 Jan 2021 at 19:32, Bharath Rupireddy wrote: > On Tue, Jan 12, 2021 at 4:47 PM Li Japin wrote: >> IIUC the logical replication only replicate the tables in publication, I >> think >> when the tables that aren't in publication should not be replicated. >

Re: Logical Replication - behavior of ALTER PUBLICATION .. DROP TABLE and ALTER SUBSCRIPTION .. REFRESH PUBLICATION

2021-01-12 Thread japin
id 0 is valid because it >> will be applicable only during the table sync phase, the comment in the >> LogicalRepWorker structure says that. >> >> And also, I think, expecting the apply worker to be closed this way doesn't >> make sense because the apply worke

Re: Logical Replication - behavior of ALTER PUBLICATION .. DROP TABLE and ALTER SUBSCRIPTION .. REFRESH PUBLICATION

2021-01-13 Thread japin
e: >> > > >> > > On Tue, Jan 12, 2021 at 5:23 PM japin wrote: >> > > > >> > > > On Tue, 12 Jan 2021 at 19:32, Bharath Rupireddy wrote: >> > > > > On Tue, Jan 12, 2021 at 4:47 PM Li Japin wrote: >> > > > &g

Re: Logical Replication - behavior of ALTER PUBLICATION .. DROP TABLE and ALTER SUBSCRIPTION .. REFRESH PUBLICATION

2021-01-13 Thread japin
On Wed, 13 Jan 2021 at 17:23, Dilip Kumar wrote: > On Tue, Jan 12, 2021 at 4:47 PM Li Japin wrote: >> >> >> On Jan 12, 2021, at 5:47 PM, japin wrote: >> >> >> On Tue, 12 Jan 2021 at 14:38, Amit Kapila wrote: >> >> On Tue, Jan 12, 2021 at 11

Fix typo about WalSndPrepareWrite

2021-01-13 Thread japin
Hi, While reading the code about logical replication, I found that WalSndPrepareWrite function says it use XLogSendPhysical to fill out the sendtime, however, it actually done by WalSndWriteData. It looks like a typo, attaching a very small patch to correct it. -- Regrads, Japin Li. ChengDu

Re: Fix typo about WalSndPrepareWrite

2021-01-14 Thread japin
On Thu, 14 Jan 2021 at 15:32, Kyotaro Horiguchi wrote: > At Thu, 14 Jan 2021 06:46:35 +, Li Japin wrote in >> >> On Jan 14, 2021, at 12:56 PM, Ashutosh Bapat >> mailto:ashutosh.bapat@gmail.com>> wrote: >> >> Hi Japin, >> Thanks for the r

Re: Logical Replication - behavior of ALTER PUBLICATION .. DROP TABLE and ALTER SUBSCRIPTION .. REFRESH PUBLICATION

2021-01-14 Thread japin
On Thu, 14 Jan 2021 at 20:19, Bharath Rupireddy wrote: > On Thu, Jan 14, 2021 at 5:36 PM Li Japin wrote >> Do we really need to access PUBLICATIONRELMAP in this patch? What if >> we just set it to false in the else condition of (if (publish && >> (relkind != REL

Re: Logical Replication - behavior of ALTER PUBLICATION .. DROP TABLE and ALTER SUBSCRIPTION .. REFRESH PUBLICATION

2021-01-14 Thread japin
On Fri, 15 Jan 2021 at 14:50, Bharath Rupireddy wrote: > On Fri, Jan 15, 2021 at 11:33 AM Hou, Zhijie > wrote: >> >> > On Thu, Jan 14, 2021 at 5:36 PM Li Japin wrote >> > > Do we really need to access PUBLICATIONRELMAP in this patch? What if >>

Re: Logical Replication - behavior of ALTER PUBLICATION .. DROP TABLE and ALTER SUBSCRIPTION .. REFRESH PUBLICATION

2021-01-15 Thread japin
On Fri, 15 Jan 2021 at 15:49, japin wrote: > On Fri, 15 Jan 2021 at 14:50, Bharath Rupireddy > wrote: >> On Fri, Jan 15, 2021 at 11:33 AM Hou, Zhijie >> wrote: >>> >>> > On Thu, Jan 14, 2021 at 5:36 PM Li Japin wrote >>> > > Do we reall

Re: Logical Replication - behavior of ALTER PUBLICATION .. DROP TABLE and ALTER SUBSCRIPTION .. REFRESH PUBLICATION

2021-01-15 Thread japin
the meantime, can you add the test case in the patch as >> requested earlier as well. > > @Li Japin Please let me know if you have already started to work on > the test case, otherwise I can make a 0002 patch for the test case and > post. > Yeah, I'm working on the

Re: Logical Replication - behavior of ALTER PUBLICATION .. DROP TABLE and ALTER SUBSCRIPTION .. REFRESH PUBLICATION

2021-01-15 Thread japin
944/ > Thanks for the updated patch. -- Regrads, Japin Li. ChengDu WenWu Information Technology Co.,Ltd.

Narrow the scope of the variable outputstr in logicalrep_write_tuple

2021-01-17 Thread japin
utFunctionCall(typclass->typoutput, values[i]); pq_sendcountedtext(out, outputstr, strlen(outputstr), false); pfree(outputstr); } Attached is a samll patch to fix it. -- Regrads, Japin Li. ChengDu WenWu Information Technology Co.,Ltd. diff --git a/src/ba

Re: Narrow the scope of the variable outputstr in logicalrep_write_tuple

2021-01-18 Thread japin
On Mon, 18 Jan 2021 at 15:59, Bharath Rupireddy wrote: > On Mon, Jan 18, 2021 at 1:16 PM japin wrote: >> >> >> Hi, >> >> I find that the outputstr variable in logicalrep_write_tuple() only use in >> `else` branch, I think we can narrow the scope, just

Re: NOT VALID for Unique Indexes

2021-01-18 Thread japin
ALTER TABLE .. ADD table_constraint [ NOT VALID ] ALTER TABLE .. VALIDATE CONSTRAINT constraint_name Should we implement unique index valid/not valid same as foreign key and CHECK constraints? 3. If we use the syntax to valid/not valid the unique, should we support other constraints, such as foreign key and CHECK constraints? -- Regrads, Japin Li. ChengDu WenWu Information Technology Co.,Ltd.

Re: simplifying foreign key/RI checks

2021-01-18 Thread japin
t partition key values from the unique key. >> >> At the end of the nested loop, should there be an assertion that >> partkey->partnatts partition key values have been found ? >> This can be done by using a counter (initialized to 0) which is incremented >> when a m

Use boolean array for nulls parameters

2021-01-19 Thread japin
ether this chagnges cause other problems or not. Any thought? [1] - https://www.postgresql.org/message-id/flat/ca+hiwqgkfjfydeq5vhph6eqpkjsbfpddy+j-kxyfepqedts...@mail.gmail.com -- Regrads, Japin Li. ChengDu WenWu Information Technology Co.,Ltd. >From 7496f20ccfda7687333db9e5c43227ee30e4eda9 Mon

Re: Use boolean array for nulls parameters

2021-01-19 Thread japin
On Tue, 19 Jan 2021 at 23:45, Tom Lane wrote: > japin writes: >> When I review the [1], I find that the tuple's nulls array use char type. >> However there are many places use boolean array to repsent the nulls array, >> so I think we can replace the char type n

Re: Change default of checkpoint_completion_target

2021-01-19 Thread japin
ALTER SYSTEM in that list either. > If this was C code, maybe we could get away with just changing such > references as we find them, but I don't think we'd want the > documentation to be in an inconsistent state regarding that. > I have already mentioned this in [1], however it seems unattractive. [1] - https://www.postgresql.org/message-id/flat/199703E4-A795-4FB8-911C-D0DE9F51519C%40hotmail.com -- Regrads, Japin Li. ChengDu WenWu Information Technology Co.,Ltd.

Re: Identify missing publications from publisher while create/alter subscription.

2021-01-21 Thread japin
make another connection. > 3) If multiple publications are specified in the CREATE SUBSCRIPTION > query, IIUC, with your patch, the query fails even if at least one of > the publications doesn't exist. Should we throw a warning in this case > and allow the subscription be created for other existing > publications? > +1. If all the publications do not exist, we should throw an error. -- Regrads, Japin Li. ChengDu WenWu Information Technology Co.,Ltd.

Re: About to add WAL write/fsync statistics to pg_stat_wal view

2021-01-22 Thread japin
the reader >> because it's called even before the fsync method is called. As I >> commented above, calling to fsyncMethodCalled() can be eliminated. >> That way, this function is called at only once. So do we really need >> this function? > > Thanks to your comments, I removed them. > > >> * As far as I read the code, issue_xlog_fsync() seems to do fsync even >> if enableFsync is false. Why does the function return false in that >> case? I might be missing something. > > IIUC, the reason is that I thought that each fsync functions like > pg_fsync_no_writethrough() check enableFsync. > > If this code doesn't check, m_wal_sync_time may be incremented > even though some sync methods like SYNC_METHOD_OPEN don't call to sync > some data to the disk at the time. > >> * void is missing as argument? >> >> * s/mothod/method/ > > I removed them. > > > Regards, -- Regrads, Japin Li. ChengDu WenWu Information Technology Co.,Ltd.

Re: About to add WAL write/fsync statistics to pg_stat_wal view

2021-01-24 Thread japin
ly need to increment m_wal_sync > after doing fsync we can write the code without an additional variable > as follows: > > if (enableFsync) > { > switch (sync_method) > { > case SYNC_METHOD_FSYNC: > #ifdef HAVE_FSYNC_WRITETHROUGH > case SYNC_METHOD_FSYNC_WRITETHROUGH: > #endif > #ifdef HAVE_FDATASYNC > case SYNC_METHOD_FDATASYNC: > #endif > WalStats.m_wal_sync++; > if (track_wal_io_timing) > INSTR_TIME_SET_CURRENT(start); > break; > default: > break; > } > } > > (do fsync and error handling here) > >/* increment the i/o timing and the number of times to fsync WAL data */ >if (track_wal_io_timing) >{ >INSTR_TIME_SET_CURRENT(duration); >INSTR_TIME_SUBTRACT(duration, start); >WalStats.m_wal_sync_time = INSTR_TIME_GET_MICROSEC(duration); >} > > I think we can change the first switch-case to an if statement. > +1. We can also narrow the scope of "duration" into "if (track_wal_io_timing)" branch. -- Regrads, Japin Li. ChengDu WenWu Information Technology Co.,Ltd.

Re: Identify missing publications from publisher while create/alter subscription.

2021-01-25 Thread japin
non_existent_publication;? > > Or > > Do you mean when we drop publications from a subscription? If yes, do > we have a way to drop a publication from the subscription? See below > one of my earlier questions on this. > "I wonder, why isn't dropping a publication from a list of > publications that are with subscription is not allowed?" > At least, I see no ALTER SUBSCRIPTION ... DROP PUBLICATION mypub1 or > something similar? > Why we do not support ALTER SUBSCRIPTION...ADD/DROP PUBLICATION? When we have multiple publications in subscription, but I want to add/drop a single publication, it is conveient. The ALTER SUBSCRIPTION...SET PUBLICATION... should supply the completely publications. Sorry, this question is unrelated with this subject. -- Regrads, Japin Li. ChengDu WenWu Information Technology Co.,Ltd.

Support ALTER SUBSCRIPTION ... ADD/DROP PUBLICATION ... syntax

2021-01-25 Thread japin
7, mypub8; I think it's more convenient. Any thoughts? [1] - https://www.postgresql.org/message-id/MEYP282MB16690CD5EC5319FC35B2F78AB6BD0%40MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM -- Regrads, Japin Li. ChengDu WenWu Information Technology Co.,Ltd.

Re: Support ALTER SUBSCRIPTION ... ADD/DROP PUBLICATION ... syntax

2021-01-25 Thread japin
On Tue, 26 Jan 2021 at 11:47, japin wrote: > Hi, hackers > > When I read the discussion in [1], I found that update subscription's > publications > is complicated. > > For example, I have 5 publications in subscription. > > CREATE SUBSCRIPTION mysub1 CONN

Re: Identify missing publications from publisher while create/alter subscription.

2021-01-25 Thread japin
On Mon, 25 Jan 2021 at 21:55, Bharath Rupireddy wrote: > On Mon, Jan 25, 2021 at 5:18 PM japin wrote: >> > Do you mean when we drop publications from a subscription? If yes, do >> > we have a way to drop a publication from the subscription? See below >> > one o

Re: Support ALTER SUBSCRIPTION ... ADD/DROP PUBLICATION ... syntax

2021-01-25 Thread japin
Hi, Bharath Thanks for your reviewing. On Tue, 26 Jan 2021 at 12:55, Bharath Rupireddy wrote: > On Tue, Jan 26, 2021 at 9:25 AM japin wrote: >> > I think it's more convenient. Any thoughts? >> >> Sorry, I forgot to attach the patch. > > As I mentioned ear

Re: Support ALTER SUBSCRIPTION ... ADD/DROP PUBLICATION ... syntax

2021-01-26 Thread japin
On Tue, 26 Jan 2021 at 13:46, japin wrote: > Hi, Bharath > > Thanks for your reviewing. > > On Tue, 26 Jan 2021 at 12:55, Bharath Rupireddy > wrote: >> On Tue, Jan 26, 2021 at 9:25 AM japin wrote: >>> > I think it's more convenient. Any thoughts? &g

Fix ALTER SUBSCRIPTION ... SET PUBLICATION documentation

2021-01-26 Thread japin
rSubscription_refresh(sub, copy_data); } break; } Should we fix the documentation or the code? I'd be inclined fix the documentation. [1] - https://www.postgresql.org/docs/devel/sql-altersubscription.html -- Regrads, Japin Li. ChengDu WenWu In

Re: Support ALTER SUBSCRIPTION ... ADD/DROP PUBLICATION ... syntax

2021-01-27 Thread japin
DD > PUBLICATION, then it refreshes all the returned publications [3]. I > believe this is also true with ALTER SUBSCRIPTION ... DROP > PUBLICATION. > > So, I think the new syntax, ALTER SUBSCRIPTION .. ADD/DROP PUBLICATION > will refresh the new and existing publications. > Yes! It will refresh the new and existing publications. -- Regrads, Japin Li. ChengDu WenWu Information Technology Co.,Ltd.

Re: Support ALTER SUBSCRIPTION ... ADD/DROP PUBLICATION ... syntax

2021-01-27 Thread japin
On Wed, 27 Jan 2021 at 16:59, Amit Kapila wrote: > On Tue, Jan 26, 2021 at 9:18 AM japin wrote: >> >> >> When I read the discussion in [1], I found that update subscription's >> publications >> is complicated. >> >> For example, I hav

Re: Fix ALTER SUBSCRIPTION ... SET PUBLICATION documentation

2021-01-27 Thread japin
On Wed, 27 Jan 2021 at 19:47, Bharath Rupireddy wrote: > On Wed, Jan 27, 2021 at 4:57 PM Amit Kapila wrote: >> >> On Tue, Jan 26, 2021 at 4:56 PM japin wrote: >> > >> > >> > Hi, >> > >> > When I read the documentation of ALTER SU

Re: Support ALTER SUBSCRIPTION ... ADD/DROP PUBLICATION ... syntax

2021-01-27 Thread japin
On Thu, 28 Jan 2021 at 12:22, Bharath Rupireddy wrote: > On Wed, Jan 27, 2021 at 7:35 PM Li Japin wrote: >> > I don't see any problem if ALTER SUBSCRIPTION ... ADD PUBLICATION with >> > refresh true refreshes only the newly added publications,

Re: row filtering for logical replication

2021-02-01 Thread japin
n publisher postgres=# \dRp+ Publication mypub1 Owner | All tables | Inserts | Updates | Deletes | Truncates | Via root ---++-+-+-+---+-- japin | f |

Re: row filtering for logical replication

2021-02-01 Thread japin
On Tue, 02 Feb 2021 at 03:11, Euler Taveira wrote: > On Mon, Feb 1, 2021, at 6:11 AM, japin wrote: >> Thanks for updating the patch. Here are some comments: > Thanks for your review. I updated the documentation accordingly. > >> The documentation says: >> >

Re: memory leak in auto_explain

2021-02-02 Thread japin
lease ExplainState memory, however, it does not make sence, I do not know why this does not work? So I try to create it in queryDesc->estate->es_query_cxt memory context like queryDesc->totaltime, and it works. Attached fix the memory leakage in auto_explain.

Re: row filtering for logical replication

2021-02-02 Thread japin
ve bumped into this thread, and applied 0001. My guess is that > one of the patches developped originally for logical replication > defined atttypmod in LogicalRepRelation, but has finished by not using > it. Nice catch. Since the 0001 patch already be commited (4ad31bb2ef), we can remove

Re: row filtering for logical replication

2021-02-02 Thread japin
On Tue, 02 Feb 2021 at 19:16, japin wrote: > On Tue, 02 Feb 2021 at 13:02, Michael Paquier wrote: >> On Mon, Feb 01, 2021 at 04:11:50PM -0300, Euler Taveira wrote: >>> After the commit 3696a600e2, the last patch does not apply cleanly. I'm >>> attachin

Re: memory leak in auto_explain

2021-02-02 Thread japin
On Wed, 03 Feb 2021 at 02:13, Tom Lane wrote: > japin writes: >> Here's my analysis: >> 1) In the explain_ExecutorEnd(), it will create a ExplainState on SQL >> function >> memory context, which is a long-lived, cause the memory grow up. > > Yeah, agreed

Re: Support ALTER SUBSCRIPTION ... ADD/DROP PUBLICATION ... syntax

2021-02-03 Thread japin
On Wed, 03 Feb 2021 at 13:15, Bharath Rupireddy wrote: > On Thu, Jan 28, 2021 at 10:07 AM japin wrote: >> Attaching v3 patches, please consider these for further review. > > I think we can add a commitfest entry for this feature, so that the > patches will be tested on cfb

Re: Support ALTER SUBSCRIPTION ... ADD/DROP PUBLICATION ... syntax

2021-02-05 Thread japin
On Fri, 05 Feb 2021 at 17:50, Bharath Rupireddy wrote: > On Wed, Feb 3, 2021 at 2:02 PM japin wrote: >> On Wed, 03 Feb 2021 at 13:15, Bharath Rupireddy >> wrote: >> > On Thu, Jan 28, 2021 at 10:07 AM japin wrote: >> >> Attaching v3 patches, plea

Symbol referencing errors

2019-04-22 Thread Li Japin
l,-R'/home/postgres/pg11.2/lib' LDFLAGS_EX = LDFLAGS_SL = LIBS = -lpgcommon -lpgport -lz -lreadline -lnsl -lsocket -lm VERSION = PostgreSQL 11.2 Can anyone help me out? Thanks! Best regards! Japin Li

Re: Symbol referencing errors

2019-04-22 Thread Li Japin
, I couldn't startup the postgresql, and I find that the dlopen throw an error which lead postmaster exit, and there is not more information. regards, Japin Li

Re: Symbol referencing errors

2019-04-24 Thread Li Japin
, Li Japin wrote: Yes, those errors does not impact the postgresql, but when I use oracle_fdw extension, I couldn't startup the postgresql, and I find that the dlopen throw an error which lead postmaster exit, and there is not more information. That may wall be a bug in oracle_fdw, since I

Re: Built-in connection pooler

2019-08-06 Thread Li Japin
Hi, Konstantin I test the patch-16 on postgresql master branch, and I find the temporary table cannot removed when we re-connect to it. Here is my test: japin@ww-it:~/WwIT/postgresql/Debug/connpool$ initdb The files belonging to this database system will be owned by user "japin". This

Re: WIP: System Versioned Temporal Table

2021-02-25 Thread Li Japin
conflict correctly. Same as above. Since the get_row_start_time_col_name() and get_row_end_time_col_name() are similar, IMO we can pass a flag to get StartTime/EndTime column name, thought? -- Regrads, Japin Li. ChengDu WenWu Information Technology Co.,Ltd.

Re: EXPLAIN/EXPLAIN ANALYZE REFRESH MATERIALIZED VIEW

2021-03-03 Thread Japin Li
On Wed, 03 Mar 2021 at 20:56, David Steele wrote: > Do you know if you will have time to review this patch during the > current commitfest? > Sorry for the late reply! I think I have time to review this patch and I will do it later. -- Regrads, Japin Li. ChengDu WenWu Information T

Re: EXPLAIN/EXPLAIN ANALYZE REFRESH MATERIALIZED VIEW

2021-03-04 Thread Japin Li
urrent in get_new_heap_oid(). The others looks good to me. -- Regrads, Japin Li. ChengDu WenWu Information Technology Co.,Ltd.

Re: Inquiries about PostgreSQL's system catalog development——from a student developer of Nanjing University

2021-03-06 Thread Japin Li
the system backend, how > can I reach it? Is there any code or interface demonstration to show me? >     I am looking forward to your prompt reply. Heartfelt thanks. Here is a document on how to create a new system catalog for PostgreSQL 11. https://blog.japinli.top/2019/08/postgresql-new-cata

Re: EXPLAIN/EXPLAIN ANALYZE REFRESH MATERIALIZED VIEW

2021-03-06 Thread Japin Li
On Fri, 05 Mar 2021 at 19:48, Bharath Rupireddy wrote: > Attaching v5 patch set for further review. > The v5 patch looks good to me, if there is no objection, I'll change the cf status to "Ready for Committer" in few days. -- Regrads, Japin Li. ChengDu WenWu Information Technology Co.,Ltd.

Re: EXPLAIN/EXPLAIN ANALYZE REFRESH MATERIALIZED VIEW

2021-03-06 Thread Japin Li
On Sun, 07 Mar 2021 at 14:25, Bharath Rupireddy wrote: > On Sun, Mar 7, 2021 at 11:49 AM Japin Li wrote: >> >> On Fri, 05 Mar 2021 at 19:48, Bharath Rupireddy >> wrote: >> > Attaching v5 patch set for further review. >> > >> >> The v5 pat

Re: EXPLAIN/EXPLAIN ANALYZE REFRESH MATERIALIZED VIEW

2021-03-07 Thread Japin Li
On Sun, 07 Mar 2021 at 17:33, Bharath Rupireddy wrote: > On Sun, Mar 7, 2021 at 12:13 PM Japin Li wrote: >> >> On Sun, 07 Mar 2021 at 14:25, Bharath Rupireddy >> wrote: >> > On Sun, Mar 7, 2021 at 11:49 AM Japin Li wrote: >> >> >> &g

Re: Support ALTER SUBSCRIPTION ... ADD/DROP PUBLICATION ... syntax

2021-03-07 Thread Japin Li
ub->publications. Do you see any problems in doing so? If done > that, we can discard the 0001 patch and comments (1) and (3) becomes > irrelevant. Thank you point out this. Fixed it in v7 patch set. Please consider the v7 patch for futher review. -- Regrads, Japin Li. ChengDu WenWu Info

Re: EXPLAIN/EXPLAIN ANALYZE REFRESH MATERIALIZED VIEW

2021-03-12 Thread Japin Li
to put the 'if (explainInfo)' as the first check. That >> way, the check for skipData can be simplified. > > Changed. > > Thanks for review comments. Attaching v7 patch set with changes only > in 0002 patch. Please have a look. > The v7 patch looks good to me, and

Re: EXPLAIN/EXPLAIN ANALYZE REFRESH MATERIALIZED VIEW

2021-03-17 Thread Japin Li
> to keep our options open about how REFRESH might be implemented >> in future. > > That makes sense to me. Thanks for the comments. I'm fine to withdraw the > patch. > > I would like to see if the 0001 patch(attaching here) will be useful > at all. It just splits up the existing ExecRefreshMatView into a few > functions to make the code readable. +1. -- Regrads, Japin Li. ChengDu WenWu Information Technology Co.,Ltd.

Re: Support ALTER SUBSCRIPTION ... ADD/DROP PUBLICATION ... syntax

2021-03-23 Thread Japin Li
On Mon, 22 Mar 2021 at 11:14, Bharath Rupireddy wrote: > On Sun, Mar 7, 2021 at 7:21 PM Japin Li wrote: >> Thank you point out this. Fixed it in v7 patch set. >> >> Please consider the v7 patch for futher review. > > Thanks for the patches. I just found the followi

Re: Support ALTER SUBSCRIPTION ... ADD/DROP PUBLICATION ... syntax

2021-04-05 Thread Japin Li
de a final >> version in good time. > > I took the liberty to address all the review comments and provide a v9 > patch on top of Japin's v8 patch-set. > >> (Also, please combine your patches into a single patch.) > > Done. > > Attaching v9 patch, please rev

Re: Support ALTER SUBSCRIPTION ... ADD/DROP PUBLICATION ... syntax

2021-04-06 Thread Japin Li
On Tue, 06 Apr 2021 at 17:56, Peter Eisentraut wrote: > On 06.04.21 07:24, Japin Li wrote: >>>> I think this patch is about ready to commit, but please provide a final >>>> version in good time. >>> I took the liberty to address all the review comments

Re: Truncate in synchronous logical replication failed

2021-04-08 Thread Japin Li
ed * objects; we MUST reset these to null before considering the * lock to be acquired via fast-path. */ locallock->lock = NULL; locallock->proclock = NULL; GrantLockLocal(locallock, owner); return LOCKACQUIRE_

Re: Truncate in synchronous logical replication failed

2021-04-10 Thread Japin Li
On Thu, 08 Apr 2021 at 19:20, Japin Li wrote: > On Wed, 07 Apr 2021 at 16:34, tanghy.f...@fujitsu.com > wrote: >> On Wednesday, April 7, 2021 5:28 PM Amit Kapila >> wrote >> >>>Can you please check if the behavior is the same for PG-13? This is >>>

Re: Truncate in synchronous logical replication failed

2021-04-13 Thread Japin Li
_write_attrs(). > But, this change impacts on other several callers so is not as good as the > first direction above, I think. > > If someone has any better idea, please let me know. > I think the first idea is better than the second. OTOH, can we release the locks before SyncRepWaitForLSN(), since it already flush to local WAL files. -- Regrads, Japin Li. ChengDu WenWu Information Technology Co.,Ltd.

Forget close an open relation in ReorderBufferProcessTXN()

2021-04-15 Thread Japin Li
The RelationIdGetRelation() comment says: > Caller should eventually decrement count. (Usually, > that happens by calling RelationClose().) However, it doesn't do it in ReorderBufferProcessTXN(). I think we should close it, here is a patch that fixes it. Thoughts? -- Regrad

Re: Truncate in synchronous logical replication failed

2021-04-15 Thread Japin Li
st need to call RelationGetIndexList > and then build the idattr list for relation->rd_replidindex. Sorry, I don't know how can we build the idattr without open the index. If we should open the index, then we should use NoLock, since the TRUNCATE side hold AccessExclusiveLock. As Osumi points out in [1], The NoLock mode assumes that the appropriate lock on the index is already taken. Please let me know if I have misunderstood. [1] https://www.postgresql.org/message-id/OSBPR01MB488834BDBD67BFF2FB048B3DED4E9%40OSBPR01MB4888.jpnprd01.prod.outlook.com -- Regrads, Japin Li. ChengDu WenWu Information Technology Co.,Ltd.

Re: Truncate in synchronous logical replication failed

2021-04-15 Thread Japin Li
On Thu, 15 Apr 2021 at 19:25, Amit Kapila wrote: > On Thu, Apr 15, 2021 at 4:30 PM Japin Li wrote: >> >> >> On Thu, 15 Apr 2021 at 18:22, Amit Kapila wrote: >> > On Wed, Apr 14, 2021 at 3:31 PM Amit Kapila >> > wrote: >> >> >> >

Re: Truncate in synchronous logical replication failed

2021-04-16 Thread Japin Li
On Thu, 15 Apr 2021 at 19:25, Amit Kapila wrote: > On Thu, Apr 15, 2021 at 4:30 PM Japin Li wrote: >> >> >> On Thu, 15 Apr 2021 at 18:22, Amit Kapila wrote: >> > On Wed, Apr 14, 2021 at 3:31 PM Amit Kapila >> > wrote: >> >> >> >

Re: Truncate in synchronous logical replication failed

2021-04-16 Thread Japin Li
On Fri, 16 Apr 2021 at 16:52, Amit Kapila wrote: > On Fri, Apr 16, 2021 at 12:55 PM Japin Li wrote: >> >> On Thu, 15 Apr 2021 at 19:25, Amit Kapila wrote: >> > On Thu, Apr 15, 2021 at 4:30 PM Japin Li wrote: >> >> >> >> >> >> On T

Re: Truncate in synchronous logical replication failed

2021-04-16 Thread Japin Li
indexes? > Ok. No need to traverse all the indexes. Will fix this part. > >> 2. >> It is better to name the function as RelationGet... > You are right. I'll modify this in my next version. > I took the liberty to address review comments and provide a v2 patch on top of your&#x

Re: Forget close an open relation in ReorderBufferProcessTXN()

2021-04-16 Thread Japin Li
On Sat, 17 Apr 2021 at 14:09, Amit Kapila wrote: > On Thu, Apr 15, 2021 at 4:53 PM Amit Kapila wrote: >> >> On Thu, Apr 15, 2021 at 4:00 PM Japin Li wrote: >> > >> > The RelationIdGetRelation() comment says: >> > >> > > Caller should eve

Re: Truncate in synchronous logical replication failed

2021-04-17 Thread Japin Li
On Sat, 17 Apr 2021 at 12:03, osumi.takami...@fujitsu.com wrote: > On Saturday, April 17, 2021 12:53 AM Japin Li >> On Fri, 16 Apr 2021 at 17:19, osumi.takami...@fujitsu.com >> wrote: >> > On Friday, April 16, 2021 5:50 PM Amit Kapila >> wrote: >>

[no subject]

2020-10-22 Thread Li Japin
_for_list_of_tables, ""); + /* ALTER TABLE xxx NO */ + else if (Matches("ALTER", "TABLE", MatchAny, "NO")) + COMPLETE_WITH("FORCE ROW LEVEL SECURITY", "INHERIT"); /* ALTER TABLE xxx NO INHERIT */ else if (Matches("ALTER", "TABLE", MatchAny, "NO", "INHERIT")) COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, "”); Best regards. -- ChengDu WenWu Information Technology Co,Ltd. Japin Li 0001-Add-tab-complete-for-alter-table-rls.patch Description: 0001-Add-tab-complete-for-alter-table-rls.patch

Tab complete for alter table rls

2020-10-22 Thread Li Japin
Sorry, I forgot add the subject. -- Best regards Japin Li On Oct 23, 2020, at 1:19 PM, Li Japin mailto:japi...@hotmail.com>> wrote: Hi, hackers I find that ALTER TABLE xxx FORCE/NO FORCE ROW LEVEL SECURITY cannot support tab complete. The attached add the tab complete for rls. diff -

Re: Tab complete for alter table rls

2020-10-23 Thread Li Japin
Thanks Michael! -- Best regards Japin Li > On Oct 24, 2020, at 9:49 AM, Michael Paquier wrote: > > On Fri, Oct 23, 2020 at 04:37:18PM +0900, Michael Paquier wrote: >> No worries. Good catch. I'll try to test that and apply it later, >> but by reading the code

Re: Terminate the idle sessions

2020-11-15 Thread Li Japin
ons in the doc file? I made an example: ``` Note that this values should be set to zero if you use postgres_fdw or some Connection-pooling software, because connections might be closed unexpectedly. ``` Thanks for your advice! Attached v4. -- Best regards Japin Li v4-0001-Allow-terminating-th

Re: Terminate the idle sessions

2020-11-16 Thread Li Japin
ION_TIMEOUT, IDLE_IN_TRANSACTION_SESSION_TIMEOUT, + IDLE_SESSION_TIMEOUT, /* First user-definable timeout reason */ USER_TIMEOUT, /* Maximum number of timeout reasons */ Thanks for your review! Attached. -- Best regards Japin Li v5-0001-Allow-terminating-the-idle-sessions.patch Descripti

Re: Terminate the idle sessions

2020-11-16 Thread Li Japin
-- Best regards Japin Li On Nov 17, 2020, at 7:59 AM, David G. Johnston mailto:david.g.johns...@gmail.com>> wrote: On Mon, Nov 16, 2020 at 5:41 AM Li Japin mailto:japi...@hotmail.com>> wrote: Thanks for your review! Attached. Reading the doc changes: I'd rather not

Re: Terminate the idle sessions

2020-11-16 Thread Li Japin
On Nov 17, 2020, at 10:53 AM, David G. Johnston mailto:david.g.johns...@gmail.com>> wrote: On Monday, November 16, 2020, Li Japin mailto:japi...@hotmail.com>> wrote: Consider setting this for specific users instead of as a server default. Client connections managed by connec

Re: Terminate the idle sessions

2020-11-17 Thread Li Japin
ions might be needed. Not sure! I find that Win32 do not support setitimer(), PostgreSQL emulate setitimer() by creating a persistent thread to handle the timer setting and notification upon timeout. So if we want to replace it, I think we should open a new thread to achieve this. -- Best regards Japin Li

Re: Terminate the idle sessions

2020-11-17 Thread Li Japin
mments comes from miscadmin.h. Right, but how about before HOLD_INTERRUPTS()? If so, only calling handle_sig_alarm() is occurred, and Setitimer will not be set, I think. Yeah, it might be occurred. Any suggestions to fix it? -- Best regards Japin Li

Re: Terminate the idle sessions

2020-11-17 Thread Li Japin
cause any intrreputions might be occured. +*/ + sigalrm_delivered = true; schedule_alarm(GetCurrentTimestamp()); + } } ``` Thanks for your suggestion. Attached! -- Best regards Japin Li v7-0001-Allow-terminating-the-idle-sessions.patch Description

Re: Terminate the idle sessions

2020-11-23 Thread Li Japin
ITED > > -Original Message- > From: kuroda.hay...@fujitsu.com > Sent: Friday, November 20, 2020 11:05 AM > To: 'japin' > Cc: David G. Johnston ; Kyotaro Horiguchi > ; Thomas Munro ; > bharath.rupireddyforpostg...@gmail.com; pgsql-hackers@lists.postg

Re: Terminate the idle sessions

2020-11-23 Thread Li Japin
outs */ if (disable_idle_in_transaction_timeout) { I will send a new patch if there is not other comments. -- Best Regards, Japin Li

Re: Use macros for calculating LWLock offset

2020-11-23 Thread Li Japin
wait a bit first. Got this one committed as of d03d754. — Michael -- Best regards Japin Li

Remove cache_plan argument comments to ri_PlanCheck

2020-11-24 Thread Li Japin
cache_plan is true, the plan is saved into our plan hashtable - * so that we don't need to plan it again. */ static SPIPlanPtr ri_PlanCheck(const char *querystr, int nargs, Oid *argtypes, -- Best regards Japin Li ChengDu WenWu Information Technology Co.,Ltd. cache_plan-to-ri_PlanCheck

Re: Terminate the idle sessions

2020-11-24 Thread Li Japin
On Nov 24, 2020, at 11:20 PM, David G. Johnston mailto:david.g.johns...@gmail.com>> wrote: On Mon, Nov 23, 2020 at 11:22 PM Li Japin mailto:japi...@hotmail.com>> wrote: How about use “foreign-data wrapper” replace “postgres_fdw”? I don't see much value in avoiding mention

Inconsistent error message for varchar(n)

2021-11-12 Thread Japin Li
n't exceed 2147483647. The first error message is reported by anychar_typmodin(), and the later is reported by gram.y. IMO, the syntax error for varchar(n) is more confused. Any thoughts? -- Regrads, Japin Li. ChengDu WenWu Information Technology Co.,Ltd.

Invalid Unicode escape value at or near "\u0000"

2021-11-12 Thread Japin Li
SERT INTO tbl VALUES (E'\u'); ^ "\u" is valid unicode [1], why not we cannot insert it? [1] https://www.unicode.org/charts/PDF/U.pdf -- Regrads, Japin Li. ChengDu WenWu Information Technology Co.,Ltd.

Re: Invalid Unicode escape value at or near "\u0000"

2021-11-13 Thread Japin Li
On Sat, 13 Nov 2021 at 21:52, Andrew Dunstan wrote: > On 11/13/21 00:40, Thomas Munro wrote: >> On Sat, Nov 13, 2021 at 4:32 PM Japin Li wrote: >>> When I try to insert an Unicode "\u", there is an error $subject. >>> >>> postgres=# CREA

Re: Inconsistent error message for varchar(n)

2021-11-13 Thread Japin Li
On Sat, 13 Nov 2021 at 23:42, Tom Lane wrote: > Japin Li writes: >> postgres=# CREATE TABLE tbl (s varchar(2147483647)); >> ERROR: length for type varchar cannot exceed 10485760 >> LINE 1: CREATE TABLE tbl (s varchar(2147483647)); >> ^ &

  1   2   3   4   5   >