[DOC] Fix for the missing pg_stat_progress_cluster view phase column value

2019-10-25 Thread Shinoda, Noriyoshi (PN Japan A Delivery)
Hi, I found a missing column value in the pg_stat_progress_cluster view document. I read the src/backend/catalog/system_views.sql file, there seems to be a possibility that 'writing new heap' is output in the 'phase' column. The attached patch adds a description of the 'writing new heap' value

Re: psql tab-complete

2019-10-25 Thread Michael Paquier
On Fri, Oct 25, 2019 at 11:57:18AM +0300, Victor Spirin wrote: > This patch resolved one problem in the tab-complete.c on MSVC. The > VA_ARGS_NARGS macros now work correctly on Windows. Can you explain why and in what the use of EXPAND() helps with MSVC builds? Any references which help to

Re: define bool in pgtypeslib_extern.h

2019-10-25 Thread Amit Kapila
On Fri, Oct 25, 2019 at 9:55 PM Tom Lane wrote: > > I wrote: > > Amit Kapila writes: > >> As suggested by Andrew Gierth [1], I think we can remove the define in > >> pgtypeslib_extern.h as it doesn't seem to be exposed. > > > Yeah, it's not good that that results in a header ordering dependency,

Re: [PATCH] Do not use StdRdOptions in Access Methods

2019-10-25 Thread Michael Paquier
On Fri, Oct 25, 2019 at 04:42:24PM +0900, Amit Langote wrote: > Hmm, if we're inventing a new API to replace the old one, why not use > that opportunity to be consistent with our general style, which > predominantly seems to be either words_separated_by_underscore() or > UpperCamelCase().

Re: typo: postGER

2019-10-25 Thread Peter Eisentraut
On 2019-09-30 00:43, Justin Pryzby wrote: > $ git grep Postger > src/backend/po/tr.po:"Bu durum, sistemin semaphore set (SEMMNI) veya > semaphore (SEMMNS) sayı sınırlaması aşmasında meydana gelmektedir. > Belirtilen parametrelerin değerleri yükseltmelisiniz. Başka seçeneğiniz ise > PostgerSQL

MinGW compiler warnings in ecpg tests

2019-10-25 Thread Peter Eisentraut
Under MinGW, when compiling the ecpg test files, you get these warnings: sqlda.pgc: In function 'dump_sqlda': sqlda.pgc:44:11: warning: unknown conversion type character 'l' in format [-Wformat=] printf("name sqlda descriptor: '%s' value %lld\n", sqlda->sqlvar[i].sqlname.data, *(long long

Re: Remove obsolete information schema tables

2019-10-25 Thread Peter Eisentraut
On 2019-10-21 07:34, Michael Paquier wrote: > On Sun, Oct 20, 2019 at 10:01:09AM +0200, Peter Eisentraut wrote: >> On 2019-10-17 09:44, Michael Paquier wrote: >>> I have a question here. Per the notes in information_schema.sql, >>> SQL_SIZING_PROFILES has been removed in SQL:2011, >> >> OK, we

Re: WIP: System Versioned Temporal Table

2019-10-25 Thread Vik Fearing
On 25/10/2019 11:56, Surafel Temesgen wrote: > > > On Thu, Oct 24, 2019 at 6:49 PM Vik Fearing > mailto:vik.fear...@2ndquadrant.com>> wrote: > > On 24/10/2019 16:54, Surafel Temesgen wrote: > > > > hi Vik, > > On Wed, Oct 23, 2019 at 9:02 PM Vik Fearing > >

Re: fairywren failures

2019-10-25 Thread Peter Eisentraut
On 2019-10-16 13:34, Andrew Dunstan wrote: >> Could you please check how this animal is labeled? AFAICT, this is not >> an msys2 build but a mingw build (x86_64-w64-mingw32). > > It is indeed an msys2 system. However, when we set MSYSTEM=MINGW64 as > we do in fairywren's config environment so

Re: Add json_object(text[], json[])?

2019-10-25 Thread Paul Jungwirth
On 10/25/19 6:40 AM, Andrew Dunstan wrote: json{b}_build_object and json{b}_build_array are designed for creating nested json{b}. Not sure if they would work for your purpose. Thanks for the suggestion! I looked at these a bit, but they only work if you have a known-ahead-of-time number of

Re: [Proposal] Global temporary tables

2019-10-25 Thread Pavel Stehule
> > > >> So except the limitation mentioned above (which I do not consider as > critical) there is only one problem which was not addressed: maintaining > statistics for GTT. > >> If all of the following conditions are true: > >> > >> 1) GTT are used in joins > >> 2) There are indexes defined for

Re: define bool in pgtypeslib_extern.h

2019-10-25 Thread Tom Lane
I wrote: > I checked that that works and fixes the immediate problem, so I pushed > it. However, we're not out of the woods, because lookee here in > ecpglib.h: > ... Oh, and for extra fun, take a look in src/backend/utils/probes.d :-( regards, tom lane

Re: vacuum on table1 skips rows because of a query on table2

2019-10-25 Thread Tom Lane
Virender Singla writes: > Currently I see the vacuum behavior for a table is that, even if a long > running query on a different table is executing in another read committed > transaction. > That vacuum in the 1st transaction skips the dead rows until the long > running query finishes. > Why that

Re: [Proposal] Arbitrary queries in postgres_fdw

2019-10-25 Thread Tom Lane
rto...@carto.com writes: > We stumbled upon a few cases in which retrieving information from the > foreign server may turn pretty useful before creating any foreign > table, especially info related to the catalog. E.g: a list of schemas > or tables the user has access to. > I thought of using

Re: segmentation fault when cassert enabled

2019-10-25 Thread Tom Lane
Jehan-Guillaume de Rorthais writes: > When investigating for the bug reported in thread "logical replication - > negative bitmapset member not allowed", I found a way to seg fault postgresql > only when cassert is enabled. > ... > I hadn't time to digg further yet. However, I don't understand why

Re: define bool in pgtypeslib_extern.h

2019-10-25 Thread Tom Lane
I wrote: > Amit Kapila writes: >> As suggested by Andrew Gierth [1], I think we can remove the define in >> pgtypeslib_extern.h as it doesn't seem to be exposed. > Yeah, it's not good that that results in a header ordering dependency, > and it doesn't seem like a good idea for

Re: [Proposal] Global temporary tables

2019-10-25 Thread Konstantin Knizhnik
On 25.10.2019 18:01, Robert Haas wrote: On Fri, Oct 11, 2019 at 9:50 AM Konstantin Knizhnik wrote: Just to clarify. I have now proposed several different solutions for GTT: Shared vs. private buffers for GTT: 1. Private buffers. This is least invasive patch, requiring no changes in

segmentation fault when cassert enabled

2019-10-25 Thread Jehan-Guillaume de Rorthais
Hi list, When investigating for the bug reported in thread "logical replication - negative bitmapset member not allowed", I found a way to seg fault postgresql only when cassert is enabled. See the scenario in attachment. When executed against binaries compiled with --enable-cassert, I have the

Re: Questions/Observations related to Gist vacuum

2019-10-25 Thread Masahiko Sawada
On Wed, Oct 23, 2019 at 8:14 PM Amit Kapila wrote: > > On Tue, Oct 22, 2019 at 2:17 PM Dilip Kumar wrote: > > > > On Tue, Oct 22, 2019 at 10:53 AM Amit Kapila > > wrote: > > > > > > > Basically, only IndexBulkDeleteResult is now shared across the stage > > > > so we can move all members to

Re: [HACKERS] Block level parallel vacuum

2019-10-25 Thread Masahiko Sawada
On Fri, Oct 25, 2019 at 2:06 PM Dilip Kumar wrote: > > On Fri, Oct 25, 2019 at 10:22 AM Masahiko Sawada > wrote: > > > > For more detail of my idea it is that the first worker who entered to > > vacuum_delay_point adds its local value to shared value and reset the > > local value to 0. And then

[Proposal] Arbitrary queries in postgres_fdw

2019-10-25 Thread rtorre
Dear all, We stumbled upon a few cases in which retrieving information from the foreign server may turn pretty useful before creating any foreign table, especially info related to the catalog. E.g: a list of schemas or tables the user has access to. I thought of using dblink for it, but that

Re: [Proposal] Global temporary tables

2019-10-25 Thread Pavel Stehule
pá 25. 10. 2019 v 17:01 odesílatel Robert Haas napsal: > On Fri, Oct 11, 2019 at 9:50 AM Konstantin Knizhnik > wrote: > > Just to clarify. > > I have now proposed several different solutions for GTT: > > > > Shared vs. private buffers for GTT: > > 1. Private buffers. This is least invasive

Re: Transparent Data Encryption (TDE) and encrypted files

2019-10-25 Thread Stephen Frost
Greetings, * Bruce Momjian (br...@momjian.us) wrote: > On Thu, Oct 10, 2019 at 10:40:37AM -0400, Stephen Frost wrote: > > > Some people ask for indexable encrypted columns, but I tend to explain to > > > them how impractical and inefficient that is. You can support hash indexes > > > if you don't

Re: [Proposal] Global temporary tables

2019-10-25 Thread Robert Haas
On Fri, Oct 11, 2019 at 9:50 AM Konstantin Knizhnik wrote: > Just to clarify. > I have now proposed several different solutions for GTT: > > Shared vs. private buffers for GTT: > 1. Private buffers. This is least invasive patch, requiring no changes in > relfilenodes. > 2. Shared buffers.

Re: define bool in pgtypeslib_extern.h

2019-10-25 Thread Tom Lane
Amit Kapila writes: > As suggested by Andrew Gierth [1], I think we can remove the define in > pgtypeslib_extern.h as it doesn't seem to be exposed. Yeah, it's not good that that results in a header ordering dependency, and it doesn't seem like a good idea for pgtypeslib_extern.h to be messing

Re: Add json_object(text[], json[])?

2019-10-25 Thread Andrew Dunstan
On 10/24/19 12:46 PM, Paul A Jungwirth wrote: > > Even still, it may be nice to have a non-aggregate function that lets > you build nested JSON. But I agree jsonb_object_agg makes it less > needful. > json{b}_build_object and json{b}_build_array are designed for creating nested json{b}. Not

Re: [HACKERS] WAL logging problem in 9.4.3?

2019-10-25 Thread Kyotaro Horiguchi
On Fri, Oct 25, 2019 at 1:13 PM Kyotaro Horiguchi wrote: > Hello. Thanks for the comment. > > # Sorry in advance for possilbe breaking the thread. > > > MarkBufferDirtyHint() writes WAL even when rd_firstRelfilenodeSubid or > > rd_createSubid is set; see attached test case. It needs to skip WAL

Re: tuplesort test coverage

2019-10-25 Thread Peter Geoghegan
On Thu, Oct 24, 2019 at 10:10 PM Andres Freund wrote: > Here's a first stab at getting the coverage of tuplesort.c to a > satisfying level. There's still bits uncovered, but that's largely > either a) trace_sort related b) hopefully unreachable stuff c) explain > related. The largest actually

Re: tuplesort test coverage

2019-10-25 Thread Peter Geoghegan
On Thu, Oct 24, 2019 at 7:10 PM Andres Freund wrote: > I really don't think it's ok to have as many abbrev abort related paths > without any coverage - the relevant code isn't that trivial. And > something like amcheck really doesn't strike me as sufficient. For one, > it doesn't provide any

Re: [HACKERS] advanced partition matching algorithm for partition-wise join

2019-10-25 Thread amul sul
On Wed, Oct 16, 2019 at 6:20 PM Etsuro Fujita wrote: > On Wed, Sep 25, 2019 at 12:59 AM Etsuro Fujita > wrote: > > I will continue to review the rest of the patch. > > I've been reviewing the rest of the patch. Here are my review comments: > [] > So I'd like to propose to introduce

Re: Ordering of header file inclusion

2019-10-25 Thread Amit Kapila
On Thu, Oct 24, 2019 at 2:43 PM Amit Kapila wrote: > > On Wed, Oct 23, 2019 at 10:23 AM Amit Kapila wrote: > > > > Attached are patches for (a) and (b) after another round of review and > > fixes by Vignesh. I am planning to commit the first one (a) tomorrow > > morning and then if everything

Re: WIP: System Versioned Temporal Table

2019-10-25 Thread Surafel Temesgen
On Thu, Oct 24, 2019 at 6:49 PM Vik Fearing wrote: > On 24/10/2019 16:54, Surafel Temesgen wrote: > > > > hi Vik, > > On Wed, Oct 23, 2019 at 9:02 PM Vik Fearing > > mailto:vik.fear...@2ndquadrant.com>> > wrote: > > > > > > > > If we're going to be implicitly adding stuff to the PK, we also

define bool in pgtypeslib_extern.h

2019-10-25 Thread Amit Kapila
Today, I committed a patch (dddf4cdc) to reorder some of the file header inclusions and buildfarm members prairiedog and locust failed as a result of that. The reason turns out to be that we have defined a bool in pgtypeslib_extern.h and that definition is different from what we define in c.h.

Re: psql tab-complete

2019-10-25 Thread Victor Spirin
This patch resolved one problem in the tab-complete.c on MSVC. The VA_ARGS_NARGS macros now work correctly on Windows. Victor Spirin Postgres Professional:http://www.postgrespro.com The Russian Postgres Company 25.10.2019 0:53, Victor Spirin пишет: Yes, I found, that VA_ARGS_NARGS(__

Problem with synchronous replication

2019-10-25 Thread Dongming Liu
Hi, I recently discovered two possible bugs about synchronous replication. 1. SyncRepCleanupAtProcExit may delete an element that has been deleted SyncRepCleanupAtProcExit first checks whether the queue is detached, if it is not detached, acquires the SyncRepLock lock and deletes it. If this

RE: Fix of fake unlogged LSN initialization

2019-10-25 Thread tsunakawa.ta...@fujitsu.com
From: Dilip Kumar > I have noticed that in StartupXlog also we reset it with 1, you might > want to fix that as well? > > StartupXLOG > { > ... > /* > * Initialize unlogged LSN. On a clean shutdown, it's restored from the > * control file. On recovery, all unlogged relations are blown away, so >

RE: Fix of fake unlogged LSN initialization

2019-10-25 Thread tsunakawa.ta...@fujitsu.com
From: Simon Riggs > From xlogdefs.h added by 9155580: > /* >* First LSN to use for "fake" LSNs. >* >* Values smaller than this can be used for special per-AM purposes. >*/ > #define FirstNormalUnloggedLSN ((XLogRecPtr) 1000) Yeah, I had seen it,

vacuum on table1 skips rows because of a query on table2

2019-10-25 Thread Virender Singla
Currently I see the vacuum behavior for a table is that, even if a long running query on a different table is executing in another read committed transaction. That vacuum in the 1st transaction skips the dead rows until the long running query finishes. Why that is the case, On same table long

Re: [PATCH] Do not use StdRdOptions in Access Methods

2019-10-25 Thread Amit Langote
Hi Michael, Thanks for taking a look at this. On Wed, Oct 23, 2019 at 12:51 PM Michael Paquier wrote: > On Wed, Oct 23, 2019 at 11:16:25AM +0900, Amit Langote wrote: > > IMO, parts of the patch that only refactors the existing code should > > be first in the list as it is easier to review,

Re: Fix of fake unlogged LSN initialization

2019-10-25 Thread Michael Paquier
On Fri, Oct 25, 2019 at 02:07:04AM +, tsunakawa.ta...@fujitsu.com wrote: > From: Simon Riggs >> From xlogdefs.h added by 9155580: >> /* >> * First LSN to use for "fake" LSNs. >> * >> * Values smaller than this can be used for special per-AM purposes. >> */ >>

Re: Fix of fake unlogged LSN initialization

2019-10-25 Thread Michael Paquier
On Thu, Oct 24, 2019 at 01:57:45PM +0530, Dilip Kumar wrote: > I have noticed that in StartupXlog also we reset it with 1, you might > want to fix that as well? Tsunakawa-san's patch fixes that spot already. Grepping for unloggedLSN in the code there is only pg_resetwal on top of what you are

Re: Fix of fake unlogged LSN initialization

2019-10-25 Thread Heikki Linnakangas
On 24/10/2019 15:08, Michael Paquier wrote: On Thu, Oct 24, 2019 at 11:57:33AM +0100, Simon Riggs wrote: I wonder why is that value 1000, rather than an aligned value or a whole WAL page? Good question. Heikki, why this choice? No particular reason, it's just a nice round value in decimal.

Duplicate entries in pg_depend after REINDEX CONCURRENTLY

2019-10-25 Thread Michael Paquier
Hi all, While digging into a separate issue, I have found a new bug with REINDEX CONCURRENTLY. Once the new index is built and validated, a couple of things are done at the swap phase, like switching constraints, comments, and dependencies. The current code moves all the dependency entries of