Re: [HACKERS] Block level parallel vacuum

2019-11-02 Thread Dilip Kumar
On Fri, Nov 1, 2019 at 2:21 PM Masahiko Sawada wrote: > > On Thu, Oct 31, 2019 at 3:45 PM Dilip Kumar wrote: > > > > On Thu, Oct 31, 2019 at 11:33 AM Dilip Kumar wrote: > > > > > > On Tue, Oct 29, 2019 at 1:59 PM Masahiko Sawada > > > wrote: > > > > Actually after increased shared_buffer I

Re: CREATE TEXT SEARCH DICTIONARY segfaulting on 9.6+

2019-11-02 Thread Artur Zakirov
On Sun, Nov 3, 2019 at 5:48 AM Tom Lane wrote: > > Arthur Zakirov writes: > > On 2019/10/13 10:26, Tomas Vondra wrote: > >> So I think we need some sort of cross-check here. We certainly need to > >> make NISortDictionary() check the affix value is within AffixData > >> bounds, and error out

Logical replication wal sender timestamp bug

2019-11-02 Thread Jeff Janes
While monitoring pg_stat_subscription, I noticed that last_msg_send_time was usually NULL, which doesn't make sense. Why would we have a message, but not know when it was sent? Looking in src/backend/replication/walsender.c, there is this: /* output previously gathered data in a CopyData

Re: Remove configure --disable-float4-byval and --disable-float8-byval

2019-11-02 Thread Andres Freund
Hi, On 2019-11-02 08:46:12 +0100, Peter Eisentraut wrote: > On 2019-11-01 15:41, Robert Haas wrote: > > On a related note, why do we store typbyval in the catalog anyway > > instead of inferring it from typlen and maybe typalign? It seems like > > a bad idea to record on disk the way we pass

Re: Allow cluster_name in log_line_prefix

2019-11-02 Thread Vik Fearing
On 31/10/2019 08:47, Fujii Masao wrote: > On Mon, Oct 28, 2019 at 1:33 PM Craig Ringer wrote: >> Hi folks >> >> I was recently surprised to notice that log_line_prefix doesn't support a >> cluster_name placeholder. I suggest adding one. If I don't hear objections >> I'll send a patch. > If we

Re: 64 bit transaction id

2019-11-02 Thread Tomas Vondra
On Sat, Nov 02, 2019 at 11:35:09PM +0300, Павел Ерёмин wrote: The proposed option is not much different from what it is now. We are not trying to save some space - we will reuse the existing one. We just work in 64 bit transaction counters. Correct me if I'm wrong - the address of the

[PATCH] contrib/seg: Fix PG_GETARG_SEG_P definition

2019-11-02 Thread Dagfinn Ilmari Mannsåker
Hi hackers, I just noticed that when contrib/seg was converted to V1 calling convention (commit 389bb2818f4), the PG_GETARG_SEG_P() macro got defined in terms of PG_GETARG_POINTER(). But it itself calls DatumGetPointer(), so shouldn't it be using PG_GETARG_DATUM()? Attached is a patch that

Re: Make StringInfo available to frontend code.

2019-11-02 Thread Daniel Gustafsson
> On 2 Nov 2019, at 03:21, Andres Freund wrote: > On 2019-11-01 23:19:33 +0100, Daniel Gustafsson wrote: >> + * StringInfo provides an extensible string data type. It can be used to >> >> It might be useful to point out the upper bound on the extensibility in the >> rewrite of this sentence,

Re: The flinfo->fn_extra question, from me this time.

2019-11-02 Thread Dent John
Hi, Turns out — to my embarrassment — that pretty much all of the regression tests failed with my patch. No idea if anyone spotted that and withheld reply in revenge, but I wouldn’t blame if you did! I have spent a bit more time on it. The attached patch is a much better show, though there

Re: dropdb --force

2019-11-02 Thread Pavel Stehule
> I am sending patch where kill was replaced by SendProcSignal. I tested it > on pg_bench with 400 connections, and it works without problems. > I tested it under high load and it is works. But it is slower than just kill - under load the killing 400 connections needs about 1.5 sec. Maybe for

Re: CREATE TEXT SEARCH DICTIONARY segfaulting on 9.6+

2019-11-02 Thread Tom Lane
Arthur Zakirov writes: > On 2019/10/13 10:26, Tomas Vondra wrote: >> So I think we need some sort of cross-check here. We certainly need to >> make NISortDictionary() check the affix value is within AffixData >> bounds, and error out when the index is non-sensical (maybe negative >> and/or

Re: dropdb --force

2019-11-02 Thread Pavel Stehule
Hi so 2. 11. 2019 v 17:18 odesílatel Pavel Stehule napsal: > > > pá 25. 10. 2019 v 4:55 odesílatel Amit Kapila > napsal: > >> On Thu, Oct 24, 2019 at 8:22 PM Pavel Stehule >> wrote: >> > >> > čt 24. 10. 2019 v 11:10 odesílatel Amit Kapila >> napsal: >> >> >> >> While making some changes in

Re: 64 bit transaction id

2019-11-02 Thread Павел Ерёмин
The proposed option is not much different from what it is now.We are not trying to save some space - we will reuse the existing one. We just work in 64 bit transaction counters. Correct me if I'm wrong - the address of the next version of the line is stored in the 6 byte field t_cid in the tuple

Re: Index Skip Scan

2019-11-02 Thread Peter Geoghegan
On Sat, Nov 2, 2019 at 11:56 AM Peter Geoghegan wrote: > On Wed, Sep 25, 2019 at 2:33 AM Dmitry Dolgov <9erthali...@gmail.com> wrote: > > v27-0001-Index-skip-scan.patch > > Some random thoughts on this: And now some more: * I'm confused about this code in _bt_skip(): > /* > * Andvance

Re: bitmaps and correlation

2019-11-02 Thread Justin Pryzby
Attached is a fixed and rebasified patch for cfbot. Included inline for conceptual review. >From f3055a5696924427dda280da702c41d2d2796a24 Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Tue, 1 Jan 2019 16:17:28 -0600 Subject: [PATCH v2] Use correlation statistic in costing bitmap scans..

Re: v12.0: ERROR: could not find pathkey item to sort

2019-11-02 Thread Tom Lane
Amit Langote writes: >> This would >> probably require refactoring things so that there are separate >> entry points to add child equivalences for base rels and join rels. >> But that seems cleaner anyway than what you've got here. > Separate entry points sounds better, but only in HEAD? I had

Re: 64 bit transaction id

2019-11-02 Thread Павел Ерёмин
 The proposed option does not need to change the length of either the page header or tuple header. Therefore, you will not need to physically change the data. regards01.11.2019, 20:10, "Tomas Vondra" :On Fri, Nov 01, 2019 at 10:25:17AM +0100, Pavel Stehule wrote:Hipá 1. 11. 2019 v 10:11 odesílatel

Re: Index Skip Scan

2019-11-02 Thread Peter Geoghegan
On Wed, Sep 25, 2019 at 2:33 AM Dmitry Dolgov <9erthali...@gmail.com> wrote: > v27-0001-Index-skip-scan.patch Some random thoughts on this: * Is _bt_scankey_within_page() really doing the right thing within empty pages? It looks like you're accidentally using the high key when the leaf page is

Re: 64 bit transaction id

2019-11-02 Thread Tomas Vondra
On Sat, Nov 02, 2019 at 07:07:17PM +0300, Павел Ерёмин wrote:   The proposed option does not need to change the length of either the page header or tuple header. Therefore, you will not need to physically change the data.   So how do you link the tuple versions together? Clearly,

pg_upgrade and subscriptions

2019-11-02 Thread Oleksii Kliukin
Hello, I came across a surprising behavior when upgrading our PostgreSQL 10 DBs that also serve as a destination for the logical replication of some reference tables. pg_upgrade turns off all subscriptions on the cluster and doesn't turn them on. Specifically, it creates them with connect =

Re: [Proposal] Global temporary tables

2019-11-02 Thread Pavel Stehule
And pg_catalog.pg_statistics_gtt() is set returning functions? > yes I afraid that it is not acceptable solution from performance point of view: > pg_statictic table is accessed by keys (,,) > I don't think so it is problem. The any component, that needs to use fast access can use some special

Re: Getting psql to redisplay command after \e

2019-11-02 Thread Tom Lane
Fabien COELHO writes: > My point is to possibly not implicitely at the end of \e, but to > behave as if we were moving in history, which allows editing the lines, so > that you would get >psql=> select 1 > Instead of the above. >> I agree it might be nicer if you could do that, but that's

Re: dropdb --force

2019-11-02 Thread Pavel Stehule
pá 25. 10. 2019 v 4:55 odesílatel Amit Kapila napsal: > On Thu, Oct 24, 2019 at 8:22 PM Pavel Stehule > wrote: > > > > čt 24. 10. 2019 v 11:10 odesílatel Amit Kapila > napsal: > >> > >> While making some changes in the patch, I noticed that in > >> TerminateOtherDBBackends, there is a race

Re: [Proposal] Global temporary tables

2019-11-02 Thread Julien Rouhaud
On Sat, Nov 2, 2019 at 4:09 PM Konstantin Knizhnik wrote: > > On 02.11.2019 10:19, Julien Rouhaud wrote: > > On Sat, Nov 2, 2019 at 6:31 AM Pavel Stehule > > wrote: > >> pá 1. 11. 2019 v 17:09 odesílatel Konstantin Knizhnik > >> napsal: > >>> On 01.11.2019 18:26, Robert Haas wrote: > On

Re: Remove configure --disable-float4-byval and --disable-float8-byval

2019-11-02 Thread Tom Lane
Peter Eisentraut writes: > On 2019-11-01 15:41, Robert Haas wrote: >> On a related note, why do we store typbyval in the catalog anyway >> instead of inferring it from typlen and maybe typalign? It seems like >> a bad idea to record on disk the way we pass around values in memory, >> because it

Re: [Proposal] Global temporary tables

2019-11-02 Thread Konstantin Knizhnik
On 02.11.2019 8:30, Pavel Stehule wrote: pá 1. 11. 2019 v 17:09 odesílatel Konstantin Knizhnik mailto:k.knizh...@postgrespro.ru>> napsal: On 01.11.2019 18:26, Robert Haas wrote: > On Fri, Nov 1, 2019 at 11:15 AM Konstantin Knizhnik > mailto:k.knizh...@postgrespro.ru>>

Re: [Proposal] Global temporary tables

2019-11-02 Thread Konstantin Knizhnik
On 02.11.2019 10:19, Julien Rouhaud wrote: On Sat, Nov 2, 2019 at 6:31 AM Pavel Stehule wrote: pá 1. 11. 2019 v 17:09 odesílatel Konstantin Knizhnik napsal: On 01.11.2019 18:26, Robert Haas wrote: On Fri, Nov 1, 2019 at 11:15 AM Konstantin Knizhnik wrote: It seems to me that I have

Re: On disable_cost

2019-11-02 Thread Tom Lane
Tomas Vondra writes: > On Fri, Nov 01, 2019 at 09:30:52AM -0700, Jim Finnerty wrote: >> re: coping with adding disable_cost more than once >> >> Another option would be to have a 2-part Cost structure. If disable_cost is >> ever added to the Cost, then you set a flag recording this. If any

Re: Refactor parse analysis of EXECUTE command

2019-11-02 Thread Tom Lane
Peter Eisentraut writes: > This patch moves the parse analysis component of ExecuteQuery() and > EvaluateParams() into a new transformExecuteStmt() that is called from > transformStmt(). Uhmm ... no actual patch attached? regards, tom lane

Re: On disable_cost

2019-11-02 Thread Tom Lane
Zhenghua Lyu writes: >> I think a more robust way to disable forbidden plan types would be to >> handle the disabling in add_path(). Instead of having a high disable cost >> on the Path itself, the comparison add_path() would always consider >> disabled paths as more expensive than others,

Re: [Proposal] Table-level Transparent Data Encryption (TDE) and Key Management Service (KMS)

2019-11-02 Thread Masahiko Sawada
On Sat, 2 Nov 2019 at 21:33, Antonin Houska wrote: > Robert Haas wrote: > > > On Tue, Aug 6, 2019 at 10:36 AM Bruce Momjian wrote: > > > Seems reasonable (not that I am an encryption expert). > > > > > For WAL, we effectively create a 16MB bitstream, though we can create > it > > > in parts as

Re: alternative to PG_CATCH

2019-11-02 Thread Tom Lane
Peter Eisentraut writes: > committed with a leading underscore I hadn't actually tested this patch before commit, but now that it's in, I'm seeing assorted compiler warnings: plpy_exec.c: In function 'PLy_procedure_call': plpy_exec.c:1028: warning: 'rv' may be used uninitialized in this

Re: Can avoid list_copy in recomputeNamespacePath() conditionally?

2019-11-02 Thread Tom Lane
amul sul writes: > I wondered can we have a shortcut somewhat similar to following POC > in recomputeNamespacePath () when the recomputed path is the same as the > previous baseSearchPath/activeSearchPath : > + /* TODO: POC */ > + if (equal(oidlist, baseSearchPath)) > + return; There's

Re: [Proposal] Table-level Transparent Data Encryption (TDE) and Key Management Service (KMS)

2019-11-02 Thread Antonin Houska
Robert Haas wrote: > On Tue, Aug 6, 2019 at 10:36 AM Bruce Momjian wrote: > Seems reasonable (not that I am an encryption expert). > > > For WAL, we effectively create a 16MB bitstream, though we can create it > > in parts as needed. (Creating it in parts is easier in CTR mode.) The > >

Re: [Proposal] Table-level Transparent Data Encryption (TDE) and Key Management Service (KMS)

2019-11-02 Thread Antonin Houska
Robert Haas wrote: > On Mon, Aug 5, 2019 at 8:44 PM Bruce Momjian wrote: > > Right. The 8k page LSN changes each time the page is modified, and the > > is part of the page nonce. > > What about hint bit changes? > > I think even with wal_log_hints=on, it's not the case that *every* > change

Re: pglz performance

2019-11-02 Thread Andrey Borodin
> 1 нояб. 2019 г., в 18:48, Alvaro Herrera > написал(а): > > On 2019-Nov-01, Peter Eisentraut wrote: > >> On 2019-10-25 07:05, Andrey Borodin wrote: 21 окт. 2019 г., в 14:09, Andrey Borodin написал(а): With Silesian corpus pglz_decompress_hacked is actually decreasing

Re: Adding percentile metrics to pg_stat_statements module

2019-11-02 Thread Adrien Nayrat
On 10/31/19 8:32 PM, Tomas Vondra wrote: > IMO having some sort of CDF approximation (being a q-digest or t-digest) > would be useful, although it'd probably need to be optional (mostly > becuase of memory consumption). +1, I like this idea. If we are afraid of CPU cost we could imagine some kind

Re: [Proposal] Global temporary tables

2019-11-02 Thread Julien Rouhaud
On Sat, Nov 2, 2019 at 8:23 AM Pavel Stehule wrote: > > so 2. 11. 2019 v 8:18 odesílatel Julien Rouhaud napsal: >> >> On Sat, Nov 2, 2019 at 6:31 AM Pavel Stehule wrote: >> > >> > pá 1. 11. 2019 v 17:09 odesílatel Konstantin Knizhnik >> > napsal: >> >> >> >> On 01.11.2019 18:26, Robert Haas

Re: update ALTER TABLE with ATTACH PARTITION lock mode (docs)

2019-11-02 Thread Michael Paquier
On Fri, Nov 01, 2019 at 11:58:43AM -0500, Justin Pryzby wrote: > Attaching a partition acquires a SHARE UPDATE EXCLUSIVE > lock > on the parent table, in addition to ACCESS EXCLUSIVE locks > on the table to be attached and the DEFAULT partition (if > any).

Re: Remove configure --disable-float4-byval and --disable-float8-byval

2019-11-02 Thread Peter Eisentraut
On 2019-11-01 15:41, Robert Haas wrote: On a related note, why do we store typbyval in the catalog anyway instead of inferring it from typlen and maybe typalign? It seems like a bad idea to record on disk the way we pass around values in memory, because it means that a change to how values are

Re: Application name for pg_basebackup and friends

2019-11-02 Thread Michael Paquier
On Thu, Oct 31, 2019 at 03:10:35PM +0200, Heikki Linnakangas wrote: > You can already set application name with the environment variable or on the > database connections string: > > pg_receivewal -D /wal -d "host=myhost application_name=myreceiver" > > I don't think we need a new comand line

Re: TestLib::command_fails_like enhancement

2019-11-02 Thread Michael Paquier
On Thu, Oct 31, 2019 at 01:02:58PM -0400, Andrew Dunstan wrote: > This small patch authored by my colleague Craig Ringer enhances > Testlib's command_fails_like by allowing the passing of extra keyword > type arguments. The keyword initially recognized is 'extra_ipcrun_opts'. > The value for this

Re: The command tag of "ALTER MATERIALIZED VIEW RENAME COLUMN"

2019-11-02 Thread Michael Paquier
On Fri, Nov 01, 2019 at 02:17:03PM +0500, Ibrar Ahmed wrote: > Do we really need a regression test cases for such small oversights? It is possible to get the command tags using an event trigger... But that sounds hack-ish. -- Michael signature.asc Description: PGP signature

Re: Remove configure --disable-float4-byval and --disable-float8-byval

2019-11-02 Thread Peter Eisentraut
On 2019-10-31 14:36, Tom Lane wrote: Peter Eisentraut writes: float4 is now always pass-by-value; the pass-by-reference code path is completely removed. I think this is OK. OK, here is a patch for just this part, and we can continue the discussion on the rest in the meantime. -- Peter

Re: [PATCH][DOC] Fix for PREPARE TRANSACTION doc and postgres_fdw message.

2019-11-02 Thread Michael Paquier
On Fri, Nov 01, 2019 at 05:29:23PM +0100, Gilles Darold wrote: > I have attached a patch to the documentation that adds remote tables to > the list of objects where any operation prevent using a prepared > transaction, currently it is just notified "operations involving > temporary tables or the

Re: [Proposal] Global temporary tables

2019-11-02 Thread Pavel Stehule
so 2. 11. 2019 v 8:23 odesílatel Pavel Stehule napsal: > > > so 2. 11. 2019 v 8:18 odesílatel Julien Rouhaud > napsal: > >> On Sat, Nov 2, 2019 at 6:31 AM Pavel Stehule >> wrote: >> > >> > pá 1. 11. 2019 v 17:09 odesílatel Konstantin Knizhnik < >> k.knizh...@postgrespro.ru> napsal: >> >> >> >>

Re: [Proposal] Global temporary tables

2019-11-02 Thread Pavel Stehule
so 2. 11. 2019 v 8:18 odesílatel Julien Rouhaud napsal: > On Sat, Nov 2, 2019 at 6:31 AM Pavel Stehule > wrote: > > > > pá 1. 11. 2019 v 17:09 odesílatel Konstantin Knizhnik < > k.knizh...@postgrespro.ru> napsal: > >> > >> On 01.11.2019 18:26, Robert Haas wrote: > >> > On Fri, Nov 1, 2019 at

Re: [Proposal] Global temporary tables

2019-11-02 Thread Julien Rouhaud
On Sat, Nov 2, 2019 at 6:31 AM Pavel Stehule wrote: > > pá 1. 11. 2019 v 17:09 odesílatel Konstantin Knizhnik > napsal: >> >> On 01.11.2019 18:26, Robert Haas wrote: >> > On Fri, Nov 1, 2019 at 11:15 AM Konstantin Knizhnik >> > wrote: >> >> It seems to me that I have found quite elegant