Re: truncating timestamps on arbitrary intervals

2020-02-25 Thread David Fetter
On Wed, Feb 26, 2020 at 10:50:19AM +0800, John Naylor wrote: > Hi, > > When analyzing time-series data, it's useful to be able to bin > timestamps into equally spaced ranges. date_trunc() is only able to > bin on a specified whole unit. Thanks for adding this very handy feature! > In the attache

Re: Identifying user-created objects

2020-02-25 Thread Masahiko Sawada
On Thu, 13 Feb 2020 at 17:13, Julien Rouhaud wrote: > > On Thu, Feb 13, 2020 at 8:32 AM Amit Langote wrote: > > > > On Thu, Feb 13, 2020 at 10:30 AM Kyotaro Horiguchi > > wrote: > > > At Mon, 10 Feb 2020 14:32:44 +0900, Amit Langote > > > wrote in > > > > Agree that ObjectIsUserObject(oid) is

Re: Resolving the python 2 -> python 3 mess

2020-02-25 Thread Andrew Dunstan
On 2/25/20 8:24 PM, Andrew Dunstan wrote: > On 2/25/20 7:08 PM, Tom Lane wrote: >> Andrew Dunstan writes: >>> On 2/25/20 5:06 PM, Tom Lane wrote: No joy there --- now that I look closer, it seems the cfbot doesn't build any of the external-language PLs on Windows. I'll have to wa

Commit fest manager for 2020-03

2020-02-25 Thread Michael Paquier
Hi all, The next commit fets is going to begin in a couple of days, and there is a total of 207 patches registered as of today. We don't have any manager yet, so is there any volunteer for taking the lead this time? Thanks, -- Michael signature.asc Description: PGP signature

Re: Some problems of recovery conflict wait events

2020-02-25 Thread Masahiko Sawada
On Tue, 18 Feb 2020 at 17:58, Masahiko Sawada wrote: > > Hi all, > > When recovery conflicts happen on the streaming replication standby, > the wait event of startup process is null when > max_standby_streaming_delay = 0 (to be exact, when the limit time > calculated by max_standby_streaming_delay

Re: [HACKERS] WAL logging problem in 9.4.3?

2020-02-25 Thread Noah Misch
On Tue, Feb 25, 2020 at 10:01:51AM +0900, Kyotaro Horiguchi wrote: > At Sat, 22 Feb 2020 21:12:20 -0800, Noah Misch wrote in > > On Fri, Feb 21, 2020 at 04:49:59PM +0900, Kyotaro Horiguchi wrote: > > > At Wed, 19 Feb 2020 17:29:08 +0900 (JST), Kyotaro Horiguchi > > > wrote in > > > > At Tue, 1

truncating timestamps on arbitrary intervals

2020-02-25 Thread John Naylor
Hi, When analyzing time-series data, it's useful to be able to bin timestamps into equally spaced ranges. date_trunc() is only able to bin on a specified whole unit. In the attached patch for the March commitfest, I propose a new function date_trunc_interval(), which can truncate to arbitrary inte

Re: Autovacuum on partitioned table

2020-02-25 Thread yuzuko
Hi, Thanks for reviewing the patch. > > We can make it work correctly but I think perhaps we can skip updating > > statistics values of partitioned tables other than n_mod_since_analyze > > as the first step. Because if we support also n_live_tup and > > n_dead_tup, user might get confused that o

Re: [PATCH] pg_upgrade: report the reason for failing to open the cluster version file

2020-02-25 Thread Michael Paquier
On Tue, Feb 25, 2020 at 11:55:06PM +, Dagfinn Ilmari Mannsåker wrote: > @@ -164,11 +164,11 @@ get_major_server_version(ClusterInfo *cluster) > snprintf(ver_filename, sizeof(ver_filename), "%s/PG_VERSION", >cluster->pgdata); > if ((version_fd = fopen(ver_filen

Re: [Proposal] Add accumulated statistics for wait event

2020-02-25 Thread Kyotaro Horiguchi
Hello. I had a brief look on this and have some comments on this. At Tue, 25 Feb 2020 07:53:26 +, "imai.yoshik...@fujitsu.com" wrote in > Thanks for Wang's mail, I noticed my 0002 patch was wrong from v3. > > Here, I attach correct patches. > > Also I will begin to do some benchmark with

Re: Resolving the python 2 -> python 3 mess

2020-02-25 Thread Andrew Dunstan
On 2/25/20 7:08 PM, Tom Lane wrote: > Andrew Dunstan writes: >> On 2/25/20 5:06 PM, Tom Lane wrote: >>> No joy there --- now that I look closer, it seems the cfbot doesn't >>> build any of the external-language PLs on Windows. I'll have to >>> wait for some reviewer to try it. >> What are the r

Re: Resolving the python 2 -> python 3 mess

2020-02-25 Thread Tom Lane
Andrew Dunstan writes: > On 2/25/20 5:06 PM, Tom Lane wrote: >> No joy there --- now that I look closer, it seems the cfbot doesn't >> build any of the external-language PLs on Windows. I'll have to >> wait for some reviewer to try it. > What are the requirements for testing? bowerbird builds wi

Re: [PATCH] pg_upgrade: report the reason for failing to open the cluster version file

2020-02-25 Thread Dagfinn Ilmari Mannsåker
Daniel Gustafsson writes: > A few lines further down from this we report an error in case we are unable to > parse the file in question: > > pg_fatal("could not parse PG_VERSION file from %s\n", > cluster->pgdata); > > Should the pgdata argument be quoted there as well, like \"%s\", to m

Re: [PATCH] pg_upgrade: report the reason for failing to open the cluster version file

2020-02-25 Thread Daniel Gustafsson
> On 26 Feb 2020, at 00:14, Dagfinn Ilmari Mannsåker wrote: > It would have saved some minutes of debugging time if that had included > the reason why the open failed, so here's a patch to do so. +1 on the attached patch. A quick skim across the similar error reportings in pg_upgrade doesn't tu

[PATCH] pg_upgrade: report the reason for failing to open the cluster version file

2020-02-25 Thread Dagfinn Ilmari Mannsåker
Hi Hackers, The other day I was helping someone with pg_upgrade on IRC, and they got a rather unhelpful error message: ERROR: could not open version file /path/to/new/cluster/PG_VERSION It would have saved some minutes of debugging time if that had included the reason why the open failed, so h

Re: Resolving the python 2 -> python 3 mess

2020-02-25 Thread Andrew Dunstan
On 2/25/20 5:06 PM, Tom Lane wrote: > I wrote: >> I set up the MSVC scripts to default to building the stub extension. >> I don't know if we really want to commit it that way, but the idea >> for the moment is to try to get the cfbot to test it on Windows. > No joy there --- now that I look close

Re: Resolving the python 2 -> python 3 mess

2020-02-25 Thread Tom Lane
I wrote: > I set up the MSVC scripts to default to building the stub extension. > I don't know if we really want to commit it that way, but the idea > for the moment is to try to get the cfbot to test it on Windows. No joy there --- now that I look closer, it seems the cfbot doesn't build any of t

Re: Ought to use heap_multi_insert() for pg_attribute/depend insertions?

2020-02-25 Thread Daniel Gustafsson
> On 25 Feb 2020, at 00:29, Andres Freund wrote: > On 2020-02-23 16:27:57 +0900, Michael Paquier wrote: >> Good catch. I would not backpatch that as it is not a live bug >> because heap_multi_insert() is not used for catalogs yet. With your >> patch, that would be the case though.. > > Thanks

[PATCH v1] Allow COPY "test" to output a header and add header matching mode to COPY FROM

2020-02-25 Thread Rémi Lapeyre
Hi, here's a new version of the patch with the header matching feature. I should apply cleanly on master, let me know if anything's wrong. --- contrib/file_fdw/input/file_fdw.source | 7 +- contrib/file_fdw/output/file_fdw.source | 13 ++-- doc/src/sgml/ref/copy.sgml | 9 ++- src/

Re: [postgis-devel] About EXTENSION from UNPACKAGED on PostgreSQL 13

2020-02-25 Thread Tom Lane
=?UTF-8?Q?Darafei_=22Kom=D1=8Fpa=22_Praliaskouski?= writes: > Removal of FROM UNPACKAGED breaks PostGIS 2.5 -> 3.0 upgrade path, and > we haven't yet found a proper replacement since such removal wasn't > something we were expecting. I'd agree with Stephen's comment: > On Tue, Feb 25, 2020 at 11

Re: [postgis-devel] About EXTENSION from UNPACKAGED on PostgreSQL 13

2020-02-25 Thread Komяpa
Hi, PostGIS 2.5 had raster and vector blended together in single extension. In PostGIS 3, they were split out into postgis and postgis_raster extensions. To upgrade, there is now postgis_extensions_upgrade() function, that unpackages the raster part out of postgis extensions, upgrades it, and pack

Re: Internal key management system

2020-02-25 Thread Cary Huang
Hi  I would like to share with you a front end patch based on kms_v4.patch that you have shared, called "kms_v4_fe.patch".  The patch integrates front end tool pg_waldump with the KMSv4 and obtain encryption and decryption cipher contexts from the KMS backend. These cipher contexts can then

Re: Resolving the python 2 -> python 3 mess

2020-02-25 Thread Tom Lane
I wrote: > Here's an updated pair of patches that attempt to fix the MSVC > scripts (pretty blindly) and provide a very simple regression test. A little *too* blindly, evidently. Try again ... regards, tom lane diff --git a/doc/src/sgml/plpython.sgml b/doc/src/sgml/plpyt

Re: Resolving the python 2 -> python 3 mess

2020-02-25 Thread Tom Lane
Here's an updated pair of patches that attempt to fix the MSVC scripts (pretty blindly) and provide a very simple regression test. I'm not too sure whether the regression test will really prove workable or not: for starters, it'll fail if "2to3" isn't available in the PATH. Perhaps there's reason

Re: [Patch] Base backups and random or zero pageheaders

2020-02-25 Thread Michael Banck
Hi, Am Dienstag, den 25.02.2020, 19:34 +0500 schrieb Asif Rehman: > On Fri, Oct 18, 2019 at 2:06 PM Michael Banck > wrote: > > Here is finally a rebased patch for the (IMO) more important issue in > > pg_basebackup. I've added a commitfest entry for this now: > > https://commitfest.postgresql.o

Re: Yet another vectorized engine

2020-02-25 Thread Konstantin Knizhnik
I have ported vectorize_engine  for zedstore (vertical table AM). Results of TPCH-10G/Q1 are the following: par.workers PG9_6 vectorize=off PG9_6 vectorize=on master vectorize=off jit=on master vectorize=off jit=off master vectorize=on jit=on master vector

Connections dropping while using Postgres backend DB with Ejabberd

2020-02-25 Thread Dipanjan Ganguly
Greetings, I was trying to use postgresql database as a backend with Ejabberd XMPP server for load test (Using TSUNG). Noticed, while using Mnesia the “simultaneous users and open TCP/UDP connections” graph in Tsung report is showing consistency, but while using Postgres, we see drop in connect

Re: Parallel copy

2020-02-25 Thread Tomas Vondra
On Sun, Feb 23, 2020 at 05:09:51PM -0800, Andres Freund wrote: Hi, On 2020-02-19 11:38:45 +0100, Tomas Vondra wrote: I generally agree with the impression that parsing CSV is tricky and unlikely to benefit from parallelism in general. There may be cases with restrictions making it easier (e.g.

[GsoC] Read/write transaction-level routing in Odyssey Project Idea

2020-02-25 Thread Kostas Chasialis
Greetings, I am a Computer Science student at National and Kapodistrian University of Athens, and I would like to be a part of this year's GsoC program. During my academic courses, I developed an interest on databases (back-end) and the main language I used during my academic career is C. A proje

Re: [Proposal] Global temporary tables

2020-02-25 Thread tushar
Hi, I have created two  global temporary tables like this - Case 1- postgres=# create global  temp table foo(n int) *with (on_c*ommit_delete_rows='true'); CREATE TABLE Case 2- postgres=# create global  temp table bar1(n int) *on c*ommit delete rows; CREATE TABLE but   if i try to do the sam

Re: pg_trigger.tgparentid

2020-02-25 Thread Amit Langote
On Tue, Feb 25, 2020 at 11:01 PM Alvaro Herrera wrote: > On 2020-Feb-25, Amit Langote wrote: > > On Tue, Feb 25, 2020 at 3:58 AM Alvaro Herrera > > wrote: > > > Thanks for pointing this out -- I agree it needed rewording. I slightly > > > adjusted your text like this: > > > > > >

Re: [Patch] Base backups and random or zero pageheaders

2020-02-25 Thread Asif Rehman
On Fri, Oct 18, 2019 at 2:06 PM Michael Banck wrote: > Hi, > > Am Samstag, den 04.05.2019, 21:50 +0900 schrieb Michael Paquier: > > On Tue, Apr 30, 2019 at 03:07:43PM +0200, Michael Banck wrote: > > > This is still an open item for the back branches I guess, i.e. zero > page > > > header for pg_v

Re: WIP/PoC for parallel backup

2020-02-25 Thread Asif Rehman
Hi, I have created a commitfest entry. https://commitfest.postgresql.org/27/2472/ On Mon, Feb 17, 2020 at 1:39 PM Asif Rehman wrote: > Thanks Jeevan. Here is the documentation patch. > > On Mon, Feb 10, 2020 at 6:49 PM Jeevan Chalke < > jeevan.cha...@enterprisedb.com> wrote: > >> Hi Asif, >> >

Re: pg_trigger.tgparentid

2020-02-25 Thread Alvaro Herrera
On 2020-Feb-25, Amit Langote wrote: > On Tue, Feb 25, 2020 at 3:58 AM Alvaro Herrera > wrote: > > Thanks for pointing this out -- I agree it needed rewording. I slightly > > adjusted your text like this: > > > > * Internal triggers require careful examination. Ideally, > > w

Re: [Proposal] Global temporary tables

2020-02-25 Thread tushar
Hi , pg_upgrade  scenario is failing if database is containing  global temporary table = centos@tushar-ldap-docker bin]$ ./psql postgres psql (13devel) Type "help" for help. postgres=# create global temporary table  t(n int); CREATE TABLE postgres=# \q

Re: [Proposal] Global temporary tables

2020-02-25 Thread Pavel Stehule
út 25. 2. 2020 v 14:36 odesílatel Prabhat Sahu < prabhat.s...@enterprisedb.com> napsal: > Hi All, > > Please check the below findings on GTT. > *-- Scenario 1:* > Under "information_schema", We are not allowed to create "temporary > table", whereas we can CREATE/DROP "Global Temporary Table", is i

Re: [Proposal] Global temporary tables

2020-02-25 Thread Prabhat Sahu
Hi All, Please check the below findings on GTT. *-- Scenario 1:* Under "information_schema", We are not allowed to create "temporary table", whereas we can CREATE/DROP "Global Temporary Table", is it expected ? postgres=# create temporary table information_schema.temp1(c1 int); ERROR: cannot cre

Re: ALTER TABLE ... SET STORAGE does not propagate to indexes

2020-02-25 Thread Kuntal Ghosh
On Tue, Feb 25, 2020 at 1:09 PM Peter Eisentraut wrote: > > On 2020-02-24 12:21, Kuntal Ghosh wrote: > > I've reproduced the issue on head. And, the patch seems to solve the > > problem. The patch looks good to me. But, I've a small doubt regarding > > the changes in test_decoding regression file.

Re: RS_EPHEMERAL vs RS_TEMPORARY

2020-02-25 Thread Antonin Houska
Peter Eisentraut wrote: > On 2020-02-25 08:30, Antonin Houska wrote: > > I'm trying to figure out what's specific about RS_EPHEMERAL and RS_TEMPORARY > > slot kinds. The following comment (see definition of the > > ReplicationSlotPersistency enumeration) tells when each kind is dropped > > The g

Re: Error on failed COMMIT

2020-02-25 Thread Laurenz Albe
On Tue, 2020-02-25 at 13:25 +0530, Robert Haas wrote: > On Tue, Feb 25, 2020 at 12:47 PM Vladimir Sitnikov > wrote: > > Noone suggested that "commit leaves the session in a transaction state". > > Of course, every commit should terminate the transaction. > > However, if a commit fails (for any rea

Re: [Patch] pg_rewind: options to use restore_command from recovery.conf or command line

2020-02-25 Thread Alexander Korotkov
On Sat, Feb 1, 2020 at 2:16 AM Alexey Kondratov wrote: > New version is attached. Do you have any other comments or objections? Now patch looks much better. Thanks to Michael Paquier for review. I've just revised commit message reflecting we've removed one of the new options. But I have followi

Re: Yet another vectorized engine

2020-02-25 Thread Konstantin Knizhnik
On 25.02.2020 11:06, Hubert Zhang wrote: Hi Konstantin, I checkout your branch pg13 in repo https://github.com/zhangh43/vectorize_engine After I fixed some compile error, I tested Q1 on TPCH-10G The result is different from yours and vectorize version is too slow. Note that I disable parall

Re: SPI Concurrency Precautions? Problems with Parallel Execution of Multiple CREATE TABLE statements

2020-02-25 Thread Robert Haas
On Sat, Feb 22, 2020 at 5:50 AM Tom Mercha wrote: > I am spawning a number of dynamic background workers to execute each > statement. When I spawn 4 workers on a quad-core machine, the resutling > execution time per statement is {0.158s, 0.216s, 0.399s, 0.396s}. > However, when I have just one wor

Re: [Proposal] Add accumulated statistics for wait event

2020-02-25 Thread 王胜利
Thank you for this update! I will try it. Best regards, Victor wang | | 王胜利 | | 邮箱:atti...@126.com | 签名由 网易邮箱大师 定制 On 02/25/2020 15:53, imai.yoshik...@fujitsu.com wrote: On Fri, Feb 14, 2020 at 11:59 AM, 王胜利 wrote: >I am glad to know you are working on PG accumulated statistics > feat

Re: progress reporting views and TimestampTz fields

2020-02-25 Thread Vik Fearing
On 25/02/2020 09:13, Fujii Masao wrote: > Hi, > > I'm thinking to change the progress reporting views like > pg_stat_progress_vacuum so that they also report the time when > the target command was started and the time when the phase was > last changed. IMO this is very helpful to estimate the rema

Re: Error on failed COMMIT

2020-02-25 Thread Vladimir Sitnikov
Tom>I think we still end up concluding that altering this behavior has more Tom>downside than upside. What is the downside? Applications, drivers, and poolers already expect that commit might produce an error and terminate the transaction at the same time. "The data is successfully committed to

Re: plan cache overhead on plpgsql expression

2020-02-25 Thread Amit Langote
Hi Pavel, On Tue, Feb 25, 2020 at 4:16 PM Pavel Stehule wrote: > > Hi > > I added this patch to a commitfest > > https://commitfest.postgresql.org/27/2467/ > > It is very interesting speedup and it is in good direction to JIT expressions Thank you. I was planning to do that myself. I will take

Define variables in the approprieate scope

2020-02-25 Thread Antonin Houska
I've noticed that two variables in RelationCopyStorage() are defined in a scope higher than necessary. Please see the patch. -- Antonin Houska Web: https://www.cybertec-postgresql.com diff --git a/src/backend/catalog/storage.c b/src/backend/catalog/storage.c index fddfbf1d8c..14d170823f 100644 -

progress reporting views and TimestampTz fields

2020-02-25 Thread Fujii Masao
Hi, I'm thinking to change the progress reporting views like pg_stat_progress_vacuum so that they also report the time when the target command was started and the time when the phase was last changed. IMO this is very helpful to estimate the remaining time required to complete the current phase.

Re: Yet another vectorized engine

2020-02-25 Thread Hubert Zhang
Hi Konstantin, I checkout your branch pg13 in repo https://github.com/zhangh43/vectorize_engine After I fixed some compile error, I tested Q1 on TPCH-10G The result is different from yours and vectorize version is too slow. Note that I disable parallel worker by default. no JIT no Vectorize: 36 s

Re: RS_EPHEMERAL vs RS_TEMPORARY

2020-02-25 Thread Peter Eisentraut
On 2020-02-25 08:30, Antonin Houska wrote: I'm trying to figure out what's specific about RS_EPHEMERAL and RS_TEMPORARY slot kinds. The following comment (see definition of the ReplicationSlotPersistency enumeration) tells when each kind is dropped The general idea is that an "ephemeral" slot i