Re: Reduce the time required for a database recovery from archive.

2021-01-10 Thread Dmitry Shulga
Hi StephenBased on our last discussion I redesigned the implementation of WAL archive recovery speed-up. The main idea of the new implementation was partly borrowed from your proposal, to be more accurate from the following one:On 9 Nov 2020, at 23:31, Stephen Frost wrote:The

Re: logical replication worker accesses catalogs in error context callback

2021-01-10 Thread Bharath Rupireddy
On Mon, Jan 11, 2021 at 10:56 AM Masahiko Sawada wrote: > Agreed. Attached the updated patch. Thanks for the updated patch. Looks like the comment crosses the 80 char limit, I have corrected it. And also changed the variable name from remotetypeid to remotetypid, so that

Re: psql \df choose functions by their arguments

2021-01-10 Thread Ian Lawrence Barwick
Hi I tried this patch out last year but was overrolled by Other Stuff before I got around to providing any feedback, and was reminded of it just now when I was trying to execute "\df somefunction text int" or similar, which had me confused until I remembered it's not a feature yet, so it would

Re: Moving other hex functions to /common

2021-01-10 Thread Michael Paquier
On Wed, Jan 06, 2021 at 08:58:23AM -0500, Bruce Momjian wrote: > Fine. Do you want to add the overflow to the patch I posted, for all > encoding types? Yeah. It looks that it would be good to be consistent as well for escape case, so as it is possible to add a dstlen argument to struct

Re: [HACKERS] Custom compression methods

2021-01-10 Thread Justin Pryzby
On Mon, Jan 11, 2021 at 12:11:54PM +0530, Dilip Kumar wrote: > On Mon, Jan 11, 2021 at 11:00 AM Dilip Kumar wrote: > > On Sun, Jan 10, 2021 at 10:59 PM Justin Pryzby wrote: > > > > > > On Mon, Jan 04, 2021 at 04:57:16PM +0530, Dilip Kumar wrote: > > > > On Mon, Jan 4, 2021 at 6:52 AM Justin

Re: [HACKERS] Custom compression methods

2021-01-10 Thread Dilip Kumar
On Mon, Jan 11, 2021 at 11:00 AM Dilip Kumar wrote: > > On Sun, Jan 10, 2021 at 10:59 PM Justin Pryzby wrote: > > > > On Mon, Jan 04, 2021 at 04:57:16PM +0530, Dilip Kumar wrote: > > > On Mon, Jan 4, 2021 at 6:52 AM Justin Pryzby wrote: > > > > And fails pg_upgrade check, apparently losing

Re: Spurious "apparent wraparound" via SimpleLruTruncate() rounding

2021-01-10 Thread Andrey Borodin
> 10 янв. 2021 г., в 14:43, Noah Misch написал(а): > >> Can you please send revised patches with fixes? > > Attached. > > I'm marking patch as ready for committer. I can't tell should we backpatch insurance patch or not: it potentially fixes unknown bugs, and potentially contains

Re: Added schema level support for publication.

2021-01-10 Thread Bharath Rupireddy
On Sun, Jan 10, 2021 at 11:21 PM vignesh C wrote: > On Sat, Jan 9, 2021 at 8:08 PM Bharath Rupireddy > wrote: > > I think this feature can be useful, in case a user has a lot of tables > > to publish inside a schema. Having said that, I wonder if this feature > > mandates users to create the

Re: [PATCH] Feature improvement for CLOSE, FETCH, MOVE tab completion

2021-01-10 Thread Masahiko Sawada
On Thu, Jan 7, 2021 at 9:32 PM Fujii Masao wrote: > > > > On 2021/01/07 17:28, shinya11.k...@nttdata.com wrote: > >> On Thu, Jan 7, 2021 at 1:30 PM Fujii Masao > >> wrote: > >>> > >>> On 2021/01/07 12:42, Masahiko Sawada wrote: > On Thu, Jan 7, 2021 at 10:59 AM Fujii Masao > wrote:

Re: [HACKERS] Custom compression methods

2021-01-10 Thread Dilip Kumar
On Sun, Jan 10, 2021 at 10:59 PM Justin Pryzby wrote: > > On Mon, Jan 04, 2021 at 04:57:16PM +0530, Dilip Kumar wrote: > > On Mon, Jan 4, 2021 at 6:52 AM Justin Pryzby wrote: > > > And fails pg_upgrade check, apparently losing track of the compression (?) > > > > > > CREATE TABLE public.cmdata2

Re: logical replication worker accesses catalogs in error context callback

2021-01-10 Thread Masahiko Sawada
On Sat, Jan 9, 2021 at 2:57 PM Bharath Rupireddy wrote: > > On Thu, Jan 7, 2021 at 5:47 AM Masahiko Sawada wrote: > > > > On Wed, Jan 6, 2021 at 11:42 AM Masahiko Sawada > > wrote: > > > > > > On Wed, Jan 6, 2021 at 11:02 AM Andres Freund wrote: > > > > > > > > Hi, > > > > > > > > Due to a

Re: Single transaction in the tablesync worker?

2021-01-10 Thread Amit Kapila
On Fri, Jan 8, 2021 at 8:20 AM Amit Kapila wrote: > > On Fri, Jan 8, 2021 at 7:14 AM Peter Smith wrote: > > > > FYI, I was able to reproduce this case in debugger. PSA logs showing > > details. > > > > Thanks for reproducing as I was worried about exactly this case. I > have one question

Re: Removing unneeded self joins

2021-01-10 Thread Andrey V. Lepikhov
On 1/7/21 7:08 PM, Masahiko Sawada wrote: On Mon, Nov 30, 2020 at 2:51 PM Andrey V. Lepikhov wrote: Thanks, it is my fault. I tried to extend this patch with foreign key references and made a mistake. Currently I rollback this new option (see patch in attachment), but will be working for a

O(n^2) system calls in RemoveOldXlogFiles()

2021-01-10 Thread Thomas Munro
Hi, I noticed that RemoveXlogFile() has this code: /* * Before deleting the file, see if it can be recycled as a future log * segment. Only recycle normal files, pg_standby for example can create * symbolic links pointing to a separate archive directory.

Re: pg_preadv() and pg_pwritev()

2021-01-10 Thread Thomas Munro
On Mon, Jan 11, 2021 at 3:34 PM Thomas Munro wrote: > On Wed, Dec 23, 2020 at 12:06 AM Thomas Munro wrote: > > On Mon, Dec 21, 2020 at 11:40 AM Andres Freund wrote: > > > Can we come up with a better name than 'uio'? I find that a not exactly > > > meaningful name. > > > > Ok, let's try

Re: Inconsistent "" use

2021-01-10 Thread Tatsuo Ishii
> I'm with Noah: small caps are *not* an improvement, they're just > distractingly fussy. I note that the authors of the stylesheets > we use seem to agree, because AFAICS is not rendered > specially in either HTML or PDF output. > > Given this docbook.org advice, I'd be inclined to just remove

Re: pg_preadv() and pg_pwritev()

2021-01-10 Thread Thomas Munro
On Wed, Dec 23, 2020 at 12:06 AM Thomas Munro wrote: > On Mon, Dec 21, 2020 at 11:40 AM Andres Freund wrote: > > Can we come up with a better name than 'uio'? I find that a not exactly > > meaningful name. > > Ok, let's try port/pg_iovec.h. I pushed it with that name, and a couple more cosmetic

RE: Parallel Inserts in CREATE TABLE AS

2021-01-10 Thread Hou, Zhijie
> Attaching v21 patch set, which has following changes: > 1) 0001 - changed fpes->ins_cmd_type == > PARALLEL_INSERT_CMD_CREATE_TABLE_AS to fpes->ins_cmd_type != > PARALLEL_INSERT_CMD_UNDEF > 2) 0002 - reworded the commit message. > 3) 0003 - added cmin, xmin test case to one of the parallel insert

RE: Disable WAL logging to speed up data loading

2021-01-10 Thread tsunakawa.ta...@fujitsu.com
From: Masahiko Sawada > I think it's better to have index AM (and perhaps table AM) control it > instead of filtering in XLogInsert(). Because otherwise third-party > access methods that use LSN like gist indexes cannot write WAL records > at all when wal_level = none even if they want. Hm,

Re: Inconsistent "" use

2021-01-10 Thread Tom Lane
Bruce Momjian writes: > On Sun, Jan 10, 2021 at 01:11:07PM -0800, Noah Misch wrote: >> https://tdg.docbook.org/tdg/5.2/acronym.html suggests docbook formatters >> either ignore that or use it as a signal to substitute small caps. >> I don't consider small caps an improvement for "SQL", so I'd

Re: Inconsistent "" use

2021-01-10 Thread Bruce Momjian
On Sun, Jan 10, 2021 at 01:11:07PM -0800, Noah Misch wrote: > On Sun, Jan 10, 2021 at 08:22:42PM +0900, Tatsuo Ishii wrote: > > In doc/src/sgml/func.sgml description of SHOW command use > > "SQL", while SET command description the same > > section does not use "". Shouldn't the description of SET

Re: Multiple hosts in connection string failed to failover in non-hot standby mode

2021-01-10 Thread Tom Lane
I wrote: > The problems that I see in this area are first that there's no > real standardization in libpq as to whether to append error messages > together or just flush preceding messages; and second that no effort > is made in multi-connection-attempt cases to separate the errors from >

Re: COPY FREEZE and setting PD_ALL_VISIBLE/visibility map bits

2021-01-10 Thread Tomas Vondra
Hi, I started looking at this patch again, hoping to get it committed in this CF, but I think there's a regression in handling TOAST tables (compared to the v3 patch submitted by Pavan in February 2019). The test I'm running a very simple test (see test.sql): 1) start a transaction 2)

Re: ALTER TABLE .. DETACH PARTITION CONCURRENTLY

2021-01-10 Thread Justin Pryzby
On Fri, Jan 08, 2021 at 04:14:33PM -0300, Alvaro Herrera wrote: > > > I ended up with apparently broken constraint when running multiple loops > > > around > > > a concurrent detach / attach: > > > > > > while psql -h /tmp postgres -c "ALTER TABLE p ATTACH PARTITION p1 FOR > > > VALUES FROM

Re: [PATCH] Automatic HASH and LIST partition creation

2021-01-10 Thread Thomas Munro
On Wed, Oct 7, 2020 at 6:26 AM Anastasia Lubennikova wrote: > Do you think that it is a bug? For now, I removed this statement from > tests just to calm down the CI. I don't think we can use \d+ on a temporary table here, because the backend ID appears in the namespace, which is causing a

Re: Inconsistent "" use

2021-01-10 Thread Noah Misch
On Sun, Jan 10, 2021 at 08:22:42PM +0900, Tatsuo Ishii wrote: > In doc/src/sgml/func.sgml description of SHOW command use > "SQL", while SET command description the same > section does not use "". Shouldn't the description of SET use > "" for "SQL" as well? Patch attached.

Re: zstd compression for pg_dump

2021-01-10 Thread Andreas Karlsson
On 1/4/21 3:53 AM, Justin Pryzby wrote: About 89% smaller. Did a quick code review of the patch. I have not yet taken it for a spin yet and there are parts of the code I have not read yet. ## Is there any reason for this diff? -cfp*fp = pg_malloc(sizeof(cfp)); +cfp

Re: Terminate the idle sessions

2021-01-10 Thread Tom Lane
Thomas Munro writes: > On Thu, Jan 7, 2021 at 4:51 PM Tom Lane wrote: >> Thomas Munro writes: >>> One of the strange things about these errors is that they're >>> asynchronous/unsolicited, but they appear to the client to be the >>> response to their next request (if it doesn't eat ECONNRESET

Re: new heapcheck contrib module

2021-01-10 Thread Thomas Munro
On Fri, Jan 8, 2021 at 6:33 AM Mark Dilger wrote: > The attached patches, v31, are mostly the same, but with "getopt_long.h" > included from pg_amcheck.c per Thomas's review, and a .gitignore file added > in contrib/pg_amcheck/ I couple more little things from Windows CI:

Re: [HACKERS] [PATCH] Generic type subscripting

2021-01-10 Thread Pavel Stehule
Hi > I'm thinking of the update path as a kind of implicit schema. JSON is > intentionally not bound to any schema on creation, so I don't see a > failure to enforce another schema at runtime (and outside the WHERE > clause, at that) as an error exactly. > This concept is not consistent with

Re: Added schema level support for publication.

2021-01-10 Thread vignesh C
On Sat, Jan 9, 2021 at 8:14 PM Bharath Rupireddy wrote: > > One more point - if the publication is created for a schema with no or > some initial tables, will all the future tables that may get added to > the schema will be replicated too? > I agree on this, when a relation is added to the

Re: Added schema level support for publication.

2021-01-10 Thread vignesh C
Thanks for your comments Bharath, please find my opinion below. On Sat, Jan 9, 2021 at 8:08 PM Bharath Rupireddy wrote: > I think this feature can be useful, in case a user has a lot of tables > to publish inside a schema. Having said that, I wonder if this feature > mandates users to create the

Re: [HACKERS] Custom compression methods

2021-01-10 Thread Justin Pryzby
On Mon, Jan 04, 2021 at 04:57:16PM +0530, Dilip Kumar wrote: > On Mon, Jan 4, 2021 at 6:52 AM Justin Pryzby wrote: > > And fails pg_upgrade check, apparently losing track of the compression (?) > > > > CREATE TABLE public.cmdata2 ( > > -f1 text COMPRESSION lz4 > > +f1 text > > ); > > I

Re: proposal: schema variables

2021-01-10 Thread Pavel Stehule
ld be >ON TRANSACTION END RESET > > and changed it accordingly, please double-check. > It looks well, I merged these changes to patch. Thank you very much for these corectures Updated patch attached Regards Pavel > > Erik Rijkers > schema-variables-20210110.patch.gz Description: application/gzip

Re: support for MERGE

2021-01-10 Thread Vik Fearing
On 1/10/21 2:44 AM, Tomas Vondra wrote: > 5) WHEN AND > > I admit the "WHEN AND" conditions sounds a bit cryptic - it took me a > while to realize what this refers to. Is that a term established by SQL > Standard, or something we invented? The grammar gets it right but the error messages are

invalid data in file backup_label problem on windows

2021-01-10 Thread Wang, Shenhao
Hi hackers. When I using a Non-Exclusive Low-Level Backup on windows, "invalid data in file backup_label" will be shown. The code are listed below if (fscanf(lfp, "START WAL LOCATION: %X/%X (file %08X%16s)%c", , , _from_walseg, startxlogfilename, ) != 5 ||

Inconsistent "" use

2021-01-10 Thread Tatsuo Ishii
In doc/src/sgml/func.sgml description of SHOW command use "SQL", while SET command description the same section does not use "". Shouldn't the description of SET use "" for "SQL" as well? Patch attached. Best regards, -- Tatsuo Ishii SRA OSS, Inc. Japan English:

Re: Added schema level support for publication.

2021-01-10 Thread Dilip Kumar
On Sat, Jan 9, 2021 at 8:14 PM Bharath Rupireddy wrote: > > On Sat, Jan 9, 2021 at 8:08 PM Bharath Rupireddy > wrote: > > I think this feature can be useful, in case a user has a lot of tables > > to publish inside a schema. Having said that, I wonder if this feature > > mandates users to create

Re: Spurious "apparent wraparound" via SimpleLruTruncate() rounding

2021-01-10 Thread Noah Misch
On Sun, Jan 10, 2021 at 11:44:14AM +0500, Andrey Borodin wrote: > > 10 янв. 2021 г., в 03:15, Noah Misch написал(а): > > > > No; it deletes the most recent ~1B and leaves the older segments. An > > exception is multixact, as described in the commit message and the patch's > > change to a