9.6.10 build warning on Fedora 28

2018-08-09 Thread Devrim Gündüz
Hi, Just noticed this on Fedora 28 box (GCC 8.1.1) = pgbench.c: In function 'ParseScript': pgbench.c:2640:20: warning: '__builtin___sprintf_chk' may write a terminating nul past the end of the destination [-Wformat-overflow=]

Re: Scariest patch tournament, PostgreSQL 11 edition

2018-08-09 Thread David Rowley
On 9 August 2018 at 04:32, Alvaro Herrera wrote: > 499be013de6 │ Support partition pruning at execution time > │ Alvaro Herrera │ 6 Perhaps adding the enable_partitition_pruning GUC was a good idea after all. -- David Rowley

Re: REINDEX and shared catalogs

2018-08-09 Thread Michael Paquier
On Wed, Aug 08, 2018 at 07:36:22PM +, Bossart, Nathan wrote: > On 8/8/18, 2:16 PM, "Michael Paquier" wrote: >> By no-backpatch, I only implied patching v12, but that would not be a >> huge amount of efforts to get that into v11, so I can do that as well. >> Any objections to doing that? > >

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

2018-08-09 Thread Fabien COELHO
Hello Marina, v10-0002-Pgbench-errors-use-a-separate-function-to-report.patch - a patch for a separate error reporting function (this is used to report client failures that do not cause an aborts and this depends on the level of debugging). Patch applies cleanly, compiles, global & local

Re: [PATCH] Improve geometric types

2018-08-09 Thread Kyotaro HORIGUCHI
At Wed, 8 Aug 2018 14:39:54 +0200, Tomas Vondra wrote in <6ecb4f61-1fb1-08a1-31d6-e58e9c352...@2ndquadrant.com> > > > On 08/03/2018 02:39 PM, Tomas Vondra wrote: > > On 08/03/2018 06:40 AM, Kyotaro HORIGUCHI wrote: > >> ... > >> > >> I'm not confident on replacing double to float8 partially in

Re: 9.6.10 build warning on Fedora 28

2018-08-09 Thread David Rowley
On 9 August 2018 at 21:30, Devrim Gündüz wrote: > pgbench.c: In function 'ParseScript': > pgbench.c:2640:20: warning: '__builtin___sprintf_chk' may write a terminating > nul past the end of the destination [-Wformat-overflow=] >sprintf(var, "$%d", cmd->argc); > ^ > In file

Re: Typo in doc or wrong EXCLUDE implementation

2018-08-09 Thread KES
Bruce: >Yes, it would work, but doing that only for equality would be surprising to many people Why surprising? It is [documented](https://www.postgresql.org/docs/current/static/sql-createtable.html#sql-createtable-exclude): >If all of the specified operators test for equality, this is

Re: Typo in optimizer/README

2018-08-09 Thread Heikki Linnakangas
On 09/08/18 10:22, Tatsuro Yamada wrote: Attached patch for fixing a typo in optimizer/README. s/Partition-wise/Partitionwise/ It is the only place the keyword "Partition-wise" exists, so I created the patch. Thanks, fixed, and also one in a comment in postgres_fdw's regression test. I'm

Re: Typo in optimizer/README

2018-08-09 Thread Tatsuro Yamada
Hi Heikki, On 2018/08/09 16:45, Heikki Linnakangas wrote: On 09/08/18 10:22, Tatsuro Yamada wrote: Attached patch for fixing a typo in optimizer/README. s/Partition-wise/Partitionwise/ It is the only place the keyword "Partition-wise" exists, so I created the patch. Thanks, fixed, and

Re: Temporary tables prevent autovacuum, leading to XID wraparound

2018-08-09 Thread Andres Freund
On 2018-08-09 09:00:29 +0200, Michael Paquier wrote: > On Thu, Aug 09, 2018 at 08:32:32AM +0530, Andres Freund wrote: > > My point is that the documentation isn't sufficient. Not that there's an > > active problem. > > OK. Attached is the latest version if the patch I have that I was >

Re: Reopen logfile on SIGHUP

2018-08-09 Thread Kyotaro HORIGUCHI
Hello. At Tue, 7 Aug 2018 16:36:34 +0300, Alexander Kuzmenkov wrote in > I think the latest v4 patch addresses the concerns raised > upthread. I'm marking the commitfest entry as RFC. Thank you, but it is forgetting pg_ctl --help output. I added it and moved logrotate entry in docs just

Typo in optimizer/README

2018-08-09 Thread Tatsuro Yamada
Hi, Attached patch for fixing a typo in optimizer/README. s/Partition-wise/Partitionwise/ It is the only place the keyword "Partition-wise" exists, so I created the patch. Regards, Tatsuro Yamada NTT Open Source Software Center diff --git a/src/backend/optimizer/README

Re: Temporary tables prevent autovacuum, leading to XID wraparound

2018-08-09 Thread Michael Paquier
On Thu, Aug 09, 2018 at 08:32:32AM +0530, Andres Freund wrote: > My point is that the documentation isn't sufficient. Not that there's an > active problem. OK. Attached is the latest version if the patch I have that I was preparing for commit. On top of isTempNamespaceInUse I have this note: +

Re: TupleTableSlot abstraction

2018-08-09 Thread Ashutosh Bapat
On Wed, Aug 8, 2018 at 5:07 PM, Ashutosh Bapat wrote: Amit Khandekar offlist told me that the previous patch-set doesn't apply cleanly on the latest head. PFA patches rebased on 31380bc7c204e7cfa9c9e1c62947909e2b38577c > > 3. compile with LLVM and fix any compilation and regression

Do all rows from a set have the same TupleDesc?

2018-08-09 Thread Raúl Marín Rodríguez
Hi, I have an user defined aggregate (Postgis' St_AsMVT) that receives rows as input and I was wondering if all these tuples have the same TupleDesc. In case it's important, here is how it's normally called: ``` SELECT St_AsMVT(q) FROM ( SELECT * FROM tilertest.tract9double ) q; ``` The idea

Re: [FEATURE REQUEST] Encrypted indexes over encrypted data

2018-08-09 Thread Andres Freund
On August 9, 2018 5:30:26 PM GMT+05:30, Danylo Hlynskyi wrote: > ?Is it hard to implement soluition 2? Yes. To the point that I'm fairly certain that an implementation would be considered to costly to maintain (vs benefit) of proposed. Andres -- Sent from my Android device with K-9

Re: ATTACH/DETACH PARTITION CONCURRENTLY

2018-08-09 Thread David Rowley
On 8 August 2018 at 01:29, Andres Freund wrote: > On 2018-08-08 01:23:51 +1200, David Rowley wrote: >> I'm not proposing that sessions running older snapshots can't see that >> there's a new partition. The code I have uses PartitionIsValid() to >> test if the partition should be visible to the

Re: commitfest 2018-07

2018-08-09 Thread Andrew Dunstan
Well, here we are at the end of July. here's the current state of Commitfest 2018-07: *Status summary: *Needs review : 83. Waiting on Author : 31. Ready for Committer

Re: remove ancient pre-dlopen dynloader code

2018-08-09 Thread Andres Freund
Hi, On 2018-08-09 14:29:08 +0200, Peter Eisentraut wrote: > The non-dlopen dynloader code for several operating systems is in some > cases decades obsolete, and I have had some doubts that it would even > compile anymore. Attached are patches for each operating system > removing the obsolete

pgbench exit code

2018-08-09 Thread Peter Eisentraut
In pgbench, when an error occurs during a benchmark run (SQL error, connection error, etc.) it just prints an error message and then proceeds to print the run summary normally and exits with status 0. So this is quite inconvenient, especially from a script. The attached patch changes this so

Re: buildfarm: could not read block 3 in file "base/16384/2662": read only 0 of 8192 bytes

2018-08-09 Thread Andrew Dunstan
On 08/09/2018 01:03 AM, Tom Lane wrote: Peter Geoghegan writes: On Wed, Aug 8, 2018 at 7:40 PM, Tom Lane wrote: Oooh ... but pg_class wouldn't be big enough to get a parallel index rebuild during that test, would it? Typically not, but I don't think that we can rule it out right away.

[FEATURE REQUEST] Encrypted indexes over encrypted data

2018-08-09 Thread Danylo Hlynskyi
Hi! Haven't found discussions on possible ways to encrypt indexes. Let's start! The problem == I'd like to encrypt some columns (first name, last name, SSN, etc...) in a nondeterministic way. This can be done using `pg_crypto`, but then I loose full-text-search (and any other indexing)

remove ancient pre-dlopen dynloader code

2018-08-09 Thread Peter Eisentraut
The non-dlopen dynloader code for several operating systems is in some cases decades obsolete, and I have had some doubts that it would even compile anymore. Attached are patches for each operating system removing the obsolete code, with references to when it became obsolete. -- Peter

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

2018-08-09 Thread Etsuro Fujita
(2018/08/08 17:30), Kyotaro HORIGUCHI wrote: Please find the attached. Thanks for the patch, Horiguchi-san! At Fri, 3 Aug 2018 11:48:38 +0530, Ashutosh Bapat wrote in The purpose of non-Var node is to avoid adding the attribute to relation descriptor. Idea is to create a new node, which

Re: remove ancient pre-dlopen dynloader code

2018-08-09 Thread Tom Lane
Andres Freund writes: > On 2018-08-09 14:29:08 +0200, Peter Eisentraut wrote: >> The non-dlopen dynloader code for several operating systems is in some >> cases decades obsolete, and I have had some doubts that it would even >> compile anymore. Attached are patches for each operating system >>

Re: Do all rows from a set have the same TupleDesc?

2018-08-09 Thread Tom Lane
=?UTF-8?B?UmHDumwgTWFyw61uIFJvZHLDrWd1ZXo=?= writes: > I have an user defined aggregate (Postgis' St_AsMVT) that receives rows as > input and I was wondering if all these tuples have the same TupleDesc. Yes, they should. It's possible that the tuples themselves might have visible

Re: Allow COPY's 'text' format to output a header

2018-08-09 Thread Cynthia Shang
> On Aug 8, 2018, at 2:57 PM, Simon Muller wrote: > > If there's a merge conflict against master, then it'd be good for an > updated patch to be posted. > > Thanks! > > Stephen > > Attached is an updated patch that should directly apply against current > master. > > -- > Simon Muller > >

Re: Improve behavior of concurrent TRUNCATE

2018-08-09 Thread Bossart, Nathan
On 8/9/18, 5:29 AM, "Michael Paquier" wrote: >> -truncate_check_rel(Relation rel) >> +truncate_check_rel(Oid relid, Form_pg_class reltuple) >> >> Could we use HeapTupleGetOid(reltuple) instead of passing the OID >> separately? > > If that was a HeapTuple. And it seems to me that we had better

Re: Optimizer misses big in 10.4 with BRIN index

2018-08-09 Thread Emre Hasegeli
> So I basically spent most of the time trying to create a reproducible case > and I can say I failed. I can however reproduce this with specific large > data set with specific data distribution, but not an artificial one. The query plans posted that has the statistics prefer Bitmap Index Scan.

libpq should append auth failures, not overwrite

2018-08-09 Thread Tom Lane
I noticed that, although most error reports during libpq's connection setup code append to conn->errorMessage, the ones in fe-auth.c and fe-auth-scram.c don't: they're all printfPQExpBuffer() not appendPQExpBuffer(). This seems wrong to me. It makes no difference in simple cases with a single

libpq should not look up all host addresses at once

2018-08-09 Thread Tom Lane
Whilst fooling with the patch for CVE-2018-10915, I got annoyed by the fact that connectDBStart() does the DNS lookups for all supplied hostnames at once, and fails if any of them are bad. It was reasonable to do the lookup there when we only allowed one hostname, but now that "host" can be a

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

2018-08-09 Thread Marina Polyakova
On 09-08-2018 12:28, Fabien COELHO wrote: Hello Marina, Hello! v10-0002-Pgbench-errors-use-a-separate-function-to-report.patch - a patch for a separate error reporting function (this is used to report client failures that do not cause an aborts and this depends on the level of debugging).

libpq connection timeout mismanagement

2018-08-09 Thread Tom Lane
The patch that taught libpq about allowing multiple target hosts modified connectDBComplete() with the intent of making the connect_timeout (if specified) apply per-host, not to the complete connection attempt. It did not do a very good job though, because the timeout only gets reset when

Re: POC for a function trust mechanism

2018-08-09 Thread Bruce Momjian
On Thu, Aug 9, 2018 at 06:18:16PM -0400, David Kohn wrote: > We certainly don't want to double-down on extending trust by allowing > someone to modify someone else's trusted role list.  Practically, if you > are opening up permissions to someone, you will need to create a group >

Re: PATCH: pgbench - option to build using ppoll() for larger connection counts

2018-08-09 Thread Andrew Dunstan
On 08/09/2018 05:46 PM, Andrew Dunstan wrote: On 08/09/2018 12:45 PM, Andrew Dunstan wrote: On 07/03/2018 07:52 PM, Andrew Dunstan wrote: On 05/17/2018 01:23 AM, Thomas Munro wrote: On Tue, Mar 27, 2018 at 9:23 AM, Rady, Doug wrote: pgbench11-ppoll-v12.patch Hi Doug, FYI this

Doc patch for index access method function

2018-08-09 Thread Tatsuro Yamada
Hi, Attached patch for fixing documents of "61.2. Index Access Method Functions" and "61.6. Index Cost Estimation Functions". I added a variable "double *indexPages" introduced by commit 5262f7a4f to the documents and also added its explanation. Please read and revise it because I'm a

Re: found xmin from before relfrozenxid on pg_catalog.pg_authid

2018-08-09 Thread Bruce Momjian
On Wed, Aug 8, 2018 at 10:27:59AM -0700, Peter Geoghegan wrote: > On Wed, Aug 8, 2018 at 10:23 AM, Kyle Samson wrote: > > We found the exact same issue on a production database at TripAdvisor. We > > have no new information to add for debugging. Bumping this to up the > > priority on a patch

Commitfest 2018-07 RFC items

2018-08-09 Thread Andrew Dunstan
As will be seen in the summary below, I think a good many of the RCF items in the commitfest probably aren't. More than half of them need more review, as I read the mailing list threads. I propose to move them all to the next CF, but in many cases after changing the to "needs review" or in

Re: Improve behavior of concurrent TRUNCATE

2018-08-09 Thread Michael Paquier
On Thu, Aug 09, 2018 at 03:27:04PM +, Bossart, Nathan wrote: > Thanks! This patch builds cleanly, the new tests pass, and my manual > testing hasn't uncovered any issues. Notably, I cannot reproduce the > originally reported authentication issue by using TRUNCATE after this > change. Beyond

Re: libpq should not look up all host addresses at once

2018-08-09 Thread Alvaro Herrera
On 2018-Aug-09, Tom Lane wrote: > Whilst fooling with the patch for CVE-2018-10915, I got annoyed by > the fact that connectDBStart() does the DNS lookups for all supplied > hostnames at once, and fails if any of them are bad. It was reasonable > to do the lookup there when we only allowed one

Re: logical decoding / rewrite map vs. maxAllocatedDescs

2018-08-09 Thread Tom Lane
Tomas Vondra writes: > While investigating an issue with rewrite maps in logical decoding, I > found it's pretty darn trivial to hit this: > ERROR: 53000: exceeded maxAllocatedDescs (492) while trying to open > file "pg_logical/mappings/map-4000-4eb-1_60DE1E08-5376b5-537c6b" > This

Re: logical decoding / rewrite map vs. maxAllocatedDescs

2018-08-09 Thread Alvaro Herrera
On 2018-Aug-09, Tomas Vondra wrote: > I suppose there are reasons why it's done this way, and admittedly the test > that happens to trigger this is a bit extreme (essentially running pgbench > concurrently with 'vacuum full pg_class' in a loop). I'm not sure it's > extreme enough to deem it not

Re: Improve behavior of concurrent TRUNCATE

2018-08-09 Thread Bossart, Nathan
On 8/9/18, 11:31 AM, "Michael Paquier" wrote: > Thanks, I have updated the patch as you suggested. Any more > improvements to it that you can foresee? Looks good to me. Nathan

xact_start meaning when dealing with procedures?

2018-08-09 Thread hubert depesz lubaczewski
Hi I just noticed that when I called a procedure that commits and rollbacks - the xact_start in pg_stat_activity is not updated. Is it intentional? I'm on newest 12devel, built today. Best regards, depesz

Re: libpq should append auth failures, not overwrite

2018-08-09 Thread Michael Paquier
On Thu, Aug 09, 2018 at 11:44:27AM -0400, Tom Lane wrote: > I noticed that, although most error reports during libpq's connection > setup code append to conn->errorMessage, the ones in fe-auth.c and > fe-auth-scram.c don't: they're all printfPQExpBuffer() not > appendPQExpBuffer(). This seems

Re: PATCH: pgbench - option to build using ppoll() for larger connection counts

2018-08-09 Thread Andrew Dunstan
On 07/03/2018 07:52 PM, Andrew Dunstan wrote: On 05/17/2018 01:23 AM, Thomas Munro wrote: On Tue, Mar 27, 2018 at 9:23 AM, Rady, Doug wrote: pgbench11-ppoll-v12.patch Hi Doug, FYI this patch is trying and failing to use ppoll() on Windows:

Re: buildfarm: could not read block 3 in file "base/16384/2662": read only 0 of 8192 bytes

2018-08-09 Thread Peter Geoghegan
On Wed, Aug 8, 2018 at 10:08 PM, Peter Geoghegan wrote: >> Hmmm ... maybe we should temporarily stick in an elog(LOG) showing whether >> a parallel build happened or not, so that we can check the buildfarm logs >> next time we see that failure? > > I can do that tomorrow. Of course, it might be

Re: Temporary tables prevent autovacuum, leading to XID wraparound

2018-08-09 Thread Michael Paquier
On Thu, Aug 09, 2018 at 02:29:54AM -0700, Andres Freund wrote: > On 2018-08-09 09:00:29 +0200, Michael Paquier wrote: >> Would you be fine if I add an extra note like what's in >> BackendIdGetProc? Say "The result may be out of date quickly, so the >> caller must be careful how to handle this

Re: Some pgq table rewrite incompatibility with logical decoding?

2018-08-09 Thread Tomas Vondra
On 06/25/2018 07:48 PM, Jeremy Finzel wrote: On Mon, Jun 25, 2018 at 12:41 PM, Andres Freund > wrote: Hi, On 2018-06-25 10:37:18 -0500, Jeremy Finzel wrote: > I am hoping someone here can shed some light on this issue - I apologize if > this isn't

Re: logical decoding / rewrite map vs. maxAllocatedDescs

2018-08-09 Thread Tomas Vondra
On 08/09/2018 07:47 PM, Alvaro Herrera wrote: On 2018-Aug-09, Tomas Vondra wrote: I suppose there are reasons why it's done this way, and admittedly the test that happens to trigger this is a bit extreme (essentially running pgbench concurrently with 'vacuum full pg_class' in a loop). I'm

Re: logical decoding / rewrite map vs. maxAllocatedDescs

2018-08-09 Thread Alvaro Herrera
On 2018-Aug-09, Tom Lane wrote: > It sounds like whoever wrote that code was completely impervious to the > API spec for AllocateFile(): > > * Note that files that will be open for any significant length of time > * should NOT be handled this way, since they cannot share kernel file > *

Re: POC for a function trust mechanism

2018-08-09 Thread Bruce Momjian
On Wed, Aug 8, 2018 at 01:15:38PM -0400, Tom Lane wrote: > This is sort of a counter-proposal to Noah's discussion of search path > security checking in <20180805080441.gh1688...@rfd.leadboat.com>. > (There's no technical reason we couldn't do both things, but I think > this'd be more useful to

Re: libpq should not look up all host addresses at once

2018-08-09 Thread Tom Lane
Alvaro Herrera writes: > On 2018-Aug-09, Tom Lane wrote: >> Whilst fooling with the patch for CVE-2018-10915, I got annoyed by >> the fact that connectDBStart() does the DNS lookups for all supplied >> hostnames at once, and fails if any of them are bad. It was reasonable >> to do the lookup

logical decoding / rewrite map vs. maxAllocatedDescs

2018-08-09 Thread Tomas Vondra
Hi, While investigating an issue with rewrite maps in logical decoding, I found it's pretty darn trivial to hit this: ERROR: 53000: exceeded maxAllocatedDescs (492) while trying to open file "pg_logical/mappings/map-4000-4eb-1_60DE1E08-5376b5-537c6b" This happens because we seem to

Re: Constraint documentation

2018-08-09 Thread Pantelis Theodosiou
On Thu, Aug 9, 2018 at 10:32 PM, Alvaro Herrera wrote: > On 2018-Aug-07, Lætitia Avrot wrote: > > > Hi Peter, > > > > I understand what you're pointing at and I agree that it could be a good > > thing to be able to dump/restore a table without problem. > > > > My point was that check constraints

CF 2018-07 Needs Review items

2018-08-09 Thread Andrew Dunstan
There has been some progress on quite a lot of these. I'm going to move them all to the next CF. Below are some notes on a few that seem to have stalled a bit. cheers andrew https://commitfest.postgresql.org/18/1518/ lc_messages parameter doesn't work on Windows This is a bug fix so

Re: Postgres 11 release notes

2018-08-09 Thread Masahiko Sawada
Hi, I found that the release note says "Add pgtrgm function strict_word_similarity() to compute the similarity of whole words" but I think "pgtrgm" should be "pg_trgm". Attached patch fixes it. Regards, -- Masahiko Sawada NIPPON TELEGRAPH AND TELEPHONE CORPORATION NTT Open Source Software

Re: CF 2018-07 Needs Review items

2018-08-09 Thread Tom Lane
Andrew Dunstan writes: > |https://commitfest.postgresql.org/18/1641/ |Try to produce compiler warnings > for incorrect usage of printf("%m") > Conversation seems to have died back in May. Wait another CF to see if it's > still alive. That's certainly still alive as far as I'm concerned. But I

Re: ATTACH/DETACH PARTITION CONCURRENTLY

2018-08-09 Thread Andres Freund
Hi, On 2018-08-09 20:57:35 +0200, Peter Eisentraut wrote: > On 07/08/2018 15:29, Andres Freund wrote: > > I don't think that solves the problem that an arriving relcache > > invalidation would trigger a rebuild of rd_partdesc, while it actually > > is referenced by running code. > > The problem

Re: POC for a function trust mechanism

2018-08-09 Thread Isaac Morland
On 9 August 2018 at 18:18, David Kohn wrote: Anyway, I guess all of this seems to introduce a lot more complexity into > an already complex permissions management system...is this all about the > public schema? Can we just make create function/operator etc something you > have to grant even in

Re: Why do we expand tuples in execMain.c?

2018-08-09 Thread Andrew Dunstan
On 08/08/2018 09:15 PM, Andres Freund wrote: On August 9, 2018 1:33:17 AM GMT+05:30, Andrew Dunstan wrote: On 08/08/2018 12:20 AM, Andres Freund wrote: Hi, I noticed if (HeapTupleHeaderGetNatts(tuple.t_data) <

Re: Commitfest 2018-07 WOA items

2018-08-09 Thread Alvaro Herrera
On 2018-Aug-09, Andrew Dunstan wrote: > https://commitfest.postgresql.org/18/1252/ Foreign Key Arrays > Nothing since May > Suggest Return with feedback. Please keep it around for my sake. -- Álvaro Herrerahttps://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support,

A dubious message related to SP-GiST compress method.

2018-08-09 Thread Kyotaro HORIGUCHI
I ran across the followin gcode in spgutils.c. > if (OidIsValid(cache->config.leafType) && > cache->config.leafType != atttype) > { > if (!OidIsValid(index_getprocid(index, 1, SPGIST_COMPRESS_PROC))) > ereport(ERROR, >

Re: Commitfest 2018-07 WOA items

2018-08-09 Thread Andrew Dunstan
On 08/09/2018 06:19 PM, Alvaro Herrera wrote: On 2018-Aug-09, Andrew Dunstan wrote: https://commitfest.postgresql.org/18/1252/ Foreign Key Arrays Nothing since May Suggest Return with feedback. Please keep it around for my sake. OK. I spent some time looking at it today, and it's a bit

Commitfest 2018-07 WOA items

2018-08-09 Thread Andrew Dunstan
I don't propose to annotate every one of these. If they aren't mentioned below I intend to move them to the next CF without any change. cheers andrew https://commitfest.postgresql.org/18/1644/ Add --include-table-data-where option to pg_dump, to export only a subset of table data I'm

Re: POC for a function trust mechanism

2018-08-09 Thread David Kohn
> > We certainly don't want to double-down on extending trust by allowing > someone to modify someone else's trusted role list. Practically, if you > are opening up permissions to someone, you will need to create a group > that you both belong to first, and have them trust the group, or they >

Re: pgbench exit code

2018-08-09 Thread Fabien COELHO
Hello Peter, In pgbench, when an error occurs during a benchmark run (SQL error, connection error, etc.) it just prints an error message and then proceeds to print the run summary normally and exits with status 0. So this is quite inconvenient, especially from a script. Yep. I'm fine with

Re: xact_start meaning when dealing with procedures?

2018-08-09 Thread Peter Eisentraut
On 09/08/2018 19:57, hubert depesz lubaczewski wrote: > I just noticed that when I called a procedure that commits and rollbacks > - the xact_start in pg_stat_activity is not updated. Is it intentional? It's an artifact of the way this is computed. The reported transaction timestamp is the

Re: POC for a function trust mechanism

2018-08-09 Thread David Kohn
On Thu, Aug 9, 2018 at 12:11 PM Bruce Momjian wrote: > ... > > > The things that we hadn't resolved, which is why this didn't get further > > than POC stage, were > > > > (1) What's the mechanism for declaring trust? In this POC, it's just > > a GUC that you can set to a list of role names,

Re: [HACKERS] proposal - Default namespaces for XPath expressions (PostgreSQL 11)

2018-08-09 Thread Andrew Dunstan
On 01/24/2018 04:30 AM, Pavel Stehule wrote: I am sending updated version. Very much thanks for very precious review Thomas, I am unable to replicate the Linux failure seen in the cfbot on my Fedora machine. Both when building with libxml2 and without, after applying the latest

Re: libpq should not look up all host addresses at once

2018-08-09 Thread Tom Lane
Chapman Flack writes: > On 08/09/2018 11:05 AM, Tom Lane wrote: >> So I think what this code should do is (1) look up each hostname as it >> needs it, not all at once, and (2) proceed on to the next hostname >> if it gets a DNS lookup failure, not fail the whole connection attempt >> immediately.

Re: xact_start meaning when dealing with procedures?

2018-08-09 Thread Vik Fearing
On 09/08/18 20:13, Peter Eisentraut wrote: > On 09/08/2018 19:57, hubert depesz lubaczewski wrote: >> I just noticed that when I called a procedure that commits and rollbacks >> - the xact_start in pg_stat_activity is not updated. Is it intentional? > > It's an artifact of the way this is

Re: POC for a function trust mechanism

2018-08-09 Thread Bruce Momjian
On Thu, Aug 9, 2018 at 02:12:41PM -0400, David Kohn wrote: > On Thu, Aug 9, 2018 at 12:11 PM Bruce Momjian wrote: > I can't think of any other places we do transitive permissions, except > for role membership.  I don't see the logic in adding such transitivity > to function/operator

Re: Typo in doc or wrong EXCLUDE implementation

2018-08-09 Thread Bruce Momjian
On Thu, Aug 9, 2018 at 01:11:05PM +0300, KES wrote: > Bruce: > >Yes, it would work, but doing that only for equality would be > >surprising > to many people > > Why surprising? It is > [documented](https://www.postgresql.org/docs/current/static/sql-create > table.html#sql-createtable-exclude): >

Re: Typo in doc or wrong EXCLUDE implementation

2018-08-09 Thread Tom Lane
Bruce Momjian writes: > On Thu, Aug 9, 2018 at 01:11:05PM +0300, KES wrote: >> Why surprising? It is >> [documented](https://www.postgresql.org/docs/current/static/sql-create >> table.html#sql-createtable-exclude): >>> If all of the specified operators test for equality, this is >>> equivalent to

Re: libpq should not look up all host addresses at once

2018-08-09 Thread Chapman Flack
On 08/09/2018 11:05 AM, Tom Lane wrote: > So I think what this code should do is (1) look up each hostname as it > needs it, not all at once, and (2) proceed on to the next hostname > if it gets a DNS lookup failure, not fail the whole connection attempt > immediately. As attached. Would it be

Re: [FEATURE REQUEST] Encrypted indexes over encrypted data

2018-08-09 Thread Bear Giles
There are alternatives. If you know what you want to find, e.g., a search by username or email address, you can store a strong hash of the value as an indexed column. By "strong hash" I mean don't just use md5 or sha1, or even one round with a salt. I can give you more details about how and why

Re: ATTACH/DETACH PARTITION CONCURRENTLY

2018-08-09 Thread Peter Eisentraut
On 07/08/2018 15:29, Andres Freund wrote: > I don't think that solves the problem that an arriving relcache > invalidation would trigger a rebuild of rd_partdesc, while it actually > is referenced by running code. The problem is more generally that a relcache invalidation changes all pointers

Re: [FEATURE REQUEST] Encrypted indexes over encrypted data

2018-08-09 Thread Nico Williams
On Thu, Aug 09, 2018 at 03:00:26PM +0300, Danylo Hlynskyi wrote: > The problem > == > > [...] > > We don't trust full-disk-encryption or any other transparent encryption, > because of possible SQL injections. Can you elaborate on this? > Solution 1 (possibly can be used even now) >

Re: Commitfest 2018-07 RFC items

2018-08-09 Thread Fabien COELHO
Hello Andrew, https://commitfest.postgresql.org/18/669/ pgbench - allow to store select results into variables Latest patch has not been reviewed Recommendation: change to "needs review" and move AFAICS the latest patch is a trivial rebase after some perl automatic indentation changes,

Re: POC for a function trust mechanism

2018-08-09 Thread Nico Williams
On Wed, Aug 08, 2018 at 01:15:38PM -0400, Tom Lane wrote: > This is sort of a counter-proposal to Noah's discussion of search path > security checking in <20180805080441.gh1688...@rfd.leadboat.com>. > (There's no technical reason we couldn't do both things, but I think > this'd be more useful to

Re: POC for a function trust mechanism

2018-08-09 Thread David Kohn
On Thu, Aug 9, 2018 at 3:04 PM Bruce Momjian wrote: > > > Well, right now, if you want to give members of a role rights to > something, you have to specifically grant rights to that role. I would > assume the same thing would happen here --- if you want to trust a group > role, you have to

Re: Typo in doc or wrong EXCLUDE implementation

2018-08-09 Thread David G. Johnston
On Thu, Aug 9, 2018 at 12:31 PM, Tom Lane wrote: > I think the OP is reading "equivalent" literally, as meaning that > an EXCLUDE with operators that act like equality is treated as being > the same as UNIQUE for *every* purpose. We're not going there, IMO, > so probably we need to tweak the

Re: Doc patch: add RECURSIVE to bookindex

2018-08-09 Thread Alvaro Herrera
On 2018-Aug-01, Fabien COELHO wrote: > Hello Daniel, > > > Patch applies cleanly, doc build ok, works for me. > > I have added it to the next CF and marked it as ready. Pushed, thanks. I applied it to 11 too. I would have added it even further back, but it didn't apply cleanly. How about an

Re: [HACKERS] WIP: long transactions on hot standby feedback replica / proof of concept

2018-08-09 Thread Ivan Kartyshov
Hello, thank you for your review. Alexander Korotkov писал 2018-06-20 20:54: Thinking about that more I found that adding vacuum mark as an extra argument to LockAcquireExtended is also wrong. It would be still hard to determine if we should log the lock in LogStandbySnapshot(). We'll have to

Re: peripatus build failures....

2018-08-09 Thread Larry Rosenman
It was never put into the build, and I have a PR open to remove the LLD_UNSAFE flag for 10.5 and the rest of today's releases. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=229523 -- Larry Rosenman http://www.lerctr.org/~ler Phone: +1 214-642-9640

Re: POC for a function trust mechanism

2018-08-09 Thread Bruce Momjian
On Thu, Aug 9, 2018 at 04:01:09PM -0400, David Kohn wrote: > > > On Thu, Aug 9, 2018 at 3:04 PM Bruce Momjian wrote: > > > > Well, right now, if you want to give members of a role rights to > something, you have to specifically grant rights to that role.  I would > assume the

Re: Documentaion fix.

2018-08-09 Thread Alvaro Herrera
On 2018-Aug-09, Kyotaro HORIGUCHI wrote: > # I noticed that the subject has typo.. Yeah. I suggest never changing subject lines, because Gmail has the nasty (mis-)feature of making such a response into a completely new thread. I don't know if Google paid mail service behaves in the same way.

Re: peripatus build failures....

2018-08-09 Thread Alvaro Herrera
On 2018-Jul-09, Larry Rosenman wrote: > On Mon, Jul 09, 2018 at 05:25:50PM -0400, Tom Lane wrote: > > I wrote: > > > I'd been hesitant to back-patch dddfc4cb2 back in April; but now that > > > it's survived some beta testing, I think that doing so seems like the > > > most appropriate way to fix

Re: [FEATURE REQUEST] Encrypted indexes over encrypted data

2018-08-09 Thread Bear Giles
Some regulatory standards require all UII, even all PII, information be encrypted within the database, not just on encrypted media. That's to reduce exposure even if someone gets access to a live server, e.g., via SQL Injection. (The perennial #1 risk for software vulnerabilities.) UII is

Re: Constraint documentation

2018-08-09 Thread Alvaro Herrera
On 2018-Aug-07, Lætitia Avrot wrote: > Hi Peter, > > I understand what you're pointing at and I agree that it could be a good > thing to be able to dump/restore a table without problem. > > My point was that check constraints weren't supposed to be used that way > theorically (or maybe i'm

Re: Typo in doc or wrong EXCLUDE implementation

2018-08-09 Thread Vik Fearing
On 09/08/18 21:09, Bruce Momjian wrote: > On Thu, Aug 9, 2018 at 01:11:05PM +0300, KES wrote: >> Bruce: >>> Yes, it would work, but doing that only for equality would be >>> surprising >> to many people >> >> Why surprising? It is >>

Re: [FEATURE REQUEST] Encrypted indexes over encrypted data

2018-08-09 Thread Nico Williams
On Thu, Aug 09, 2018 at 02:34:07PM -0600, Bear Giles wrote: > Some regulatory standards require all UII, even all PII, information be > encrypted within the database, not just on encrypted media. That's to > reduce exposure even if someone gets access to a live server, e.g., via SQL > Injection.

Repeatable Read Isolation in SQL running via background worker

2018-08-09 Thread Jeremy Finzel
I am using worker_spi as a model to run a SQL statement inside a background worker. From my browsing of the Postgres library, I believe that if I want repeatable read isolation level, the proper way for me to attain this is to add this line after StartTransactionCommand() in worker_spi_main:

Re: PATCH: pgbench - option to build using ppoll() for larger connection counts

2018-08-09 Thread Andrew Dunstan
On 08/09/2018 12:45 PM, Andrew Dunstan wrote: On 07/03/2018 07:52 PM, Andrew Dunstan wrote: On 05/17/2018 01:23 AM, Thomas Munro wrote: On Tue, Mar 27, 2018 at 9:23 AM, Rady, Doug wrote: pgbench11-ppoll-v12.patch Hi Doug, FYI this patch is trying and failing to use ppoll() on