Re: [RFC] Add an until-0 loop in psql

2018-04-27 Thread Corey Huinker
>> What you don't see here is that you're using your psql process's >> available open file handles as a stack, and when you hit that limit psql >> will fail. If you remove that limit, then you get a bit further before psql >> segfaults on you. I think I got ~2700 files deep before that happened.

Re: GSoC 2018: Sorting Algorithm and Benchmarking

2018-04-27 Thread Atri Sharma
+1 For Slack On Sat, 28 Apr 2018, 09:52 Andrey Borodin, wrote: > > > > 27 апр. 2018 г., в 23:23, Kefan Yang написал(а): > > > > I think Slack would be great for our communication > > Here's Slack invite app http://postgres-slack.herokuapp.com/ >

Re: [RFC] Add an until-0 loop in psql

2018-04-27 Thread Pavel Stehule
Hi 2018-04-27 21:40 GMT+02:00 Corey Huinker : > As of v11, DO blocks can do transactions. I think this will meet your > needs. > > A loop that starts at point X in the code and terminates at point Y has to > know how to jump back in the file (if there even is a file!) to

Fix some trivial issues of the document/comment

2018-04-27 Thread ZHUO QL (KDr2)
I'm learning PGSQL and reading the source, and find few trivial issues in the docs: - doc of catalogs: table 'pg_replication_origin' is a shared relation  but is not mentioned in the doc. - README of mmgr: make variable names consistent. - trivial error fix in the comment of block.h: 

Re: GSoC 2018: Sorting Algorithm and Benchmarking

2018-04-27 Thread Andrey Borodin
> 27 апр. 2018 г., в 23:23, Kefan Yang написал(а): > > I think Slack would be great for our communication Here's Slack invite app http://postgres-slack.herokuapp.com/ Should we create a channel for this project? Best regards, Andrey Borodin.

Re: Is a modern build system acceptable for older platforms

2018-04-27 Thread Yuriy Zhuravlev
> > Makefiles generated by automake are more feature rich in general, > which is understandable as its the only backend it has to support. The main problem here - Postrges do not use automake at all! Postgres it's autoconf + handmade GNU Make files + perl script for generating old MSVC project

Re: Remove mention in docs that foreign keys on partitioned tables are not supported

2018-04-27 Thread David Rowley
On 26 April 2018 at 21:03, Amit Langote wrote: > I noticed also that the item regarding row triggers might be obsolete as > of 86f575948c7, thanks again to Alvaro! So, I updated your patch to take > care of that. Thanks. I walked right past that one. -- David

Re: "could not reattach to shared memory" on buildfarm member dory

2018-04-27 Thread Tom Lane
Noah Misch writes: > On Tue, Apr 24, 2018 at 11:37:33AM +1200, Thomas Munro wrote: >> Maybe try asking what's mapped there with VirtualQueryEx() on failure? > +1. An implementation of that: >

Re: Postgres, fsync, and OSs (specifically linux)

2018-04-27 Thread Andres Freund
On 2018-04-27 19:38:30 -0400, Bruce Momjian wrote: > On Fri, Apr 27, 2018 at 04:10:43PM -0700, Andres Freund wrote: > > Hi, > > > > On 2018-04-27 19:04:47 -0400, Bruce Momjian wrote: > > > On Fri, Apr 27, 2018 at 03:28:42PM -0700, Andres Freund wrote: > > > > - We need more aggressive error

Re: Postgres, fsync, and OSs (specifically linux)

2018-04-27 Thread Bruce Momjian
On Fri, Apr 27, 2018 at 04:10:43PM -0700, Andres Freund wrote: > Hi, > > On 2018-04-27 19:04:47 -0400, Bruce Momjian wrote: > > On Fri, Apr 27, 2018 at 03:28:42PM -0700, Andres Freund wrote: > > > - We need more aggressive error checking on close(), for ENOSPC and > > > EIO. In both cases

Re: FinishPreparedTransaction missing HOLD_INTERRUPTS section

2018-04-27 Thread Michael Paquier
On Sat, Apr 28, 2018 at 12:36:16AM +0300, Stas Kelvich wrote: > It seems that during COMMIT PREPARED FinishPreparedTransaction() doesn't > hold interrupts around writing to wal and cleaning up ProcArray and GXact > entries. At least RemoveTwoPhaseFile (which is called in between) can print > a

Re: Postgres, fsync, and OSs (specifically linux)

2018-04-27 Thread Andres Freund
Hi, On 2018-04-27 19:04:47 -0400, Bruce Momjian wrote: > On Fri, Apr 27, 2018 at 03:28:42PM -0700, Andres Freund wrote: > > - We need more aggressive error checking on close(), for ENOSPC and > > EIO. In both cases afaics we'll have to trigger a crash recovery > > cycle. It's entirely

Re: Postgres, fsync, and OSs (specifically linux)

2018-04-27 Thread Bruce Momjian
On Fri, Apr 27, 2018 at 03:28:42PM -0700, Andres Freund wrote: > - We need more aggressive error checking on close(), for ENOSPC and > EIO. In both cases afaics we'll have to trigger a crash recovery > cycle. It's entirely possible to end up in a loop on NFS etc, but I > don't think there's

Postgres, fsync, and OSs (specifically linux)

2018-04-27 Thread Andres Freund
Hi, I thought I'd send this separately from [0] as the issue has become more general than what was mentioned in that thread, and it went off into various weeds. I went to LSF/MM 2018 to discuss [0] and related issues. Overall I'd say it was a very productive discussion. I'll first try to recap

FinishPreparedTransaction missing HOLD_INTERRUPTS section

2018-04-27 Thread Stas Kelvich
Hello. It seems that during COMMIT PREPARED FinishPreparedTransaction() doesn't hold interrupts around writing to wal and cleaning up ProcArray and GXact entries. At least RemoveTwoPhaseFile (which is called in between) can print a warning with ereport(), which, in turn will check for interrupts

Re: Goodbye pg_pltemplate, hello trusted extensions

2018-04-27 Thread Tom Lane
Andres Freund writes: > On 2018-04-27 16:34:04 -0400, Tom Lane wrote: >> So I thought for awhile about how to deal with that, and eventually >> decided that really what we need to do is solve this as part of the >> extension mechanism, not CREATE LANGUAGE per se. What I'm

Re: Goodbye pg_pltemplate, hello trusted extensions

2018-04-27 Thread Andres Freund
Hi, On 2018-04-27 16:34:04 -0400, Tom Lane wrote: > So I thought for awhile about how to deal with that, and eventually > decided that really what we need to do is solve this as part of the > extension mechanism, not CREATE LANGUAGE per se. What I'm imagining > is that we add new option(s) to

Re: Built-in connection pooling

2018-04-27 Thread Merlin Moncure
On Fri, Apr 27, 2018 at 11:44 AM, Konstantin Knizhnik wrote: > > > On 27.04.2018 18:33, Merlin Moncure wrote: >> On Fri, Apr 27, 2018 at 10:05 AM, Konstantin Knizhnik >> wrote: >>> On 27.04.2018 16:49, Merlin Moncure wrote: >> I'm confused

Goodbye pg_pltemplate, hello trusted extensions

2018-04-27 Thread Tom Lane
Over in the thread about python versions there was some mention of getting rid of the pg_pltemplate system catalog in favor of putting all the info about a procedural language into its extension script. This has been discussed before, and it'd be a very good thing to do because it would allow

Re: Issues while building PG in MS Windows, using MSYS2 and MinGW-w64

2018-04-27 Thread legrand legrand
Hello, as a complement: I used MSYS2 and MinGW-w64 to build version 11devel from https://www.postgresql.org/ftp/snapshot/dev/ on my win 7 64 bit desktop. What I remember is that I found good advices in

Re: [RFC] Add an until-0 loop in psql

2018-04-27 Thread Corey Huinker
As of v11, DO blocks can do transactions. I think this will meet your needs. A loop that starts at point X in the code and terminates at point Y has to know how to jump back in the file (if there even is a file!) to point X and re-interpret commands as it makes it's way back through the "file"

RE: GSoC 2018: Sorting Algorithm and Benchmarking

2018-04-27 Thread Kefan Yang
Thank you for the feedback! I think Slack would be great for our communication From: Andrey Borodin Sent: April 26, 2018 11:38 PM To: Kefan Yang Cc: PostgreSQL Hackers; Atri Sharma Subject: Re: GSoC 2018: Sorting Algorithm and Benchmarking Hi! > 26 апр. 2018 г., в 0:12, Kefan Yang

RE: GSoC 2018: Sorting Algorithm and Benchmarking

2018-04-27 Thread Kefan Yang
Hey, This executable should read a config file (path to sorting routines, test data size etc.), perform tests on different sorting routines, and output the result. Kefan From: Robert Haas Sent: April 26, 2018 11:53 AM To: Kefan Yang Cc: Andrey Borodin; PostgreSQL Hackers Subject: Re: GSoC

Re: Toast issues with OldestXmin going backwards

2018-04-27 Thread Robert Haas
On Fri, Apr 27, 2018 at 11:35 AM, Andrew Gierth wrote: >> "Robert" == Robert Haas writes: > Robert> One idea that occurred to me is to somehow record -- I guess in > Robert> pg_class using non-transactional updates -- the last cutoff XID

Re: obsoleting plpython2u and defaulting plpythonu to plpython3u

2018-04-27 Thread Andres Freund
On 2018-04-27 13:34:58 -0400, Tom Lane wrote: > Yeah, there's a separate set of questions about what happens during > pg_upgrade of a database containing the existing plpythonu extension. > > You could imagine hacking the dump/reload case by defining plpythonu > as an empty extension with a

Re: obsoleting plpython2u and defaulting plpythonu to plpython3u

2018-04-27 Thread Tom Lane
Andres Freund writes: > Another alternative would be to have a 'plpython' extension that depends > on plpython2. That'd require users to specify CASCADE when creating it, > but that actually seems like it could be a useful hint... I think it's > probably not worth going that

Re: obsoleting plpython2u and defaulting plpythonu to plpython3u

2018-04-27 Thread Andres Freund
On 2018-04-27 13:19:43 -0400, Tom Lane wrote: > If we agree that something like this is the way to go, I wonder if we > shouldn't squeeze it into v11. If we wait till v12, that's not going > to ship till late 2019, which is going to be getting uncomfortably > close to when PEP 394 might change if

Re: obsoleting plpython2u and defaulting plpythonu to plpython3u

2018-04-27 Thread Tom Lane
Pavel Raiskup writes: > On Friday, April 27, 2018 5:51:57 PM CEST Tom Lane wrote: >> We should evidently plan on making this stuff happen in v12, or we're >> going to be behind the curve. > Agreed, but I'm still not sure what would be the expected 2->3 migration > path. If

Re: GCC 8 warnings

2018-04-27 Thread Peter Eisentraut
On 4/24/18 05:57, Devrim Gündüz wrote: > While building stable releases and v11 on Fedora 28, I am seeing some > warnings. Attached is a patch to fix these warnings in master. These are very similar to the class of warnings we fixed last time around for GCC 7. GCC 8 is now frozen, so it would

Re: Built-in connection pooling

2018-04-27 Thread Konstantin Knizhnik
On 27.04.2018 18:33, Merlin Moncure wrote: On Fri, Apr 27, 2018 at 10:05 AM, Konstantin Knizhnik wrote: On 27.04.2018 16:49, Merlin Moncure wrote: *) How are you pinning client connections to an application managed transaction? (IMNSHO, this feature is useless

Re: obsoleting plpython2u and defaulting plpythonu to plpython3u

2018-04-27 Thread Pavel Raiskup
On Friday, April 27, 2018 5:51:57 PM CEST Tom Lane wrote: > Note that there's a specific timeline there: they expect PEP 394 to get > changed not more than 2 years from now. I am not sure if Red Hat has > enough pull in the Python community to guarantee that will happen, but > do you want to bet

Re: [HACKERS] pgbench - allow to store select results into variables

2018-04-27 Thread Fabien COELHO
Hello Stephen, Attached is v18, another basic rebase after some perl automatic reindentation. -- Fabien.diff --git a/doc/src/sgml/ref/pgbench.sgml b/doc/src/sgml/ref/pgbench.sgml index e4b37dd..28a1387 100644 --- a/doc/src/sgml/ref/pgbench.sgml +++ b/doc/src/sgml/ref/pgbench.sgml @@ -942,6

Re: perltidy tweaks

2018-04-27 Thread Peter Eisentraut
On 4/26/18 14:10, Andrew Dunstan wrote: >>> - Use option --nooutdent-long-quotes. This is similar to a change we >>> made for pgindent in the C code a while ago. See patch for the results. >> No strong opinion as to whether to do that or not, but if we do, I wonder >> if we shouldn't also select

Re: obsoleting plpython2u and defaulting plpythonu to plpython3u

2018-04-27 Thread Tom Lane
Peter Eisentraut writes: > On 4/26/18 16:39, Tom Lane wrote: >> and I gather from Pavel's inquiry that the day >> is in sight when Fedora will do that. > According to the plan I found at > , they >

Re: obsoleting plpython2u and defaulting plpythonu to plpython3u

2018-04-27 Thread Tom Lane
Robert Haas writes: > Incidentally, it recently came to my notice that we're still issuing > hints that say: > Use CREATE LANGUAGE to load the language into the database. > That is now, and has been for some time, the wrong advice. We should > really be recommending CREATE

Re: Add read-only param to set_config(...) / SET that effects (at least) customized runtime options

2018-04-27 Thread Chapman Flack
On 04/20/2018 04:18 PM, Chapman Flack wrote: > On 04/20/2018 04:03 PM, Andrew Gierth wrote: >> Assign hooks aren't allowed to throw errors under any circumstance >> because they're called during transaction abort, and throwing an error >> during abort is obviously not tolerable. > > Ah yes, now

Re: documentation is now XML

2018-04-27 Thread Tom Lane
Bruce Momjian writes: > On Fri, Apr 27, 2018 at 11:00:36AM -0400, Peter Eisentraut wrote: >> That proposal seemed to indicate not only converting the source code to >> XML but also the build system to XSL. The latter is out of the >> question, I think. > Why is that? I

Re: Toast issues with OldestXmin going backwards

2018-04-27 Thread Andrew Gierth
> "Robert" == Robert Haas writes: Robert> One idea that occurred to me is to somehow record -- I guess in Robert> pg_class using non-transactional updates -- the last cutoff XID Robert> used to vacuum any given table. Then we could just make a rule Robert> that you

Re: Built-in connection pooling

2018-04-27 Thread Merlin Moncure
On Fri, Apr 27, 2018 at 10:05 AM, Konstantin Knizhnik wrote: > On 27.04.2018 16:49, Merlin Moncure wrote: >> *) How are you pinning client connections to an application managed >> transaction? (IMNSHO, this feature is useless without being able to do >> that) > > Sorry,

Re: Issues while building PG in MS Windows, using MSYS2 and MinGW-w64

2018-04-27 Thread Tom Lane
"insaf.k" writes: > I am trying to build PG from source, in MS Windows using MSYS2 and MinGW-w64. > I've tried to build PG 10.0 as wells as 10.3. > I've done configuring like this > ./configure --prefix="/d/pg10/" > And when I do "make" or "make world", I'm getting

Re: obsoleting plpython2u and defaulting plpythonu to plpython3u

2018-04-27 Thread Peter Eisentraut
On 4/26/18 16:39, Tom Lane wrote: >> I don't think we should do that unless there is an update to PEP 394. > > PEP 394 points out that some distros (at least Arch) have already switched > "python" to mean "python3", My recollection is that PEP 394 was written because Arch jumped the gun and the

Re: Built-in connection pooling

2018-04-27 Thread Konstantin Knizhnik
On 27.04.2018 16:49, Merlin Moncure wrote: On Thu, Apr 26, 2018 at 6:04 AM, Konstantin Knizhnik wrote: On 25.04.2018 20:02, Merlin Moncure wrote: Yep. The main workaround today is to disable them. Having said that, it's not that difficult to imagine hooking

Re: documentation is now XML

2018-04-27 Thread Bruce Momjian
On Fri, Apr 27, 2018 at 11:00:36AM -0400, Peter Eisentraut wrote: > On 4/23/18 05:54, Liudmila Mantrova wrote: > > Reading this thread, I got an impression that everyone would benefit > > from converting back branches to XML, but the main concern is lack of > > resources to complete this task. Are

Re: Toast issues with OldestXmin going backwards

2018-04-27 Thread Robert Haas
On Thu, Apr 26, 2018 at 9:03 PM, Andrew Gierth wrote: >(Or do we need to track it across restarts? maybe we do, to deal with >replication slaves without slots, or changes in parameters) Yeah, I'm worried that it might need to be persistent across restarts.

Re: documentation is now XML

2018-04-27 Thread Peter Eisentraut
On 4/23/18 05:54, Liudmila Mantrova wrote: > Reading this thread, I got an impression that everyone would benefit > from converting back branches to XML, but the main concern is lack of > resources to complete this task. Are there any other issues that affect > this decision? Looks like Aleksander

Re: Built-in connection pooling

2018-04-27 Thread Robert Haas
On Wed, Apr 25, 2018 at 10:09 PM, Michael Paquier wrote: > On Wed, Apr 25, 2018 at 03:42:31PM -0400, Robert Haas wrote: >> The difficulty of finding them all is really the problem. If we had a >> reliable way to list everything that needs to be moved into session >> state,

Re: obsoleting plpython2u and defaulting plpythonu to plpython3u

2018-04-27 Thread Robert Haas
On Thu, Apr 26, 2018 at 4:39 PM, Tom Lane wrote: > I'm not very sure how many moving parts would be involved in making that > happen. One thing we should probably do first is retire the pg_pltemplate > system catalog in favor of making PL extension scripts self-contained, >

Re: Built-in connection pooling

2018-04-27 Thread Merlin Moncure
On Thu, Apr 26, 2018 at 6:04 AM, Konstantin Knizhnik wrote: > On 25.04.2018 20:02, Merlin Moncure wrote: >> Yep. The main workaround today is to disable them. Having said that, >> it's not that difficult to imagine hooking prepared statement creation >> to a backend

Re: minor fix for acquire_inherited_sample_rows

2018-04-27 Thread Ashutosh Bapat
On Thu, Apr 26, 2018 at 7:08 PM, Amit Langote wrote: > On Thu, Apr 26, 2018 at 9:54 PM, Ashutosh Bapat > wrote: >> On Thu, Apr 26, 2018 at 1:08 AM, Robert Haas wrote: >>> +1. I think we're really abusing

Re: Wrong plan with extra parallel workers

2018-04-27 Thread Amit Kapila
On Fri, Apr 27, 2018 at 2:48 PM, Guilherme Pereira wrote: > Hi, > > Having a strange situation, where adding extra parallel workers > (max_parallel_workers_per_gather), the planner chooses a different plan, I think I can see what is going on here. The planner chooses a

Issues while building PG in MS Windows, using MSYS2 and MinGW-w64

2018-04-27 Thread insaf.k
Hello, I am trying to build PG from source, in MS Windows using MSYS2 and MinGW-w64. I've tried to build PG 10.0 as wells as 10.3. I've done configuring like this ./configure --prefix="/d/pg10/" And when I do "make" or "make world", I'm getting compilation error. I've attached

Re: Wrong plan with extra parallel workers

2018-04-27 Thread Guilherme Pereira
Forgot to mention that I'm using the development branch of Postgres 11. Also as requested, sending the plans via the https://explain.depesz.com app. set max_parallel_workers_per_gather = 2; EXPLAIN ANALYZE SELECT "f_zendesktickets_aaeljtllr5at3el"."via_id" AS "a_1303", COUNT( DISTINCT

Fwd: Failed rpm package signature checks with reposync

2018-04-27 Thread Bruno Lavoie
Did not get response from general, so trying here. Thanks -- Forwarded message - From: Bruno Lavoie Date: mer. 25 avr. 2018 11:22 AM Subject: Failed rpm package signature checks with reposync To: Hello, Don't know if I

Range phrase operator in tsquery

2018-04-27 Thread Aleksandr Parfenov
Hello hackers, Nowadays, phrase operator in Postgres FTS supports only exact match of the distance between two words. It is sufficient for a search of simple/exact phrases, but in some cases exact distance is unknown and we want to words be close enough. E.g. it may help to search phrases with

Re: Problem while updating a foreign table pointing to a partitioned table on foreign server

2018-04-27 Thread Ashutosh Bapat
On Thu, Apr 19, 2018 at 11:38 AM, Kyotaro HORIGUCHI wrote: > >> /* No rows should be returned if no rows were updated. */ >> Assert(n_rows_returned == 0 || n_rows_updated > 0); > > The assertion is correct but I think that we shouldn't crash > server by any kind

Re: Is a modern build system acceptable for older platforms

2018-04-27 Thread Hartmut Holzgraefe
On 27.04.2018 10:45, Mark Kirkwood wrote: I note that Mysql (yeah I know, we don't love 'em greatly, but their product niche is similar to ours) and Ceph (ok it is a distributed storage system but still a highly popular open src product) have switched to using cmake (relatively) recently.

Wrong plan with extra parallel workers

2018-04-27 Thread Guilherme Pereira
Hi, Having a strange situation, where adding extra parallel workers (max_parallel_workers_per_gather), the planner chooses a different plan, with nested loops, which makes the query twice as slow. Strangely with the COUNT_DISTINCT implementation from Tomas Vondra (

Re: Is a modern build system acceptable for older platforms

2018-04-27 Thread Mark Kirkwood
On 27/04/18 19:10, Yuriy Zhuravlev wrote: 1. You can remove tools/msvc folder because all your build rules will be universal. (cmake build now have much fewer lines of code) 2. You can forget about terminal in Windows (for windows guys it's important) 3. You can normally check environment on

Re: Is a modern build system acceptable for older platforms

2018-04-27 Thread Yuriy Zhuravlev
> (2) it might make things easier on Windows, > which could be a sufficiently good reason but I don't think I've seen > anyone explain exactly how much easier it will make things and in what > ways. > 1. You can remove tools/msvc folder because all your build rules will be universal. (cmake

Re: Is there a memory leak in commit 8561e48?

2018-04-27 Thread Andrew Gierth
> "Tom" == Tom Lane writes: Tom> I would bet money that that "_SPI_current->internal_xact" thing is Tom> wrong/inadequate. In particular this looks wrong to me: after doing: do $$ begin execute 'declare foo cursor with hold for select 1/x as a from (values

Re: GSoC 2018: Sorting Algorithm and Benchmarking

2018-04-27 Thread Andrey Borodin
Hi! > 26 апр. 2018 г., в 0:12, Kefan Yang написал(а): > > My name is Kefan Yang. I am so excited that my proposal ‘Sorting Algorithm > and Benchmarking 2018’ has been accepted. Welcome! I'm also glad you've chosen this project. > I see on the Wiki page that you can