Re: pg_ls_tmpdir()

2018-10-01 Thread Andres Freund
Hi, On 2018-09-26 22:36:03 +0200, Laurenz Albe wrote: > 2. There already are functions "pg_ls_logdir" and "pg_ls_waldir", >and I can imagine new requests, e.g. pg_ls_datafiles() to list the >data files in a database directory. > >It may make sense to have a generic function like > >

Re: pg_ls_tmpdir(); AND, Function for listing archive_status directory

2018-10-01 Thread Justin Pryzby
On Wed, Sep 26, 2018 at 10:36:03PM +0200, Laurenz Albe wrote: > Bossart, Nathan wrote: > > Attached is a patch to add a pg_ls_tmpdir() function that lists the > > contents of a specified tablespace's pgsql_tmp directory. This is > > very similar to the existing pg_ls_logdir() and pg_ls_waldir() >

Re: Add SKIP LOCKED to VACUUM and ANALYZE

2018-10-01 Thread Bossart, Nathan
On 9/27/18, 2:52 AM, "Michael Paquier" wrote: > Thanks for the new patches. So I have begun looking at the full set, > beginning by 0001 which introduces a new common routine to get the > elevel associated to a skipped relation. I have been chewing on this > one, and I think that the patch

Re: Assert failed in snprintf.c

2018-10-01 Thread Tom Lane
Jaime Casanova writes: > sqlsmith made it again, attached is the query (run against regression > database) that makes the assert fail and the backtrace. > this happens in head only (or at least 11 is fine). Ah. Looks like the has_column_privilege stuff is incautious about whether it's handed a

Re: automatic restore point

2018-10-01 Thread Peter Eisentraut
On 01/10/2018 05:34, Alvaro Herrera wrote: > I don't see it as clear cut as all that ... particularly considering > that a useful event trigger runs *after* the DDL command in question has > already written all its WAL, so such a restore point would be completely > useless. (Or are

Re: executor relation handling

2018-10-01 Thread Tom Lane
Amit Langote writes: > On 2018/10/01 2:18, Tom Lane wrote: >> I think that the call sites should ultimately look like >> Assert(CheckRelationLockedByMe(...)); >> but for hunting down the places where the assertion currently fails, >> it's more convenient if it's just an elog(WARNING). > Should

Re: executor relation handling

2018-10-01 Thread Tom Lane
Amit Langote writes: > On 2018/09/30 5:04, Tom Lane wrote: >> 3. There remain some cases where the RTE says RowExclusiveLock but >> the executor calculation indicates we only need AccessShareLock. >> AFAICT, this happens only when we have a DO ALSO rule that results >> in an added query that

Re: Relations being opened without any lock whatever

2018-10-01 Thread Tom Lane
Amit Langote writes: > On 2018/10/01 4:20, Tom Lane wrote: >> Running the regression tests with the patch I showed in >> https://www.postgresql.org/message-id/16565.1538327...@sss.pgh.pa.us > Maybe you've noticed but the relation_open calls coming from bootstrap.c > all pass NoLock which trigger

Re: Oid returned from AddSubscriptionRelState/UpdateSubscriptionRelState

2018-10-01 Thread Petr Jelinek
Hi, On 29/09/18 03:35, Andres Freund wrote: > > How come those two functions return oids, even though, as far as I > understand, the underlying relation is BKI_WITHOUT_OIDS. I assume > that's just an oversight? > Yeah, it's copy-pasto that managed to get through, those functions should return

Re: Sync ECPG scanner with core

2018-10-01 Thread John Naylor
On 9/30/18, Michael Paquier wrote: > It would be nice to add this patch to the next commit fest: > https://commitfest.postgresql.org/20/ Done, thanks. -John Naylor

Re: Early WIP/PoC for inlining CTEs

2018-10-01 Thread Andreas Karlsson
On 07/27/2018 10:10 AM, David Fetter wrote: On Fri, Jul 27, 2018 at 02:55:26PM +1200, Thomas Munro wrote: On Thu, Jul 26, 2018 at 7:14 AM, David Fetter wrote: Please find attached the next version, which passes 'make check'. ... but not 'make check-world' (contrib/postgres_fdw's EXPLAIN is

Re: de-deduplicate code in DML execution hooks in postgres_fdw

2018-10-01 Thread Etsuro Fujita
(2018/10/01 19:42), Michael Paquier wrote: On Mon, Jul 23, 2018 at 02:17:38PM +0530, Ashutosh Bapat wrote: I used perform instead of execute since the later is usually associated with local operation. I added "foreign" in the name of the function to indicate that it's executed on foreign

Re: Hint to set owner for tablespace directory

2018-10-01 Thread Maksim Milyutin
01.10.2018 15:15, Peter Eisentraut wrote: On 24/09/2018 14:50, Peter Eisentraut wrote: On 11/09/2018 17:10, Peter Eisentraut wrote: On 07/09/2018 17:59, Maksim Milyutin wrote: those directories was that user). The error message "could not set permissions on directory ..." disoriented that

Re: [HACKERS] Optional message to user when terminating/cancelling backend

2018-10-01 Thread Daniel Gustafsson
> On 1 Oct 2018, at 01:19, Michael Paquier wrote: > > On Sun, Sep 30, 2018 at 10:51:44PM +0900, Michael Paquier wrote: >> You could have chosen something less complicated, like "ホゲ", which is >> the equivalent of "foo" in English. Anyway, non-ASCII characters should >> not be included in the

Re: SQL/JSON: documentation

2018-10-01 Thread Liudmila Mantrova
On 09/28/2018 08:29 PM, Peter Eisentraut wrote: On 28/06/2018 01:36, Nikita Glukhov wrote: Attached patch with draft of SQL/JSON documentation written by Liudmila Mantrova, Oleg Bartunov and me. Also it can be found in our sqljson repository on sqljson_doc branch:

Re: SSL tests failing with "ee key too small" error on Debian SID

2018-10-01 Thread Kyotaro HORIGUCHI
At Tue, 25 Sep 2018 14:26:42 +0900, Michael Paquier wrote in <20180925052642.gj1...@paquier.xyz> > On Tue, Sep 25, 2018 at 12:48:57PM +0900, Kyotaro HORIGUCHI wrote: > > Do you mean that cert/key files are generated on-the-fly while > > running 'make check'? It sounds reasonable as long as just

Re: Hint to set owner for tablespace directory

2018-10-01 Thread Peter Eisentraut
On 24/09/2018 14:50, Peter Eisentraut wrote: > On 11/09/2018 17:10, Peter Eisentraut wrote: >> On 07/09/2018 17:59, Maksim Milyutin wrote: >>> those directories was that user). The error message "could not set >>> permissions on directory ..." disoriented that user. The need to change >>> the

Re: Proposal for Signal Detection Refactoring

2018-10-01 Thread Chris Travers
On Wed, Sep 26, 2018 at 9:54 AM Chris Travers wrote: > > > On Tue, Sep 25, 2018 at 3:23 PM Tom Lane wrote: > >> Chris Travers writes: >> > However, what I think one could do is use a struct of volatile >> > sig_atomic_t members and macros for checking/setting. Simply writing a >> > value is

Re: Function for listing archive_status directory

2018-10-01 Thread Christoph Moench-Tegeder
## Michael Paquier (mich...@paquier.xyz): > Okay, could you add this patch to the next commit fest? Here it is: > https://commitfest.postgresql.org/20/ And here's the patch: https://commitfest.postgresql.org/20/1813/ Regards, Christoph -- Spare Space

Re: pgbench - add pseudo-random permutation function

2018-10-01 Thread Fabien COELHO
PostgreSQL Hackers Subject: Re: pgbench - add pseudo-random permutation function On Wed, Sep 26, 2018 at 01:20:49PM +0200, Fabien COELHO wrote: So, am I right to deducing that you are satisfied with the current status of the patch, with the nbits implementation either based on popcount

Re: Hash Joins vs. Bloom Filters / take 2

2018-10-01 Thread Tomas Vondra
On 10/01/2018 09:15 AM, Michael Paquier wrote: On Thu, Mar 01, 2018 at 07:04:41PM -0500, David Steele wrote: After reviewing the thread I also agree that this should be pushed to 2018-09, so I have done so. I'm very excited by this patch, though. In general I agree with Peter that a higher

Re: de-deduplicate code in DML execution hooks in postgres_fdw

2018-10-01 Thread Michael Paquier
On Mon, Jul 23, 2018 at 02:17:38PM +0530, Ashutosh Bapat wrote: > I used perform instead of execute since the later is usually > associated with local operation. I added "foreign" in the name of the > function to indicate that it's executed on foreign server. I am happy > with "remote" as well. I

New vacuum option to do only freezing

2018-10-01 Thread Masahiko Sawada
Hi, Attached patch adds a new option FREEZE_ONLY to VACUUM command. This option is same as FREEZE option except for it disables reclaiming dead tuples. That is, with this option vacuum does pruning HOT chain, freezing live tuples and maintaining both visibility map and freespace map but does not

Re: executor relation handling

2018-10-01 Thread Amit Langote
On 2018/10/01 2:18, Tom Lane wrote: > I wrote: >> 1. You set up transformRuleStmt to insert AccessExclusiveLock into >> the "OLD" and "NEW" RTEs for a view. This is surely wrong; we do >> not want to take exclusive lock on a view just to run a query using >> the view. It should (usually, anyway)

Re: [PROPOSAL] Shared Ispell dictionaries

2018-10-01 Thread Arthur Zakirov
On Thu, Jun 14, 2018 at 11:40:17AM +0300, Arthur Zakirov wrote: > I attached new version of the patch. The patch still applies to HEAD. I moved it to the next commitfest. -- Arthur Zakirov Postgres Professional: http://www.postgrespro.com Russian Postgres Company

[PROPOSAL]a new data type 'bytea' for ECPG

2018-10-01 Thread Matsumura, Ryo
Hi, Hackers # This is my first post. I will try to implement a new data type 'bytea' for ECPG. I think that the implementation is not complicated. Does anyone need it ? * Why do I need bytea ? Currently, ECPG program can treat binary data for bytea column with 'char' type of C language, but

Re: Query is over 2x slower with jit=on

2018-10-01 Thread Lukas Fittl
On Tue, Sep 25, 2018 at 1:17 PM, Andres Freund wrote: > > I've pushed the change without that bit - it's just a few additional > lines if we want to change that. > It seems that since this commit, JIT statistics are now only being printed for parallel query plans. This is due to ExplainPrintJIT

Re: partition tree inspection functions

2018-10-01 Thread Amit Langote
On 2018/10/01 15:27, Michael Paquier wrote: > On Mon, Oct 01, 2018 at 03:16:32PM +0900, Amit Langote wrote: >> I wasn't able to respond to some of issues that Jesper brought up with the >> approach taken by the latest patch whereby there is no separate >> pg_partition_level function. He said that

Re: Relations being opened without any lock whatever

2018-10-01 Thread Amit Langote
On 2018/10/01 4:20, Tom Lane wrote: > Running the regression tests with the patch I showed in > https://www.postgresql.org/message-id/16565.1538327...@sss.pgh.pa.us > exposes two places where HEAD is opening relations without having > any lock at all on them: Maybe you've noticed but the

Re: [HACKERS] SERIALIZABLE with parallel query

2018-10-01 Thread Michael Paquier
On Wed, Sep 19, 2018 at 04:50:40PM -0500, Kevin Grittner wrote: > I will spend a few more days in testing and review, but figured I > should pass along "first impressions" now. Kevin, it seems that this patch is pending on your input. I have moved this patch to next CF for now. -- Michael

Re: Hash Joins vs. Bloom Filters / take 2

2018-10-01 Thread Michael Paquier
On Thu, Mar 01, 2018 at 07:04:41PM -0500, David Steele wrote: > After reviewing the thread I also agree that this should be pushed to > 2018-09, so I have done so. > > I'm very excited by this patch, though. In general I agree with Peter that > a higher rate of false positives is acceptable to

Re: hostorder and failover_timeout for libpq

2018-10-01 Thread Michael Paquier
On Wed, Sep 19, 2018 at 02:26:53PM +0200, Ildar Musin wrote: > Another approach would be to leave `pg_conn->connhost` as it is now (i.e. > not to create global addresses array) and just apply random permutations to > it if `hostorder=random` is specified. And probably apply permutations to >

Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2018-10-01 Thread Michael Paquier
On Wed, Jun 06, 2018 at 07:03:47PM +0530, Amit Kapila wrote: > I think Robert's chash stuff [1] might be helpful to reduce the contention > you are seeing. Latest patch available does not apply, so I moved it to next CF. The thread has died a bit as well... -- Michael signature.asc

Re: libpq compression

2018-10-01 Thread Michael Paquier
On Mon, Aug 20, 2018 at 06:00:39PM +0300, Konstantin Knizhnik wrote: > New version of the patch is attached: I removed -Z options form pgbench and > psql and add checking that server and client are implementing the same > compression algorithm. The patch had no reviews, and does not apply

Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors

2018-10-01 Thread Michael Paquier
On Wed, Sep 12, 2018 at 06:12:29PM +0300, Marina Polyakova wrote: > The discussion about this has become entangled from the beginning, because > as I wrote in [1] at first I misread your original proposal... The last emails are about the last reviews of Fabien, which has remained unanswered for

Re: pgbench - add pseudo-random permutation function

2018-10-01 Thread Michael Paquier
On Wed, Sep 26, 2018 at 01:20:49PM +0200, Fabien COELHO wrote: > So, am I right to deducing that you are satisfied with the current status of > the patch, with the nbits implementation either based on popcount (v4) or > clz (v5) compiler intrinsics? I think that the clz option is better. Fabien,

Re: executor relation handling

2018-10-01 Thread Amit Langote
On 2018/09/30 5:04, Tom Lane wrote: > David Rowley writes: >> I've attached v10 which fixes this and aligns the WARNING text in >> ExecInitRangeTable() and addRangeTableEntryForRelation(). > > I started poking at this. Thanks a lot for looking at this. > I thought that it would be a good

Re: Multiple primary key on partition table?

2018-10-01 Thread Rajkumar Raghuwanshi
On Tue, Sep 18, 2018 at 11:20 AM amul sul wrote: > On Mon, Sep 17, 2018 at 9:06 PM amul sul wrote: > > > > Nice catch Rajkumar. > > > > In index_check_primary_key(), relationHasPrimaryKey() called only for > the an > > alter command but I think we need to call in this case as well, like > this:

Re: Adding a note to protocol.sgml regarding CopyData

2018-10-01 Thread Michael Paquier
On Fri, Sep 28, 2018 at 08:16:46PM +0200, Peter Eisentraut wrote: > Yeah, I don't see why we need to document it three times in the same > chapter. > > Also, that chapter is specifically about version 3.0 of the protocol, so > documenting version 2.0 is out of scope. This has been marked as

Re: [HACKERS] PATCH: Batch/pipelining support for libpq

2018-10-01 Thread Michael Paquier
On Fri, Mar 23, 2018 at 02:18:09PM +0100, Daniel Verite wrote: > There's a batch mode for pgbench in a patch posted in [1], > with \beginbatch and \endbatch commands, but nothing > for psql AFAICS. > psql is more complicated because currently it uses a > blocking PQexec() call at its core. Craig

Re: Sample values for pg_stat_statements

2018-10-01 Thread Michael Paquier
On Tue, Apr 17, 2018 at 05:58:44PM +0200, Vik Fearing wrote: > I think I handle that well enough with permission checking, but I'm open > to more debate on it. The recent version bump in pg_stat_statements (Sorry my fault!) is causing this patch to not apply anymore. I have moved it to next CF

Re: partition tree inspection functions

2018-10-01 Thread Michael Paquier
On Mon, Oct 01, 2018 at 03:16:32PM +0900, Amit Langote wrote: > I wasn't able to respond to some of issues that Jesper brought up with the > approach taken by the latest patch whereby there is no separate > pg_partition_level function. He said that such a function would be useful > to get the

Re: libpq should append auth failures, not overwrite

2018-10-01 Thread Michael Paquier
On Tue, Aug 14, 2018 at 02:17:09PM +0200, Fabien COELHO wrote: > I think that people would survive having the ip spelled out on localhost > errors when there are several ips associated to the name. > > You could also create an exception for "localhost" if you see it as a large > problem, but if

Re: partition tree inspection functions

2018-10-01 Thread Amit Langote
Hi, On 2018/10/01 15:03, Michael Paquier wrote: > On Thu, Aug 09, 2018 at 01:05:56PM +0900, Amit Langote wrote: >> Attached updated patch. > > So, except if I am missing something, what we have here is a patch which > has been debatted quite a bit and has semantics which look nice. Thanks. >

Re: partition tree inspection functions

2018-10-01 Thread Michael Paquier
On Thu, Aug 09, 2018 at 01:05:56PM +0900, Amit Langote wrote: > Attached updated patch. So, except if I am missing something, what we have here is a patch which has been debatted quite a bit and has semantics which look nice. Any objections if we move forward with this patch? +-- all tables in

<    1   2