Re: Pluggable Storage - Andres's take

2018-10-23 Thread Haribabu Kommi
On Tue, Oct 23, 2018 at 5:49 PM Haribabu Kommi wrote: > I am able to generate the simple test and found the problem. The issue > with the following > SQL. > > SELECT * >INTO TABLE xacttest >FROM aggtest; > > During the processing of the above query, the tuple that is selected from > the a

Re: libpq host/hostaddr/conninfo inconsistencies

2018-10-23 Thread Fabien COELHO
Hello Arthur, sh> psql "host=127.0.0.2 hostaddr=127.0.0.1" I'm not sure that is is the issue. User defined the host name and psql show it. The issue is that "host" is an ip, "\conninfo" will inform wrongly that you are connected to "127.0.0.2", but the actual connection is really to "127.

Re: Function to promote standby servers

2018-10-23 Thread Laurenz Albe
Michael Paquier wrote: > If there are no > objections, I'll look at this patch again by the end of this week in > order to get it committed. No objections from me; on the contrary, I would like to thank you for your effort here. I appreciate that you probably spent more time tutoring me than it w

Re: pgbench - add pseudo-random permutation function

2018-10-23 Thread Hironobu SUZUKI
Hello, > Also, the alternate implementation should not change the result, so > something looks amiss in your version. Moreover, I'm unclear how to > implement an overflow multiply with the safe no overflow version. (snip) I made an honest mistake. I had assumed the modulo number of Knuth's LCG

Re: Making all nbtree entries unique by having heap TIDs participate in comparisons

2018-10-23 Thread Andrey Lepikhov
On 19.10.2018 0:54, Peter Geoghegan wrote: I would welcome any theories as to what could be the problem here. I'm think that this is fixable, since the picture for the patch is very positive, provided you only focus on bgwriter/checkpoint activity and on-disk sizes. It seems likely that there

Re: Buildfarm failures for hash indexes: buffer leaks

2018-10-23 Thread Amit Kapila
On Mon, Oct 22, 2018 at 1:42 PM Fabien COELHO wrote: > > Hello Michaël, > > > The first failure is unrelated to the involved commits, as they touched > > completely different areas of the code: > > INSERT INTO hash_split_heap SELECT a/2 FROM generate_series(1, 25000) a; > > + WARNING: buffer ref

Re: Buildfarm failures for hash indexes: buffer leaks

2018-10-23 Thread Tom Lane
Amit Kapila writes: > On Mon, Oct 22, 2018 at 1:42 PM Fabien COELHO wrote: >> Both animals use gcc experimental versions, which may rather underline a >> new bug in gcc head rather than an existing issue in pg. Or not. > It is possible, but what could be the possible theory? It seems like the t

[PATCH] Tab complete EXECUTE FUNCTION for CREATE (EVENT) TRIGGER

2018-10-23 Thread Dagfinn Ilmari Mannsåker
Hi hackers, The last-minute change for CREATE (EVENT) TRIGGER to accept EXECUTE FUNCTION as well as EXECUTE PROCEDURE did not update the tab completion in psql to match. Please find attached two patches that do this for CREATE TRIGGER and CREATE EVENT TRIGGER, respectively. To keep the duplicati

Re: Buildfarm failures for hash indexes: buffer leaks

2018-10-23 Thread Fabien COELHO
Hello Tom & Amit, Both animals use gcc experimental versions, which may rather underline a new bug in gcc head rather than an existing issue in pg. Or not. It is possible, but what could be the possible theory? It seems like the two feasible theories are (1) gcc bug, or (2) buffer leak th

Re: BUG #15448: server process (PID 22656) was terminated by exception 0xC0000005

2018-10-23 Thread Andrew Dunstan
On 10/22/2018 10:00 PM, Amit Langote wrote: After observing the test case in the provided log, I managed to reproduce it with the following: create table foo (a int primary key, b int); create table bar (a int references foo on delete cascade, b int); insert into foo values (1, 1); insert int

Re: [PATCH] Tab complete EXECUTE FUNCTION for CREATE (EVENT) TRIGGER

2018-10-23 Thread Dagfinn Ilmari Mannsåker
ilm...@ilmari.org (Dagfinn Ilmari Mannsåker) writes: > Hi hackers, > > The last-minute change for CREATE (EVENT) TRIGGER to accept EXECUTE > FUNCTION as well as EXECUTE PROCEDURE did not update the tab completion > in psql to match. Please find attached two patches that do this for > CREATE TRIGG

Re: BUG #15449: file_fdw using program cause exit code error when using LIMIT

2018-10-23 Thread Tom Lane
I wrote: > =?utf-8?q?PG_Bug_reporting_form?= writes: >> SELECT * FROM test_file_fdw_program_limit LIMIT 0; >> /* >> [38000] ERROR: program "echo "test"" failed Detail: child process exited >> with exit code 1 >> */ > Yeah, I can reproduce this on macOS as well as Linux. Capturing stderr > shows

Re: WAL archive (archive_mode = always) ?

2018-10-23 Thread Jeff Janes
On Mon, Oct 22, 2018 at 5:06 AM Adelino Silva < adelino.j.si...@googlemail.com> wrote: > Hello Takayuki, > > Sorry can you explain how we can same network bandwidth by not sending the > WAL archive from the primary to the standby(s). > I possible scenario is have to multiple standby servers in sam

Re: [HACKERS] proposal: schema variables

2018-10-23 Thread Erik Rijkers
[schema-variables-20181007-01.patch.gz] Hi, I tried to test your schema-variables patch but got stuck here instead (after applying succesfully on top of e6f5d1acc): make[2]: *** No rule to make target '../../../src/include/catalog/pg_variable.h', needed by 'bki-stamp'. Stop. make[1]: ***

Re: removing unnecessary get_att*() lsyscache functions

2018-10-23 Thread Peter Eisentraut
On 23/10/2018 02:11, Michael Paquier wrote: > On Mon, Oct 22, 2018 at 07:12:28PM +0200, Peter Eisentraut wrote: >> OK, slightly reworked version attached. > > + attTup = (Form_pg_attribute) GETSTRUCT(tuple); > attnum = ((Form_pg_attribute) GETSTRUCT(tuple))->attnum; > > No need to call twic

Re: Making all nbtree entries unique by having heap TIDs participate in comparisons

2018-10-23 Thread Peter Geoghegan
On Tue, Oct 23, 2018 at 11:35 AM Andrey Lepikhov wrote: > I have same problem with background heap & index cleaner (based on your > patch). In this case the bottleneck is WAL-record which I need to write > for each cleaned block and locks which are held during the WAL-record > writing process. Pa

Remove obsolete pg_attrdef.adsrc column

2018-10-23 Thread Peter Eisentraut
I propose the attached patch to remove the long-unused catalog column pg_attrdef.adsrc. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services From df811a76e026be395a4309a1f0de75540dae5b11 Mon Sep 17 00:00:00 2001 From: P

Re: WIP: Avoid creation of the free space map for small tables

2018-10-23 Thread John Naylor
I wrote: > Once this is in shape, I'll do some performance testing. On second thought, there's no point in waiting, especially if a regression points to a design flaw. I compiled patched postgres with HEAP_FSM_CREATION_THRESHOLD set to 32, then ran the attached script which populates 100 tables

Re: BUG #15448: server process (PID 22656) was terminated by exception 0xC0000005

2018-10-23 Thread Amit Langote
Hi, On Tue, Oct 23, 2018 at 8:46 PM Andrew Dunstan wrote: > On 10/22/2018 10:00 PM, Amit Langote wrote: > > After observing the test case in the provided log, I managed to reproduce > > it with the following: > > > > create table foo (a int primary key, b int); > > create table bar (a int referen

Re: Regarding query minimizer (simplifier)

2018-10-23 Thread Jung, Jinho
Hello Tom, Sorry for the misleading. Could you try these two queries? I made the query even slower in latest version of postgres. These are information about how we set up evaluation environment and query result. Thanks, Jinho Jung Install Multiple version of DBs in one machine ==

None-reentrant function call in signal handler startup_die()

2018-10-23 Thread samuel.coulee
Hi, I found that in the PG source code function BackendInitialize(), handler for SIGTERM was set to be startup_die(). And in startup_die(), we simply call proc_exit to exit the process. What's more, early in BackendInitialize() function, we called pq_init to setup socket_close() as a process ex

Re: Buildfarm failures for hash indexes: buffer leaks

2018-10-23 Thread Andres Freund
On 2018-10-23 13:54:31 +0200, Fabien COELHO wrote: > > Hello Tom & Amit, > > > > > Both animals use gcc experimental versions, which may rather underline a > > > > new bug in gcc head rather than an existing issue in pg. Or not. > > > > > It is possible, but what could be the possible theory? >

Re: Pull up sublink of type 'NOT NOT (expr)'

2018-10-23 Thread Alexey Bashtanov
Hello Richard, Currently for quals in the form of "NOT NOT (SubLink)", this SubLink would not be considered when pulling up sublinks. For instance: gpadmin=# explain select * from a where NOT NOT (a.i in (select b.i from b));      QUERY PLAN --

Postgres older version 8.3.7 on ubuntu 14

2018-10-23 Thread Vaidyanathaswamy, Anandsaikrishnan
Good Morning, We have older version of postgres 8.3.7, I am trying to install postgres on ubuntu 14.04 LTS under GCP instance, Im having difficulty in installating the postgres 8.3.7 . We are not able proceed with the installation manually. I am wondering whether ubuntu 14 is compatible with

Re: Postgres older version 8.3.7 on ubuntu 14

2018-10-23 Thread Steve Crawford
On Tue, Oct 23, 2018 at 10:08 AM Vaidyanathaswamy, Anandsaikrishnan < avaidyanathasw...@corelogic.com> wrote: > Good Morning, > > > > We have older version of postgres 8.3.7, I am trying to install postgres > on ubuntu 14.04 LTS under GCP instance, Im having difficulty in > installating the postg

Re: Postgres older version 8.3.7 on ubuntu 14

2018-10-23 Thread Chapman Flack
On 10/23/18 13:15, Steve Crawford wrote: > On Tue, Oct 23, 2018 at 10:08 AM Vaidyanathaswamy, Anandsaikrishnan < > avaidyanathasw...@corelogic.com> wrote: >> We are not able proceed with the installation manually. I am wondering >> whether ubuntu 14 is compatible with version 8.3.7 ... > First, I

Re: [HACKERS] proposal: schema variables

2018-10-23 Thread Pavel Stehule
target 'submake-catalog-headers' failed > src/Makefile.global:370: recipe for target 'submake-generated-headers' > failed > > Unfortunately previous patch was completely broken. I am sorry Please, check this patch. Regards Pavel > thanks, > > Erik Rijkers > schema-variables-20181023-01.patch.gz Description: application/gzip

Re: Remove obsolete pg_attrdef.adsrc column

2018-10-23 Thread Alvaro Herrera
On 2018-Oct-23, Peter Eisentraut wrote: > I propose the attached patch to remove the long-unused catalog column > pg_attrdef.adsrc. +1, looks good. I think this change has been waiting for a very long time -- documented as useless by 81c41e3d0ed3 (Jan 2005, general doc copy-edit, a paragraph you

Re: Postgres older version 8.3.7 on ubuntu 14

2018-10-23 Thread Chapman Flack
On 10/23/18 1:51 PM, Vaidyanathaswamy, Anandsaikrishnan wrote: > configure: error: readline library not found > If you have readline already installed, see config.log for details on the > failure. It is possible the compiler isn't looking in the proper directory. > Use --without-readline to disab

Re: Remove obsolete pg_attrdef.adsrc column

2018-10-23 Thread Daniel Gustafsson
> On 23 Oct 2018, at 15:17, Peter Eisentraut > wrote: > > I propose the attached patch to remove the long-unused catalog column > pg_attrdef.adsrc. +1, I ran into a bug in an app as recently as today where adsrc was used instead of pg_get_expr(). Patch looks good. I probably would’ve opted fo

RE: Postgres older version 8.3.7 on ubuntu 14

2018-10-23 Thread Vaidyanathaswamy, Anandsaikrishnan
Thank you so much for your prompt reply, Background on this, We have postgres same version for the past 12 years with 8.3.7, We are moving to cloud GCP To start with testing the 8.3.7 on ubuntu 14.04 LTS version, I am finding difficulty in installing the 8.3.7 version, Here is the latest error

GOOGLE CODE-IN 2018

2018-10-23 Thread ScienceMadeEasy poorva shukla
Hello, I am extremely excited to be part of PostgreSQL... Every task seems to be exciting! I have basic knowledge of SQL and am thinking of being part of your organization's tasks. Thankyou. Yours faithfully, PMS

Log timestamps at higher resolution

2018-10-23 Thread David Fetter
Folks, Per gripes I've been hearing with increasing frequency, please find attached a patch that implements $Subject. It's microsecond resolution because at least at the moment, nanosecond resolution doesn't appear to be helpful in this context. Best, David. -- David Fetter http://fetter.org/ P

Re: Log timestamps at higher resolution

2018-10-23 Thread Thomas Munro
On Wed, Oct 24, 2018 at 7:51 AM David Fetter wrote: > Per gripes I've been hearing with increasing frequency, please find > attached a patch that implements $Subject. It's microsecond resolution > because at least at the moment, nanosecond resolution doesn't appear > to be helpful in this context.

Re: Log timestamps at higher resolution

2018-10-23 Thread David Fetter
On Wed, Oct 24, 2018 at 08:00:24AM +1300, Thomas Munro wrote: > On Wed, Oct 24, 2018 at 7:51 AM David Fetter wrote: > > Per gripes I've been hearing with increasing frequency, please find > > attached a patch that implements $Subject. It's microsecond resolution > > because at least at the moment,

Re: Log timestamps at higher resolution

2018-10-23 Thread Alvaro Herrera
On 2018-Oct-23, David Fetter wrote: > On Wed, Oct 24, 2018 at 08:00:24AM +1300, Thomas Munro wrote: > > On Wed, Oct 24, 2018 at 7:51 AM David Fetter wrote: > > > Per gripes I've been hearing with increasing frequency, please find > > > attached a patch that implements $Subject. It's microsecond r

Re: Regarding query minimizer (simplifier)

2018-10-23 Thread Jinho Jung
Hello, We appreciate you taking time for test! When we do more evaluation, we noticed that the previously attached query made regression only on DBs that we installed from APT manager (i.e., apt-get command) not on DBs that we built from the source code. But we also confirmed that there are many c

Re: Regarding query minimizer (simplifier)

2018-10-23 Thread Jinho Jung
*Order is reversed. * *1.sql* 9.4.19: 20ms 10.5 : 1,227ms *4.sql* 9.4.19: 13ms 10.5 : 88,721ms *20.sql* 9.4.19: 271ms 10.5 : 6,104ms *22.sql* 9.4.19: 8ms 10.5 : 105ms On Tue, Oct 23, 2018 at 3:15 PM Jinho Jung wrote: > Hello, > > We appreciate you taking time for test! When we do mor

Re: Log timestamps at higher resolution

2018-10-23 Thread David Fetter
On Tue, Oct 23, 2018 at 04:14:50PM -0300, Alvaro Herrera wrote: > On 2018-Oct-23, David Fetter wrote: > > > On Wed, Oct 24, 2018 at 08:00:24AM +1300, Thomas Munro wrote: > > > On Wed, Oct 24, 2018 at 7:51 AM David Fetter wrote: > > > > Per gripes I've been hearing with increasing frequency, pleas

Re: [PATCH] Tab complete EXECUTE FUNCTION for CREATE (EVENT) TRIGGER

2018-10-23 Thread Michael Paquier
On Tue, Oct 23, 2018 at 12:26:35PM +0100, Dagfinn Ilmari Mannsåker wrote: > The last-minute change for CREATE (EVENT) TRIGGER to accept EXECUTE > FUNCTION as well as EXECUTE PROCEDURE did not update the tab completion > in psql to match. Please find attached two patches that do this for > CREATE T

Re: Log timestamps at higher resolution

2018-10-23 Thread Michael Paquier
On Wed, Oct 24, 2018 at 12:11:18AM +0200, David Fetter wrote: > That's an interesting point. pgbadger is the only one I recall using > that's still maintained. Which others would it be useful to test? There could be private solutions as well. My take is that we should use separate letters and no

Re: Buildfarm failures for hash indexes: buffer leaks

2018-10-23 Thread Michael Paquier
On Tue, Oct 23, 2018 at 07:50:57AM -0700, Andres Freund wrote: > FWIW, my animal 'serinus', which runs debian's gcc-snapshot shows the same > problem: > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=serinus&dt=2018-10-22%2006%3A34%3A02 > > So it seems much more likely to be 1). Thanks

Re: Function to promote standby servers

2018-10-23 Thread Michael Paquier
On Tue, Oct 23, 2018 at 09:42:16AM +0200, Laurenz Albe wrote: > No objections from me; on the contrary, I would like to thank you for > your effort here. I appreciate that you probably spent more time > tutoring me than it would have taken you to write this yourself. You're welcome. Happy that i

Re: [HACKERS] Transactions involving multiple postgres foreign servers, take 2

2018-10-23 Thread Masahiko Sawada
On Tue, Oct 23, 2018 at 12:54 PM Kyotaro HORIGUCHI wrote: > > Hello. > > # It took a long time to come here.. > > At Fri, 19 Oct 2018 21:38:35 +0900, Masahiko Sawada > wrote in > > On Wed, Oct 10, 2018 at 1:34 PM Masahiko Sawada > > wrote: > ... > > * Updated docs, added the new section "Dist

Unordered wait event ClogGroupUpdate

2018-10-23 Thread Michael Paquier
Hi all, baaf272 has added support for group updates in clog, however it has added the wait event WAIT_EVENT_CLOG_GROUP_UPDATE in a non-alphabetical order. There are many events, so keeping things in order helps users in finding them. Are there any objections to the attached, which reorders thing

Re: Optimze usage of immutable functions as relation

2018-10-23 Thread Kyotaro HORIGUCHI
Hello. # It might be better that you provided self-contained test case. As the discussion between Heikki and Tom just upthread, it would be doable but that usage isn't typical. The query would be normally written as followings and they are transformed as desired. select '|'||subject||'|', ts_ran

Re: Log timestamps at higher resolution

2018-10-23 Thread David Fetter
On Wed, Oct 24, 2018 at 08:46:47AM +0900, Michael Paquier wrote: > On Wed, Oct 24, 2018 at 12:11:18AM +0200, David Fetter wrote: > > That's an interesting point. pgbadger is the only one I recall using > > that's still maintained. Which others would it be useful to test? > > There could be privat

Re: [PATCH] Tab complete EXECUTE FUNCTION for CREATE (EVENT) TRIGGER

2018-10-23 Thread David Fetter
On Wed, Oct 24, 2018 at 08:43:05AM +0900, Michael Paquier wrote: > On Tue, Oct 23, 2018 at 12:26:35PM +0100, Dagfinn Ilmari Mannsåker wrote: > > The last-minute change for CREATE (EVENT) TRIGGER to accept EXECUTE > > FUNCTION as well as EXECUTE PROCEDURE did not update the tab completion > > in psq

Re: Unordered wait event ClogGroupUpdate

2018-10-23 Thread Kuntal Ghosh
On Wed, Oct 24, 2018 at 5:56 AM Michael Paquier wrote: > baaf272 has added support for group updates in clog, however it has > added the wait event WAIT_EVENT_CLOG_GROUP_UPDATE in a non-alphabetical > order. There are many events, so keeping things in order helps users in > finding them. That's a

Re: Restore CurrentUserId only if 'prevUser' is valid when abort transaction

2018-10-23 Thread Michael Paquier
On Tue, Oct 23, 2018 at 02:40:30PM +0900, Michael Paquier wrote: > Actually, as StartSubTransaction also switches to TRANS_START for a > savepoint, if there is an error until the state is switched to > TRANS_INPROGRESS then the code would fail to switch back to > CurrentUserId even if it is set, an

Re: Unordered wait event ClogGroupUpdate

2018-10-23 Thread Michael Paquier
On Wed, Oct 24, 2018 at 10:25:37AM +0530, Kuntal Ghosh wrote: > That's a valid argument. Additionally, I've found > WAIT_EVENT_HASH_GROW_BUCKETS_ALLOCATING and > WAIT_EVENT_HASH_GROW_BATCHES_ALLOCATING are added in a > non-alphabetical order in WaitEventIPC enum. Indeed, thanks for double-checking

Re: Unordered wait event ClogGroupUpdate

2018-10-23 Thread Kuntal Ghosh
On Wed, Oct 24, 2018 at 10:48 AM Michael Paquier wrote: > > That's a valid argument. Additionally, I've found > > WAIT_EVENT_HASH_GROW_BUCKETS_ALLOCATING and > > WAIT_EVENT_HASH_GROW_BATCHES_ALLOCATING are added in a > > non-alphabetical order in WaitEventIPC enum. > And those ones are also incorr

Re: More issues with pg_verify_checksums and checksum verification in base backups

2018-10-23 Thread Michael Paquier
On Sun, Oct 21, 2018 at 08:56:32PM -0400, Stephen Frost wrote: > All of this pie-in-the-sky about what pluggable storage might have is > just hand-waving, in my opinion, and not worth much more than that. I > hope (and suspect..) that the actual pluggable storage that's being > worked on doesn't d