Re: logical replication empty transactions

2021-08-15 Thread Peter Smith
On Fri, Aug 13, 2021 at 9:01 PM Ajin Cherian wrote: > > On Mon, Aug 2, 2021 at 7:20 PM Amit Kapila wrote: > > > > On Fri, Jul 23, 2021 at 3:39 PM Ajin Cherian wrote: > > > > > > > Let's first split the patch for prepared and non-prepared cases as > > that will help to focus on each of them separ

Re: Add option --drop-cascade for pg_dump/restore

2021-08-15 Thread Wu Haotian
There are already documents for "--clean only works with plain text output", so adding checks for --clean seems like a breaking change to me. I've updated the docs to indicate --drop-cascade and --if-exists only works with plain text output. 0004-pg_dump-restore-add-drop-cascade-option.patch Des

Re: ECPG bug fix: DECALRE STATEMENT and DEALLOCATE, DESCRIBE

2021-08-15 Thread Michael Paquier
On Sat, Aug 14, 2021 at 11:08:44PM -0400, Tom Lane wrote: > Please do something about that. > > (1) There should be no output to stderr in the tests. Why isn't this > message being caught and redirected to the normal test output file? These are generated during the compilation of the tests with

Re: Added schema level support for publication.

2021-08-15 Thread Peter Smith
On Sun, Aug 15, 2021 at 1:23 AM Tom Lane wrote: > > Peter Eisentraut writes: > > I think the strict separation between publication-for-tables vs. > > publication-for-schemas is a mistake. Why can't I have a publication > > that publishes tables t1, t2, t3, *and* schemas s1, s2, s3. Also note >

Re: Skipping logical replication transactions on subscriber side

2021-08-15 Thread Amit Kapila
On Mon, Aug 16, 2021 at 1:54 AM Masahiko Sawada wrote: > > On Fri, Aug 13, 2021 at 1:06 PM Amit Kapila wrote: > > > > > > Okay, but that doesn't mean using it here is bad. I am personally fine > > with a message containing something like "... in transaction > > id 740 with commit timestamp 2021-0

Re: .ready and .done files considered harmful

2021-08-15 Thread Bossart, Nathan
On 8/15/21, 9:52 PM, "Bossart, Nathan" wrote: > + * Perform a full directory scan to identify the next log segment. There > + * may be one of the following scenarios which may require us to > perform a > + * full directory scan. > ... > + * - The next anticipated log segment i

Re: .ready and .done files considered harmful

2021-08-15 Thread Bossart, Nathan
+* This .ready file is created out of order, notify archiver to perform +* a full directory scan to archive corresponding WAL file. +*/ + StatusFilePath(archiveStatusPath, xlog, ".ready"); + if (stat(archiveStatusPath, &stat_buf) == 0) + PgArchEnabl

Re: Changes to recovery_min_apply_delay are ignored while waiting for delay

2021-08-15 Thread Soumyadeep Chakraborty
On Sun, Aug 15, 2021 at 8:16 PM Michael Paquier wrote: > > On Fri, Aug 13, 2021 at 05:59:21PM -0700, Soumyadeep Chakraborty wrote: > > and passes with the code change, as expected. I can't explain why the > > test doesn't freeze up in v3 in wait_for_catchup() at the end. > > It took me some some t

Failure of subscription tests with topminnow

2021-08-15 Thread Michael Paquier
Hi all, topminnow has just failed in a weird fashion: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=topminnow&dt=2021-08-15%2013%3A24%3A58 # SELECT pid != FROM pg_stat_replication WHERE application_name = 'tap_sub'; # expecting this output: # t # last actual query output: # # with stder

Re: Changes to recovery_min_apply_delay are ignored while waiting for delay

2021-08-15 Thread Michael Paquier
On Fri, Aug 13, 2021 at 05:59:21PM -0700, Soumyadeep Chakraborty wrote: > and passes with the code change, as expected. I can't explain why the > test doesn't freeze up in v3 in wait_for_catchup() at the end. It took me some some to understand why. If I am right, that's because of the intermediat

Re: Skipping logical replication transactions on subscriber side

2021-08-15 Thread Greg Nancarrow
On Mon, Aug 16, 2021 at 6:24 AM Masahiko Sawada wrote: > > Therefore, perhaps a message like "... in transaction 740 with commit > timestamp 2021-08-10 14:44:38.058174+05:30" is better in terms of > consistency with other messages? > Yes, I think that would be more consistent. On another note, f

Re: badly calculated width of emoji in psql

2021-08-15 Thread Michael Paquier
On Thu, Aug 12, 2021 at 05:13:31PM -0400, John Naylor wrote: > I'm a bit concerned about the build dependencies not working right, but > it's not clear it's even due to the patch. I'll spend some time > investigating next week. How large do libpgcommon deliverables get with this patch? Skimming t

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

2021-08-15 Thread Andy Fan
Hi Zhihong, On Mon, Aug 16, 2021 at 12:35 AM Zhihong Yu wrote: > > > > On Sun, Aug 15, 2021 at 7:33 AM Andy Fan wrote: >> >> Hi: >> >> I have finished the parts for baserel, joinrel, subquery, distinctrel. I >> think >> the hardest ones have been verified. Here is the design overview. >> >> 1.

Re: PoC/WIP: Extended statistics on expressions

2021-08-15 Thread Justin Pryzby
On Mon, Dec 07, 2020 at 03:15:17PM +0100, Tomas Vondra wrote: > > Looking at the current behaviour, there are a couple of things that > > seem a little odd, even though they are understandable. For example, > > the fact that > > > > CREATE STATISTICS s (expressions) ON (expr), col FROM tbl; > >

Re: PoC/WIP: Extended statistics on expressions

2021-08-15 Thread Justin Pryzby
On 1/22/21 5:01 AM, Justin Pryzby wrote: > > In any case, why are there so many parentheses ? On Fri, Jan 22, 2021 at 02:09:04PM +0100, Tomas Vondra wrote: > That's a bug in pg_get_statisticsobj_worker, probably. It shouldn't be > adding extra parentheses, on top of what deparse_expression_pretty

Re: Default to TIMESTAMP WITH TIME ZONE?

2021-08-15 Thread David Fetter
On Sat, Aug 14, 2021 at 10:03:01AM +0200, Peter Eisentraut wrote: > On 13.08.21 19:07, Tom Lane wrote: > > "David G. Johnston" writes: > > > On Fri, Aug 13, 2021 at 9:28 AM Simon Riggs > > > wrote: > > > > The only hope is to eventually change the default, so probably > > > > the best thing is to

Minor regexp hacking: code coverage, moveins() and friends

2021-08-15 Thread Tom Lane
While trying to improve the code-coverage report for backend/regex/, I found that there are portions of copyins() and copyouts() that are just plain unreachable, because those functions are over-engineered. In point of fact, the only uses of copyins() and copyouts() are in places where the target s

Re: Added schema level support for publication.

2021-08-15 Thread Masahiko Sawada
On Sun, Aug 15, 2021 at 12:23 AM Tom Lane wrote: > > Peter Eisentraut writes: > > I think the strict separation between publication-for-tables vs. > > publication-for-schemas is a mistake. Why can't I have a publication > > that publishes tables t1, t2, t3, *and* schemas s1, s2, s3. Also note >

Re: Get table total page quantity and cached page quantity

2021-08-15 Thread otar shavadze
Answer is pretty clear, thank you David. On Mon, Aug 16, 2021 at 12:31 AM David Rowley wrote: > On Sun, 15 Aug 2021 at 23:41, otar shavadze wrote: > > SELECT > > (SELECT relpages FROM pg_class where oid = > 'public.my_table'::regclass::oid ) AS table_pages_quantity_total, > > (SELECT COUNT(DIST

Re: Added schema level support for publication.

2021-08-15 Thread Masahiko Sawada
On Fri, Aug 13, 2021 at 11:59 AM Amit Kapila wrote: > > On Thu, Aug 12, 2021 at 5:54 PM Masahiko Sawada wrote: > > > > On Fri, Aug 6, 2021 at 5:33 PM vignesh C wrote: > > > > > > > --- > > Even if we drop all tables added to the publication from it, 'pubkind' > > doesn't go back to 'empty'. Is t

Re: Get table total page quantity and cached page quantity

2021-08-15 Thread David Rowley
On Sun, 15 Aug 2021 at 23:41, otar shavadze wrote: > SELECT > (SELECT relpages FROM pg_class where oid = 'public.my_table'::regclass::oid ) > AS table_pages_quantity_total, > (SELECT COUNT(DISTINCT relblocknumber) FROM pg_buffercache WHERE relfilenode > = ( > SELECT relfilenode FROM pg_class WHE

Re: Skipping logical replication transactions on subscriber side

2021-08-15 Thread Masahiko Sawada
On Fri, Aug 13, 2021 at 1:06 PM Amit Kapila wrote: > > On Thu, Aug 12, 2021 at 5:41 PM Greg Nancarrow wrote: > > > > On Thu, Aug 12, 2021 at 9:18 PM Amit Kapila wrote: > > > > > > > A minor comment on the 0001 patch: In the message I think that using > > > > "ID" would look better than lowercase

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

2021-08-15 Thread Zhihong Yu
On Sun, Aug 15, 2021 at 7:33 AM Andy Fan wrote: > Hi: > > I have finished the parts for baserel, joinrel, subquery, distinctrel. I > think > the hardest ones have been verified. Here is the design overview. > > 1. Use EC instead of expr to cover more UniqueKey cases. > 2. Redesign the UniqueKey

Re: prion failed with ERROR: missing chunk number 0 for toast value 14334 in pg_toast_2619

2021-08-15 Thread Justin Pryzby
On Sun, May 16, 2021 at 04:23:02PM -0400, Tom Lane wrote: > 1. Fix FullXidRelativeTo to be a little less trusting. It'd > probably be sane to make it return FirstNormalTransactionId > when it'd otherwise produce a wrapped-around FullXid, but is > there any situation where we'd want it to throw an

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

2021-08-15 Thread Andy Fan
Hi: I have finished the parts for baserel, joinrel, subquery, distinctrel. I think the hardest ones have been verified. Here is the design overview. 1. Use EC instead of expr to cover more UniqueKey cases. 2. Redesign the UniqueKey as below: @@ -246,6 +246,7 @@ struct PlannerInfo List *eq_cl

Re: CI/windows docker vs "am a service" autodetection on windows

2021-08-15 Thread Ranier Vilela
Em sex., 13 de ago. de 2021 às 10:03, Andres Freund escreveu: > Hi, > > Magnus, Michael, Anyone - I'd appreciate a look. > > On 2021-03-05 12:55:37 -0800, Andres Freund wrote: > > > After fighting with a windows VM for a bit (ugh), it turns out that > yes, > > > there is stderr, but that fileno(s

Get table total page quantity and cached page quantity

2021-08-15 Thread otar shavadze
created pg_buffercache extension: CREATE EXTENSION pg_buffercache; restarted server and updated statistic for table : VACUUM ANALYZE public.my_table; then just tried to cache table in buffer: SELECT * FROM public.my_table; and then tried to get table total page quantity and how much pages are ca

RE: make MaxBackends available in _PG_init

2021-08-15 Thread wangsh.f...@fujitsu.com
Hi, I noticed that in v3-0001-Disallow-external-access-to-MaxBackends.patch, there are some modifications like: > - for (int i = 0; i <= MaxBackends; i++) > + for (int i = 0; i <= GetMaxBackends(); i++) I don't think calling function GetMaxBackends() in the for loop is a