Re: TupleTableSlot abstraction

2018-10-10 Thread Amit Khandekar
On Wed, 26 Sep 2018 at 05:15, Andres Freund wrote: > > Hi, > > On 2018-09-04 18:35:34 +0530, Amit Khandekar wrote: > > Subject: [PATCH 05/14] Use tts_flags instead of previous bool members > > > > Pack the boolean members in TupleTableSlot into a 16 bit tts_flags. > > This reduces the size of

Re: DSM segment handle generation in background workers

2018-10-10 Thread Tom Lane
Thomas Munro writes: >> Ok, here is a sketch patch with a new function InitRandomSeeds() to do >> that. It is called from PostmasterMain(), InitPostmasterChild() and >> InitStandaloneProcess() for consistency. > Here's a version I propose to push to master and 11 tomorrow, if there > are no

Re: Calculate total_table_pages after set_base_rel_sizes()

2018-10-10 Thread Amit Langote
On 2018/10/07 17:43, David Rowley wrote: > On 6 October 2018 at 18:20, Edmund Horner wrote: >> David Rowley said: >>> I am considering this a bug fix, but I'm proposing this for PG12 only >>> as I don't think destabilising plans in the back branches is a good >>> idea. I'll add this to the

Re: [HACKERS] WAL logging problem in 9.4.3?

2018-10-10 Thread Kyotaro HORIGUCHI
Hello. At Fri, 27 Jul 2018 15:26:24 -0400, Andrew Dunstan wrote in > > > On 07/18/2018 10:58 AM, Heikki Linnakangas wrote: > > On 18/07/18 16:29, Robert Haas wrote: > >> On Wed, Jul 18, 2018 at 9:06 AM, Michael Paquier > >> wrote: > What's wrong with the approach proposed in >

Re: Small performance tweak to run-time partition pruning

2018-10-10 Thread David Rowley
On 11 October 2018 at 16:00, Imai, Yoshikazu wrote: > On Thu, Sept 6, 2018 at 7:30 PM, David Rowley wrote: >> I've also included an additional test to ensure the other_subplans >> gets updated correctly. The other tests for this seem to only perform >> run-time pruning during init plan and do no

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

2018-10-10 Thread Michael Paquier
On Wed, Oct 10, 2018 at 03:37:50PM +0800, Richard Guo wrote: > This is a follow-up to the issue described in thread > https://www.postgresql.org/message-id/CAMbWs4-Mys%3DhBQSevTA8Zpd-TYFnb%3DXuHhN2TnktXMsfMUbjiQ%40mail.gmail.com > > In short, during the first transaction starting phase within a

Re: DSM segment handle generation in background workers

2018-10-10 Thread Thomas Munro
On Tue, Oct 9, 2018 at 3:21 PM Thomas Munro wrote: > On Tue, Oct 9, 2018 at 1:53 PM Tom Lane wrote: > > Thomas Munro writes: > > > On Mon, Oct 8, 2018 at 1:17 AM Thomas Munro > > > wrote: > > >> That's because the bgworker startup path doesn't contain a call to > > >> srandom(...distinguishing

Re: executor relation handling

2018-10-10 Thread Robert Haas
On Tue, Oct 9, 2018 at 2:35 PM Tom Lane wrote: > > That last part could *easily* change in a future release. We've > > already started to allow CTAS with parallel query, and there have > > already been multiple people wanting to allow more. It would be a > > shame if we threw up additional

Re: background worker shudown (was Re: [HACKERS] Why does logical replication launcher exit with exit code 1?)

2018-10-10 Thread Robert Haas
On Wed, Oct 10, 2018 at 12:00 AM Thomas Munro wrote: > So I suppose we should just remove it, with something like 0002. I'm > a bit uneasy about existing code out there that might be not calling > CFI. OTOH I suspect that a lot of code copied worker_spi.c and > installed its own handler. I

RE: Small performance tweak to run-time partition pruning

2018-10-10 Thread Imai, Yoshikazu
On Tue, Oct 9, 2018 at 1:24 AM, I wrote: > On Mon, Oct 8, 2018 at 1:00 AM, David Rowley wrote: > > I've attached an updated patch which skips the re-sequence work when > > doing that is not required for anything. > > > > I saw the patch and it seems good to me about the codes. > I still

RE: pgbench - doCustom cleanup

2018-10-10 Thread Jamison, Kirk
Hello Fabien, I have decided to take a look into this patch. -- patching file src/bin/pgbench/pgbench.c Hunk #1 succeeded at 296 (offset 29 lines). […Snip…] Hunk #21 succeeded at 5750 (offset 108 lines). patching file src/include/portability/instr_time.h …. === All 189 tests

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

2018-10-10 Thread Michael Paquier
On Wed, Oct 10, 2018 at 02:20:53PM +0200, Daniel Gustafsson wrote: >> On 9 Oct 2018, at 07:38, Michael Paquier wrote: >> In order to make a test with non-ASCII characters in the error message, >> we could use a trick similar to xml.sql: use a function which ignores >> the test case if

Re: Refactor textToQualifiedNameList()

2018-10-10 Thread Michael Paquier
On Wed, Oct 10, 2018 at 09:45:22AM -0300, Alvaro Herrera wrote: > On 2018-Oct-10, Michael Paquier wrote: >> On Tue, Oct 09, 2018 at 09:54:12AM -0300, Alvaro Herrera wrote: >>> The committer of such a change will get a lot of flak for changing the >>> #include requirements for code that calls that

Re: Postgres 11 release notes

2018-10-10 Thread Bruce Momjian
On Wed, Oct 10, 2018 at 06:13:56PM -0400, Bruce Momjian wrote: > On Wed, Oct 10, 2018 at 06:06:01PM -0400, Bruce Momjian wrote: > > On Wed, Oct 10, 2018 at 12:55:33PM -0700, Andres Freund wrote: > > > Several people argued for introducing it, you're the only one that was > > > against it. Adrien,

Re: Postgres 11 release notes

2018-10-10 Thread Bruce Momjian
On Wed, Oct 10, 2018 at 06:06:01PM -0400, Bruce Momjian wrote: > On Wed, Oct 10, 2018 at 12:55:33PM -0700, Andres Freund wrote: > > Several people argued for introducing it, you're the only one that was > > against it. Adrien, Amit Kapila, Peter Geoghegan, and I all said we > > think that kind of

Re: Postgres 11 release notes

2018-10-10 Thread Bruce Momjian
On Wed, Oct 10, 2018 at 12:55:33PM -0700, Andres Freund wrote: > Hi, > > On 2018-10-08 21:28:02 -0400, Bruce Momjian wrote: > > On Mon, Oct 8, 2018 at 05:44:32PM +0200, Adrien NAYRAT wrote: > > > On 10/8/18 5:20 PM, Bruce Momjian wrote: > > > >Uh, where are you looking? We don't rebuild the

Re: [HACKERS] SERIALIZABLE with parallel query

2018-10-10 Thread Kevin Grittner
On Mon, Oct 8, 2018 at 9:40 PM Thomas Munro wrote: > Rebased. It applies and builds clean, it passed make world with cassert and TAP tests, and I can't see any remaining flaws. This is true both of just the 0001 v16 patch and that with 0002 v16 applied on top of it. It would be great if

Re: automatic restore point

2018-10-10 Thread Peter Eisentraut
On 05/10/2018 15:26, Peter Eisentraut wrote: > It looked for a moment that > > isCompleteQuery = (context <= PROCESS_UTILITY_QUERY) > > in ProcessUtilitySlow() might be a problem, since that omits > PROCESS_UTILITY_QUERY_NONATOMIC, but it's not actually a problem, since > the commands that

Re: logical decoding bug when mapped relation with toast contents is rewritten repeatedly

2018-10-10 Thread Andres Freund
Hi, On 2018-09-13 19:10:46 -0700, Andres Freund wrote: > (Tomas, CCing you because you IIRC mentioned encountered an issue like > this) > > I just spent quite a while debugging an issue where running logical > decoding yielded a: > ERROR: could not map filenode "base/$X/$Y" to relation OID >

Re: Postgres 11 release notes

2018-10-10 Thread Andres Freund
Hi, On 2018-10-08 21:28:02 -0400, Bruce Momjian wrote: > On Mon, Oct 8, 2018 at 05:44:32PM +0200, Adrien NAYRAT wrote: > > On 10/8/18 5:20 PM, Bruce Momjian wrote: > > >Uh, where are you looking? We don't rebuild the beta docs until the > > >next beta release, but you can see the changes in the

Re: file cloning in pg_upgrade and CREATE DATABASE

2018-10-10 Thread Bruce Momjian
On Tue, Oct 2, 2018 at 11:07:06PM -0300, Alvaro Herrera wrote: > On 2018-Oct-03, Michael Paquier wrote: > > > On Tue, Oct 02, 2018 at 10:35:02PM -0300, Alvaro Herrera wrote: > > > I'm not clear what interface are you proposing. Maybe they would just > > > use the clone-or-fail mode, and note

Question about resource owners

2018-10-10 Thread pgsql
The way we handle resource owners seems a bit inconsistent. * Transactions always have a resource owner (hierarchical for subtransactions). * Portals have resource owners where the parent is the transaction's resource owner. * Some auxiliary processes have one, but if that process were to

Re: Requesting advanced Group By support

2018-10-10 Thread Tom Lane
Andres Freund writes: > On October 10, 2018 10:37:40 AM PDT, Tom Lane wrote: >> Tomas Vondra writes: >>> So, which part of this supposedly does not work in PostgreSQL? >> The part where it infers that b.sno is unique based solely on it having >> been equated to a.sno. > Isn't the spec

Re: Requesting advanced Group By support

2018-10-10 Thread Andres Freund
Hi, On October 10, 2018 10:37:40 AM PDT, Tom Lane wrote: >Tomas Vondra writes: >> On 10/09/2018 03:10 PM, Arun Kumar wrote: >>> *SELECT a.sno,b.sno,a.name,b.location FROM Name AS a JOIN Location >AS b >>> ON a.sno=b.sno GROUP BY a.sno,b.location * >>> >>> In this case, a.sno is a primary

Sv: Re: Requesting advanced Group By support

2018-10-10 Thread Andreas Joseph Krogh
På onsdag 10. oktober 2018 kl. 18:46:15, skrev Tomas Vondra < tomas.von...@2ndquadrant.com >: Hi, On 10/09/2018 03:10 PM, Arun Kumar wrote: > Hi, >  From MySQL 5.7, It supports SQL standard 99 and implements the feature > such functional dependent on the

Re: Requesting advanced Group By support

2018-10-10 Thread Tom Lane
I wrote: > Tomas Vondra writes: >> So, which part of this supposedly does not work in PostgreSQL? > The part where it infers that b.sno is unique based solely on it having > been equated to a.sno. Oh, wait a second: such an inference is actually *wrong* in the general case, or at least

Re: Requesting advanced Group By support

2018-10-10 Thread Tom Lane
Tomas Vondra writes: > On 10/09/2018 03:10 PM, Arun Kumar wrote: >> *SELECT a.sno,b.sno,a.name,b.location FROM Name AS a JOIN Location AS b >> ON a.sno=b.sno GROUP BY a.sno,b.location * >> >> In this case, a.sno is a primary key so no need to include a.name in >> GROUP By as it would be

Re: Proposal for Signal Detection Refactoring

2018-10-10 Thread Chris Travers
On Tue, Oct 9, 2018 at 4:04 PM Peter Eisentraut < peter.eisentr...@2ndquadrant.com> wrote: > On 01/10/2018 14:00, Chris Travers wrote: > > > > > > On Wed, Sep 26, 2018 at 9:54 AM Chris Travers > > wrote: > > > > > > > > On Tue, Sep 25, 2018 at 3:23 PM Tom

Re: Requesting advanced Group By support

2018-10-10 Thread Tomas Vondra
Hi, On 10/09/2018 03:10 PM, Arun Kumar wrote: Hi, From MySQL 5.7, It supports SQL standard 99 and implements the feature such functional dependent on the GROUP By columns, i.e., it detects the non-aggregate columns which are functionally dependent on the GROUP BY columns (not included in

Re: NOTIFY and pg_notify performance when deduplicating notifications

2018-10-10 Thread Catalin Iacob
On Wed, Oct 10, 2018 at 5:42 PM Catalin Iacob wrote: > One way could be to take inspiration from > src/test/isolation/specs/async-notify.spec and check that > pg_notification_queue_usage() does grow when repeating the same > payload with collapse_mode='never' (while for always it would grow).

Re: NOTIFY and pg_notify performance when deduplicating notifications

2018-10-10 Thread Catalin Iacob
On Tue, Oct 9, 2018 at 2:17 PM wrote: > I just caught an error in my patch, it's fixed in the attachment. The 'never' > and 'maybe' collapse modes were mixed up in one location. Here's a partial review of this version, did not read the doc part very carefully. First of all, I agree that this

Re: Index Skip Scan

2018-10-10 Thread Dmitry Dolgov
> On Tue, 9 Oct 2018 at 18:13, Pavel Stehule wrote: > >> It looks like good idea, but then the node should be named "index scan" and >> other info can be displayed in detail parts. It can be similar like "sort". >> The combination of unique and index skip scan looks strange :) > > maybe we don't

Requesting advanced Group By support

2018-10-10 Thread Arun Kumar
Hi, From MySQL 5.7, It supports SQL standard 99 and implements the feature such functional dependent on the GROUP By columns, i.e., it detects the non-aggregate columns which are functionally dependent on the GROUP BY columns (not included in GROUP BY) and then executes the query without

Question regarding SQL-query minimizer

2018-10-10 Thread Jinho Jung
Hello, I am Jinho. Yesterday, I found one interesting SQL statement that actual query execution time took much longer than expected. I also check the result is wrong from EXPLAIN ANALYZE. Current problem is the length of SQL (14KB) when I try to analyze the root cause. If you want to remove

Re: Refactor textToQualifiedNameList()

2018-10-10 Thread Alvaro Herrera
On 2018-Oct-10, Michael Paquier wrote: > On Tue, Oct 09, 2018 at 09:54:12AM -0300, Alvaro Herrera wrote: > > The committer of such a change will get a lot of flak for changing the > > #include requirements for code that calls that function, though. > > So the patch has been switched to

Re: View to get all the extension control file details

2018-10-10 Thread Haribabu Kommi
On Fri, Sep 21, 2018 at 5:09 PM Haribabu Kommi wrote: > On Thu, Sep 20, 2018 at 3:18 PM Kyotaro HORIGUCHI < > horiguchi.kyot...@lab.ntt.co.jp> wrote: > >> Hello. >> >> At Mon, 17 Sep 2018 16:49:41 +1000, Haribabu Kommi < >> kommi.harib...@gmail.com> wrote in >> >> > Hi Hackers, >> > >> >

Re: [HACKERS] [PATCH] Generic type subscripting

2018-10-10 Thread Pavel Stehule
Hi ne 30. 9. 2018 v 8:23 odesílatel Pavel Stehule napsal: > > > ne 30. 9. 2018 v 0:21 odesílatel Dmitry Dolgov <9erthali...@gmail.com> > napsal: > >> > On Fri, 20 Jul 2018 at 23:32, Dmitry Dolgov <9erthali...@gmail.com> >> wrote: >> > >> > > On Thu, 26 Apr 2018 at 16:44, Dmitry Dolgov

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

2018-10-10 Thread Daniel Gustafsson
> On 9 Oct 2018, at 07:38, Michael Paquier wrote: > > On Fri, Oct 05, 2018 at 10:11:45AM +0200, Daniel Gustafsson wrote: >> Thanks! Attached is a v17 which rebases the former 0002 patch on top of >> current master, along with the test fix for Windows that Thomas reported >> upthread (no other

Re: IDE setup and development features?

2018-10-10 Thread Vladimir Sitnikov
Mori>Was wondering if anyone has had luck getting these three set up for any IDE or editor configuration? Just a data point: CLion + CMake work just great. Step by step (just checked in macOS): 1) "Check out from Version Control" -> Git -> https://github.com/stalkerg/postgres_cmake.git -> clone

Re: IDE setup and development features?

2018-10-10 Thread Amit Kapila
On Wed, Oct 10, 2018 at 3:10 AM Mori Bellamy wrote: > > Hi all, > > I'd like a few features when developing postgres -- (1) jump to definition of > symbol (2) find references to symbol and (3) semantic autocompletion. > If you are using a Windows environment, then I think you can get all these

Re: Why we allow CHECK constraint contradiction?

2018-10-10 Thread Amit Langote
On 2018/10/10 16:28, Imai, Yoshikazu wrote: > On Tue, Oct 9, 2018 at 6:01 PM, Amit Langote wrote: >> I had wondered about it when developing the partitioning feature about >> a couple of years ago and this is the response I'd gotten: >> >>

Re: [Proposal] Add accumulated statistics for wait event

2018-10-10 Thread legrand legrand
Bertrand DROUVOT wrote > Hello Guys, > > As you mentioned Oracle like active session history sampling in this > thread, I just want to let you know that I am working on a brand new > extension to provide this feature. > > You can find the extension here: https://github.com/pgsentinel/pgsentinel

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

2018-10-10 Thread Richard Guo
Hi, This is a follow-up to the issue described in thread https://www.postgresql.org/message-id/CAMbWs4-Mys%3DhBQSevTA8Zpd-TYFnb%3DXuHhN2TnktXMsfMUbjiQ%40mail.gmail.com In short, during the first transaction starting phase within a backend, if there is an 'ereport' after setting transaction state

RE: Why we allow CHECK constraint contradiction?

2018-10-10 Thread Imai, Yoshikazu
On Tue, Oct 9, 2018 at 6:01 PM, Amit Langote wrote: > On 2018/10/10 14:25, Imai, Yoshikazu wrote: > > Hi, all. > > > > I have a wonder about the behaviour of creating table which has a > > constraint contradiction. > > > > I created below table. > > > > bugtest=# create table ct (a int, CHECK(a is

Re: IDE setup and development features?

2018-10-10 Thread Mateusz Starzycki
I have also heard god things about rtags but havent used it yet. I have used the YCM and I must say as much as sometimes it is pain to set up right, it is well worth it. On Wed, Oct 10, 2018 at 2:28 AM Tsunakawa, Takayuki < tsunakawa.ta...@jp.fujitsu.com> wrote: > From: Mori Bellamy

RE: Why we allow CHECK constraint contradiction?

2018-10-10 Thread Imai, Yoshikazu
Thanks for replying! On Tue, Oct 9, 2018 at 5:58 PM, Corey Huinker wrote: > On Wed, Oct 10, 2018 at 1:44 AM David G. Johnston > mailto:david.g.johns...@gmail.com> > > wrote: > > > On Tuesday, October 9, 2018, Imai, Yoshikazu > mailto:imai.yoshik...@jp.fujitsu.com> > > wrote: > >

Re: Why we allow CHECK constraint contradiction?

2018-10-10 Thread Amit Langote
On 2018/10/10 14:25, Imai, Yoshikazu wrote: > Hi, all. > > I have a wonder about the behaviour of creating table which has a constraint > contradiction. > > I created below table. > > bugtest=# create table ct (a int, CHECK(a is not null and a >= 0 and a < 100 > and a >= 200 and a < 300)); >