Re: bool_plperl transform

2020-02-29 Thread Andrew Dunstan
On 2/29/20 4:55 PM, Ivan Panchenko wrote: > Hi, > While using PL/Perl I have found that it obtains boolean arguments > from Postgres as ‘t’ and ‘f’, which is extremely inconvenient because > ‘f’ is not false from the perl viewpoint. > So the problem is how to convert the SQL booleans into Perl

Re: [BUG?] postgres_fdw incorrectly updates remote table if it has inherited children.

2020-02-29 Thread Kohei KaiGai
Hi Amit, Thanks, I didn't check the thread. It looks to me the latest patch was submitted by Fujita-san, Oct-2018. Then, Tom pointer out this simple approach has a problem of inefficient remote query plan because of no intelligence on the structure of remote tables mapped by postgres_fdw. After

Re: [PATCH] Add schema and table names to partition error

2020-02-29 Thread Amit Langote
Hi Chris, On Sun, Mar 1, 2020 at 4:34 AM Chris Bandy wrote: > Hello, > > I'm writing telemetry data into a table partitioned by time. When there > is no partition for a particular date, my app notices the constraint > violation, creates the partition, and retries the insert. > > I'm used to

Re: [BUG?] postgres_fdw incorrectly updates remote table if it has inherited children.

2020-02-29 Thread Amit Langote
Hi, On Sun, Mar 1, 2020 at 12:00 PM Kohei KaiGai wrote: > > Hello, > > I noticed the following scenario under the development of truncate > support on FDW. > > In case when 'ftable' maps a remote table that has inherited children,... > > postgres=# create table rtable_parent (id int, label text,

[BUG?] postgres_fdw incorrectly updates remote table if it has inherited children.

2020-02-29 Thread Kohei KaiGai
Hello, I noticed the following scenario under the development of truncate support on FDW. In case when 'ftable' maps a remote table that has inherited children,... postgres=# create table rtable_parent (id int, label text, x text); CREATE TABLE postgres=# create table rtable_child () inherits

Re: Auxiliary Processes and MyAuxProc

2020-02-29 Thread Mike Palmiotto
On Sat, Nov 30, 2019 at 9:15 PM Michael Paquier wrote: > > On Thu, Oct 03, 2019 at 11:39:37AM -0700, Andres Freund wrote: > > Color me unconvinced. > > The latest comments of the thread have not been addressed yet. so I am > marking the patch as returned with feedback. If you think that's not >

Re: TRUNCATE on foreign tables

2020-02-29 Thread Kohei KaiGai
Hello, The attached is revised version. > > If callback is invoked with a foreign-relation that is specified by TRUNCATE > > command with ONLY, it seems to me reasonable that remote TRUNCATE > > command specifies the relation on behalf of the foreign table with ONLY. > > > > So, if

Re: bool_plperl transform

2020-02-29 Thread Tom Lane
=?UTF-8?B?SXZhbiBQYW5jaGVua28=?= writes: > While using PL/Perl I have found that it obtains boolean arguments from > Postgres as ‘t’ and ‘f’, which is extremely inconvenient because ‘f’ is not > false from the perl viewpoint. > ... > * make a transform which transforms bool, like it is done

Re: Allowing ALTER TYPE to change storage strategy

2020-02-29 Thread Tom Lane
Tomas Vondra writes: > On Fri, Feb 28, 2020 at 08:35:33PM -0500, Tom Lane wrote: >> You'd need a moderately strong lock on each such table, which means >> there'd be serious deadlock hazards. I'm dubious that it's worth >> troubling with. > Yeah, I don't plan to do this in v1 (and I have no

bool_plperl transform

2020-02-29 Thread Ivan Panchenko
Hi, While using PL/Perl I have found that it obtains boolean arguments from Postgres as ‘t’ and ‘f’, which is extremely inconvenient because ‘f’ is not false from the perl viewpoint. So the problem is how to convert the SQL booleans into Perl style.   There are 3 ways to do this: * make plperl

Re: Broken resetting of subplan hash tables

2020-02-29 Thread Tom Lane
Andres Freund writes: > On 2020-02-29 14:02:59 -0500, Tom Lane wrote: >> TBH, I think that this tuple table API is seriously misdesigned; >> it is confusing and very error-prone to have the callers need to >> reset the tuple context separately from calling ResetTupleHashTable. > Do you have an

Re: Allow to_date() and to_timestamp() to accept localized names

2020-02-29 Thread Tom Lane
=?UTF-8?Q?Juan_Jos=C3=A9_Santamar=C3=ADa_Flecha?= writes: > On Tue, Jan 28, 2020 at 9:35 PM Peter Eisentraut < > peter.eisentr...@2ndquadrant.com> wrote: >> So I'm withdrawing my concerns with respect to this patch. As long as >> it can do a roundtrip conversion with to_char(), it's fine. > We

Re: Allowing ALTER TYPE to change storage strategy

2020-02-29 Thread Tomas Vondra
On Fri, Feb 28, 2020 at 08:35:33PM -0500, Tom Lane wrote: Tomas Vondra writes: I think we might check if there are any attributes with the given data type, and allow the change if there are none. That would still allow the change when the type is used only for things like function parameters

Re: SLRU statistics

2020-02-29 Thread Tomas Vondra
On Sat, Feb 29, 2020 at 11:44:26AM -0300, Alvaro Herrera wrote: On 2020-Feb-29, Tomas Vondra wrote: Did we actually remove track-enabling GUCs? I think we still have - track_activities - track_counts - track_io_timing - track_functions But maybe I'm missing something? Hm I remembered

Re: Catalog invalidations vs catalog scans vs ScanPgRelation()

2020-02-29 Thread Andres Freund
Hi, On 2020-02-28 22:10:52 -0800, Andres Freund wrote: > So, um. What happens is that doDeletion() does a catalog scan, which > sets a snapshot. The results of that catalog scan are then used to > perform modifications. But at that point there's no guarantee that we > still hold *any* snapshot,

Re: vacuum verbose detail logs are unclear; log at *start* of each stage

2020-02-29 Thread Justin Pryzby
On Thu, Feb 27, 2020 at 10:10:57AM +0100, Peter Eisentraut wrote: > On 2020-01-26 06:36, Justin Pryzby wrote: > >Subject: [PATCH v3 1/4] Remove gettext erronously readded at 580ddce > > > >-appendStringInfo(, _("%s."), pg_rusage_show()); > >+appendStringInfo(, "%s.", pg_rusage_show()); >

Re: Broken resetting of subplan hash tables

2020-02-29 Thread Andres Freund
Hi, On 2020-02-29 14:02:59 -0500, Tom Lane wrote: > > 3. Additionally since the memory context used by the hash tables is > > reset in buildSubPlanHash() if we start resetting hash tables we will > > get a use after free bug. > > Nope, not right. The hash table metadata is now allocated in

[PATCH] Add schema and table names to partition error

2020-02-29 Thread Chris Bandy
Hello, I'm writing telemetry data into a table partitioned by time. When there is no partition for a particular date, my app notices the constraint violation, creates the partition, and retries the insert. I'm used to handling constraint violations by observing the constraint name in the

Re: subplan resets wrong hashtable

2020-02-29 Thread Tom Lane
I wrote: > Right. So the incorrect ResetTupleHashTable call is unreachable > (and a look at the code coverage report confirms that). The whole > thing obviously is a bit hasty and unreviewed, but it doesn't have > a live bug AFAICS ... or at least, if there's a bug, it's a memory > leakage issue

Re: Broken resetting of subplan hash tables

2020-02-29 Thread Tom Lane
Andreas Karlsson writes: > The code for resetting the hash tables of the SubPlanState node in > buildSubPlanHash() looks like it can never run, and additionally it > would be broken if it would ever run. This issue was introduced in > commit 356687bd825e5ca7230d43c1bffe7a59ad2e77bd. Right.

Re: Portal->commandTag as an enum

2020-02-29 Thread Mark Dilger
> On Feb 28, 2020, at 5:42 PM, Tom Lane wrote: > > Mark Dilger writes: >>> On Feb 28, 2020, at 3:05 PM, Tom Lane wrote: >>> Is there a way to drop that logic altogether by making the tagname string >>> be "INSERT 0" for the INSERT case? Or would the zero bleed into other >>> places where

Re: pgbench: option delaying queries till connections establishment?

2020-02-29 Thread Andres Freund
Hi, On 2020-02-29 15:29:19 +0100, Fabien COELHO wrote: > Pgbench is more or less designed to run a long hopefully steady-state > benchmark, so that the initial connection setup is always negligeable. Not > complying with this hypothesis quite often leads to weird results. I don't think this is a

Re: Yet another fast GiST build (typo)

2020-02-29 Thread Andrey M. Borodin
> On 29 февр. 2020 г., at 17:20, Erik Rijkers wrote: > > Small typo alert: > In v5-0002-Implement-GiST-build-using-sort-support.patch there is: > > + method is also optional and is used diring fast GiST build. > > 'diring' should be 'during' > Thanks! I've fixed this and added patch

Re: proposal \gcsv

2020-02-29 Thread David Fetter
On Sat, Feb 29, 2020 at 11:59:22AM +0100, Pavel Stehule wrote: > so 29. 2. 2020 v 11:34 odesílatel Vik Fearing > napsal: > > > On 29/02/2020 06:43, Pavel Stehule wrote: > > > Hi > > > > > > I would to enhance \g command about variant \gcsv > > > > > > proposed command has same behave like \g,

Re: ALTER tbl rewrite loses CLUSTER ON index

2020-02-29 Thread Justin Pryzby
On Fri, Feb 28, 2020 at 08:42:02PM -0600, Justin Pryzby wrote: > On Fri, Feb 28, 2020 at 06:26:04PM -0500, Tom Lane wrote: > > Justin Pryzby writes: > > > I think the attached is 80% complete (I didn't touch pg_dump). > > > One objection to this change would be that all relations (including > >

Re: Binary support for pgoutput plugin

2020-02-29 Thread Dave Cramer
On Fri, 28 Feb 2020 at 18:34, Tom Lane wrote: > Dave Cramer writes: > > Rebased against head > > The cfbot's failing to apply this [1]. It looks like the reason is only > that you included a catversion bump in what you submitted. Protocol is to > *not* do that in submitted patches, but rely

Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly

2020-02-29 Thread Justin Pryzby
On Sat, Feb 29, 2020 at 03:35:27PM +0300, Alexey Kondratov wrote: > Anyway, new version is attached. It is rebased in order to resolve conflicts > with a recent fix of REINDEX CONCURRENTLY + temp relations, and includes > this small comment fix. Thanks for rebasing - I actually started to do that

[REPORT] Possible Memory Leak Postgres Windows

2020-02-29 Thread Ranier Vilela
Hi, I'm sending this report from DrMemory, which shows some leaks from the current postgres. DrMemory is it is a reliable tool, but it is not perfect. ( https://drmemory.org/) regards, Ranier Vilela Dr. Memory version 2.2.0 build 1 built on Jul 1 2019 00:42:20 Windows version:

Re: SLRU statistics

2020-02-29 Thread Alvaro Herrera
On 2020-Feb-29, Tomas Vondra wrote: > Did we actually remove track-enabling GUCs? I think we still have > > - track_activities > - track_counts > - track_io_timing > - track_functions > > But maybe I'm missing something? Hm I remembered we removed the one for row-level stats

Re: pgbench: option delaying queries till connections establishment?

2020-02-29 Thread Fabien COELHO
Hello Kyotaro-san, I think this also shows that "including/excluding connections establishing" as well as some of the other stats reported pretty bogus. In the 'before' case a substantial numer of the connections had not yet been established until the end of the test run! I see it useful.

Re: pgbench: option delaying queries till connections establishment?

2020-02-29 Thread Fabien COELHO
Hello Andres, Therefore I'd like to make pgbench wait till it has established all connections, before they run queries. Does anybody else see this as being useful? Yes, I think that having this behavior available would make sense. If so, should this be done unconditionally? Dunno. I

Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly

2020-02-29 Thread Alexey Kondratov
On 2020-02-11 19:48, Justin Pryzby wrote: For your v7 patch, which handles REINDEX to a new tablespace, I have a few minor comments: + * the relation will be rebuilt. If InvalidOid is used, the default => should say "currrent", not default ? Yes, it keeps current index tablespace in that

Re: SLRU statistics

2020-02-29 Thread Tomas Vondra
On Fri, Feb 28, 2020 at 08:19:18PM -0300, Alvaro Herrera wrote: On 2020-Jan-21, Tomas Vondra wrote: On Tue, Jan 21, 2020 at 05:09:33PM +0900, Masahiko Sawada wrote: > I've not tested the performance impact but perhaps we might want to > disable these counter by default and controlled by a

Re: Yet another fast GiST build (typo)

2020-02-29 Thread Erik Rijkers
On 2020-02-29 13:13, Andrey M. Borodin wrote: Hi! On 24 февр. 2020 г., at 13:50, Andrey M. Borodin wrote: Hi Thomas! Thanks for looking into this! I’ll fix your notices asap. PFA v5. Thomas, I've used your wording almost exactly with explanation how point_zorder_internal() works. It has

Re: Yet another fast GiST build

2020-02-29 Thread Andrey M. Borodin
Hi! > On 24 февр. 2020 г., at 13:50, Andrey M. Borodin wrote: > > Hi Thomas! > > Thanks for looking into this! I’ll fix your notices asap. PFA v5. Thomas, I've used your wording almost exactly with explanation how point_zorder_internal() works. It has more explanation power than my attempts

Re: BUG #15858: could not stat file - over 4GB

2020-02-29 Thread Juan José Santamaría Flecha
On Sat, Feb 29, 2020 at 9:40 AM Juan José Santamaría Flecha < juanjo.santama...@gmail.com> wrote: > On Sat, Feb 29, 2020 at 12:44 AM Tom Lane wrote: > >> >> The cfbot thinks this doesn't compile on Windows [1]. Looks like perhaps >> a missing-#include problem? > > > The define logic for

Re: proposal \gcsv

2020-02-29 Thread Pavel Stehule
so 29. 2. 2020 v 11:34 odesílatel Vik Fearing napsal: > On 29/02/2020 06:43, Pavel Stehule wrote: > > Hi > > > > I would to enhance \g command about variant \gcsv > > > > proposed command has same behave like \g, only the result will be every > > time in csv format. > > > > It can helps with

Re: proposal \gcsv

2020-02-29 Thread Vik Fearing
On 29/02/2020 06:43, Pavel Stehule wrote: > Hi > > I would to enhance \g command about variant \gcsv > > proposed command has same behave like \g, only the result will be every > time in csv format. > > It can helps with writing psql macros wrapping \g command. > > Options, notes? But then we

Re: Assert failure due to "drop schema pg_temp_3 cascade" for temporary tables and \d+ is not showing any info after drooping temp table schema

2020-02-29 Thread Michael Paquier
On Fri, Feb 28, 2020 at 07:23:38PM -0500, Tom Lane wrote: > Will push that, thanks for looking. Thanks for the commit. -- Michael signature.asc Description: PGP signature

Re: proposal: schema variables

2020-02-29 Thread Pavel Stehule
ax > CREATE TRANSACTION VARIABLE ... I change my opinion and implemented support > for > syntax CREATE IMMUTABLE VARIABLE for define constants. > second try to fix pg_dump Regards Pavel > > See attached patch > > Regards > > Pavel > > >> >> ? >> >> Regards >> >> Pavel >> >> >> schema-variables-20200229.patch.gz Description: application/gzip

Broken resetting of subplan hash tables

2020-02-29 Thread Andreas Karlsson
Hi, I looked again at one of the potential issues Ranier Vilela's static analysis found and after looking more at it I still think this one is a real bug. But my original patch was incorrect and introduced a use after free bug. The code for resetting the hash tables of the SubPlanState node

Re: Parallel copy

2020-02-29 Thread Dilip Kumar
On Wed, Feb 26, 2020 at 8:47 PM Ants Aasma wrote: > > On Tue, 25 Feb 2020 at 18:00, Tomas Vondra > wrote: > > Perhaps. I guess it'll depend on the CSV file (number of fields, ...), > > so I still think we need to do some measurements first. I'm willing to > > do that, but (a) I doubt I'll have

Re: BUG #15858: could not stat file - over 4GB

2020-02-29 Thread Juan José Santamaría Flecha
On Sat, Feb 29, 2020 at 12:44 AM Tom Lane wrote: > > The cfbot thinks this doesn't compile on Windows [1]. Looks like perhaps > a missing-#include problem? The define logic for _WIN32_WINNT includes testing of _MSC_VER, and is not a proper choice for MSVC 2013 as the cfbot is showing. Please