Re: why partition pruning doesn't work?

2018-06-14 Thread David Rowley
On 14 June 2018 at 04:10, Tom Lane wrote: > There's still one thing I'm a bit confused about here. I noticed that > we weren't actually using the partopfamily and partopcintype fields in > PartitionPruneContext, so I removed them. But that still leaves both > partsupfunc and partcollation as

server crashed with TRAP: FailedAssertion("!(!parallel_aware || pathnode->path.parallel_safe)"

2018-06-14 Thread Rajkumar Raghuwanshi
Hi, I am getting a server crash for below test case. postgres=# CREATE TABLE test( c1 int, c2 int, c3 text) partition by range(c1); CREATE TABLE postgres=# create table test_p1 partition of test for values from (minvalue) to (0); CREATE TABLE postgres=# create table test_p2 partition of test for

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

2018-06-14 Thread Marina Polyakova
On 13-06-2018 22:59, Alvaro Herrera wrote: For context: in the backend, elog() is only used for internal messages (i.e. "can't-happen" conditions), and ereport() is used for user-facing messages. There are many things ereport() has that elog() doesn't, such as additional message fields (HINT,

Re: late binding of shared libs for C functions

2018-06-14 Thread Robert Haas
On Tue, Jun 12, 2018 at 8:41 AM, Andrew Dunstan wrote: > UNBOUNDED would be terrible. It does not mean the same thing as UNBOUND. > > Perhaps something like NO CHECK would meet the case, i.e. we're not checking > the link at function creation time. > > I haven't thought through the other

Re: WAL prefetch

2018-06-14 Thread Amit Kapila
On Thu, Jun 14, 2018 at 6:14 PM, Robert Haas wrote: > On Wed, Jun 13, 2018 at 11:45 PM, Amit Kapila wrote: >>> I have tested wal_prefetch at two powerful servers with 24 cores, 3Tb NVME >>> RAID 10 storage device and 256Gb of RAM connected using InfiniBand. >>> The speed of synchronous

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

2018-06-14 Thread Ashutosh Bapat
On Thu, Jun 14, 2018 at 1:54 PM, Amit Langote wrote: > On 2018/06/12 22:22, Ashutosh Bapat wrote: >> -- create triggers, user may create different trigger functions one >> for each partition, unless s/he understands that the tables can share >> trigger functions >> create function trig_t1p1()

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

2018-06-14 Thread Robert Haas
On Mon, Jun 4, 2018 at 5:40 PM, Tom Lane wrote: >> I think, in general, that we should try to pick semantics that make a >> partitioned table behave like an unpartitioned table, provided that >> all triggers are defined on the partitioned table itself. > > Well, then we lose the property Alvaro

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

2018-06-14 Thread Robert Haas
On Wed, Jun 6, 2018 at 7:51 AM, Ashutosh Bapat wrote: > On Tue, Jun 5, 2018 at 10:38 PM, Alvaro Herrera > wrote: > >> - BEFORE row triggers are not supported > > I think this is fine. The existing wording suggests that the user > creates the triggers on the partitioned table, and that will be >

Re: pgsql: Store 2PC GID in commit/abort WAL recs for logical decoding

2018-06-14 Thread Nikhil Sontakke
Hi Heikki, > > Pushed, thanks for the review! > There was a slight oversight in the twophase_gid length calculation in the XactLogCommitRecord() code path in the cf5a1890592 commit. The corresponding XactLogAbortRecord() code path was ok. PFA, a small patch to fix the oversight. Regards,

Re: why partition pruning doesn't work?

2018-06-14 Thread Robert Haas
On Thu, Jun 14, 2018 at 7:23 AM, David Rowley wrote: > However, I only spent about 10 mins looking into this, there may be > some giant holes in the idea. It would need much more research. It kind of flies in the face of the idea that a RangeTblEntry is just a node that can be freely copied

Re: WAL prefetch

2018-06-14 Thread Konstantin Knizhnik
On 14.06.2018 15:44, Robert Haas wrote: On Wed, Jun 13, 2018 at 11:45 PM, Amit Kapila wrote: I have tested wal_prefetch at two powerful servers with 24 cores, 3Tb NVME RAID 10 storage device and 256Gb of RAM connected using InfiniBand. The speed of synchronous replication between two nodes

Re: why partition pruning doesn't work?

2018-06-14 Thread David Rowley
On 14 June 2018 at 19:17, Amit Langote wrote: > I had sent a patch to try to get rid of the open(NoLock) there a couple of > months ago [1]. The idea was to both lock and open the relation in > ExecNonLeafAppendTables, which is the first time all partitioned tables in > a given Append node are

Re: Partitioning with temp tables is broken

2018-06-14 Thread Ashutosh Bapat
On Thu, Jun 14, 2018 at 9:42 AM, Amit Langote wrote: > On 2018/06/14 11:09, Michael Paquier wrote: >> On Wed, Jun 13, 2018 at 10:25:23PM +0530, amul sul wrote: >>> On Wed, Jun 13, 2018, 8:34 PM Tom Lane wrote: Even if you want to argue that there's a use case for these situations, it

Re: Few cosmetic suggestions for commit 16828d5c (Fast Alter Table Add Column...)

2018-06-14 Thread Amit Kapila
On Sun, Jun 3, 2018 at 5:08 AM, Amit Kapila wrote: > Some assorted comments: > > 2. > +/* > + * Structure used to represent value to be used when the attribute is not > + * present at all in a tuple, i.e. when the column was created after the > tuple > + */ > + > +typedef struct attrMissing > +{

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

2018-06-14 Thread Amit Langote
On 2018/06/12 22:22, Ashutosh Bapat wrote: > -- create triggers, user may create different trigger functions one > for each partition, unless s/he understands that the tables can share > trigger functions > create function trig_t1p1() returns trigger as $$ begin return new; > end;$$ language

Re: ON CONFLICT DO NOTHING on pg_dump

2018-06-14 Thread Surafel Temesgen
On Tue, Jun 12, 2018 at 12:05 PM, Ideriha, Takeshi < ideriha.take...@jp.fujitsu.com> wrote: thank you for the review > Hi, > I feel like that on-conflict-do-nothing support is useful especially > coupled with --data-only option. > Only the difference of data can be restored. > > >The attache

Re: Logging transaction IDs for DDL.

2018-06-14 Thread Magnus Hagander
On Thu, Jun 14, 2018 at 12:34 AM, Vik Fearing wrote: > I just noticed a problem with log_statement = 'ddl' and log_line_prefix > containing '%x'. If the statement is the first in the transaction, it > will be logged before it is executed, and more importantly, before a > transaction ID is

Re: Shared access methods?

2018-06-14 Thread Alexander Korotkov
Hi! On Thu, Jun 14, 2018 at 5:37 AM Andres Freund wrote: > Several features in various discussed access methods would benefit from > being able to perform actions when writing out a buffer. As an example, > because it doesn't require understanding any of the new proposed storage > formats, it'd

Re: ntile() throws ERROR when hashagg is false

2018-06-14 Thread David Rowley
On 14 June 2018 at 18:57, Andrew Gierth wrote: > What I think pg is actually doing is taking the value of the ntile() > argument from the first row and using that for the whole partition. > In your example, enabling or disabling hashagg changes the order of the > input rows for the window

Re: SCRAM with channel binding downgrade attack

2018-06-14 Thread Magnus Hagander
On Tue, Jun 12, 2018 at 6:49 AM, Michael Paquier wrote: > On Mon, Jun 11, 2018 at 04:54:45PM +0200, Magnus Hagander wrote: > > I'm wondering if that means we should then also not do it specifically > for > > scram in this version. Otherwise we're likely to end up with a parameter > > that only

question on streaming replication

2018-06-14 Thread Atul Kumar
Hi, I have postgres edb 9.6 version, i have below query to solve it out. i have configured streaming replication having master and slave node on same server just to test it. All worked fine but when i made slave service stop, and create some test databases in master, after then i made slave

Re: Locking B-tree leafs immediately in exclusive mode

2018-06-14 Thread Alexander Korotkov
On Thu, Jun 14, 2018 at 1:01 AM Peter Geoghegan wrote: > On Mon, Jun 11, 2018 at 9:30 AM, Alexander Korotkov > wrote: > > On Mon, Jun 11, 2018 at 1:06 PM Simon Riggs wrote: > >> It's a good idea. How does it perform with many duplicate entries? > > I agree that this is a good idea. It

Re: WAL prefetch

2018-06-14 Thread Robert Haas
On Wed, Jun 13, 2018 at 11:45 PM, Amit Kapila wrote: >> I have tested wal_prefetch at two powerful servers with 24 cores, 3Tb NVME >> RAID 10 storage device and 256Gb of RAM connected using InfiniBand. >> The speed of synchronous replication between two nodes is increased from 56k >> TPS to 60k

Re: [PROPOSAL] Shared Ispell dictionaries

2018-06-14 Thread Arthur Zakirov
On Wed, May 16, 2018 at 02:36:33PM +0300, Arthur Zakirov wrote: > ... I attached the rebased patch. I attached new version of the patch. I found a bug when CompoundAffix, SuffixNodes, PrefixNodes, DictNodes of IspellDictData structure are empty. Now they have terminating entry and therefore they

Re: [GSoC] current working status

2018-06-14 Thread Aleksander Alekseeev
Hello Charles, >The first evaluation is coming. Here is my progress so far. During > the first stage of work, I have implemented the thrift binary > protocol as the format of postgresql plugin. Currently, the main > interface is byte. Users who use this plugin need to provide thrift > bytes

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

2018-06-14 Thread Marina Polyakova
On 13-06-2018 22:44, Fabien COELHO wrote: Hello Marina, I suppose that this is related; because of my patch there may be a lot of such code (see v7 in [1]): - fprintf(stderr, - "malformed variable \"%s\" value: \"%s\"\n", -

Re: Few cosmetic suggestions for commit 16828d5c (Fast Alter Table Add Column...)

2018-06-14 Thread Alvaro Herrera
On 2018-Jun-14, Amit Kapila wrote: > On Sun, Jun 3, 2018 at 5:08 AM, Amit Kapila wrote: > > 2. > > +/* > > + * Structure used to represent value to be used when the attribute is not > > + * present at all in a tuple, i.e. when the column was created after the > > tuple > > + */ > > + > >

Re: commitfest 2018-07

2018-06-14 Thread Andrew Dunstan
On 06/07/2018 09:01 AM, Ashutosh Bapat wrote: On Thu, Jun 7, 2018 at 8:38 AM, Jonathan S. Katz wrote: On Jun 6, 2018, at 8:14 PM, Michael Paquier wrote: On Wed, Jun 06, 2018 at 12:40:40PM -0400, Andrew Dunstan wrote: I'll volunteer for CFM, which seems appropriate since I was one of the

Re: Index maintenance function for BRIN doesn't check RecoveryInProgress()

2018-06-14 Thread Alvaro Herrera
On 2018-Jun-14, Michael Paquier wrote: > On Thu, Jun 14, 2018 at 02:06:57AM +0900, Masahiko Sawada wrote: > > On Thu, Jun 14, 2018 at 12:04 AM, Simon Riggs wrote: > >> On 13 June 2018 at 15:51, Alvaro Herrera wrote: > >>> I guess you could go either way ... we're just changing one unhelpful >

Re: [GSoC] current working status

2018-06-14 Thread Aleksander Alekseeev
Hello Charles, >I saw the list of errors you posted. That's because I have some new > function implemented and pushed without testing(in order forget my > change in local machine). > So you are saying it is best to keep each commit workable. Right? Ideally, yes. You can always create a

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

2018-06-14 Thread Rui DeSousa
> On Jun 14, 2018, at 9:19 AM, Robert Haas wrote: > > anyone who wants a BEFORE trigger has a good reason > for wanting it. I have used before triggers to enforce the immutability of a column. i.e. if (new.member_key != old.member_key) then raise exception 'Unable to change

Re: server crashed with TRAP: FailedAssertion("!(!parallel_aware || pathnode->path.parallel_safe)"

2018-06-14 Thread Tom Lane
I wrote: > This appears to be the fault of commit ab7271677, whose authors I've cc'd: > the stanza starting at about allpaths.c:1672 is bullheadedly creating a > parallel path whether that's allowed or not. Fixing it might be as simple > as adding "rel->consider_parallel" to the conditions there.

Re: Shared access methods?

2018-06-14 Thread Andres Freund
On 2018-06-14 15:59:22 +0300, Alexander Korotkov wrote: > > b) extensions containing AMs would need to do something INSERT ... ON > >CONFLICT DO NOTHING like. > > We already have CREATE ACCESS METHOD command. I think this command > should handle that internally. And I don't understand why

Re: commitfest 2018-07

2018-06-14 Thread Stephen Frost
Greetings, * Andrew Dunstan (andrew.duns...@2ndquadrant.com) wrote: > Well, this went quiet. I'm happy to be CFM and assisted by Michael and > Ashutosh > > Are there any privileges required that I should see about obtaining? I've set you up with the cf admin privs (which Michael also has).

Re: Locking B-tree leafs immediately in exclusive mode

2018-06-14 Thread Claudio Freire
On Thu, Jun 14, 2018 at 9:44 AM Alexander Korotkov wrote: > > > Our B-tree is currently maintaining duplicates unordered. So, during > > > insertion > > > we can traverse rightlinks in order to find page, which would fit new > > > index tuple. > > > However, in this case we're traversing pages

Re: Partitioning with temp tables is broken

2018-06-14 Thread Tom Lane
Ashutosh Bapat writes: > If I am reading Tom's reply upthread correctly, we should not allow > creating a temporary partitioned table as well as temporary partitions > altogether. I think that if possible, we should still allow a partitioned table in which all the rels are temp tables of the

Re: [GSoC] current working status

2018-06-14 Thread Charles Cui
good idea, will keep a feature branch, and set up ci. On Thu, Jun 14, 2018, 8:03 AM Aleksander Alekseeev < a.aleks...@postgrespro.ru> wrote: > Hello Charles, > > >I saw the list of errors you posted. That's because I have some new > > function implemented and pushed without testing(in order

Re: Locking B-tree leafs immediately in exclusive mode

2018-06-14 Thread Alexander Korotkov
On Thu, Jun 14, 2018 at 6:32 PM Peter Geoghegan wrote: > On Thu, Jun 14, 2018 at 5:43 AM, Alexander Korotkov > wrote: > > However, that doesn't > > look like inevitable shortcoming, because we could store heap TID in > > t_tid of pivot index tuples. > > But the offset doesn't have enough space

Re: Expression errors with "FOR UPDATE" and postgres_fdw with partition wise join enabled.

2018-06-14 Thread Ashutosh Bapat
On Mon, Jun 11, 2018 at 4:05 PM, Etsuro Fujita wrote: > (2018/06/07 19:42), Ashutosh Bapat wrote: >> >> On Wed, Jun 6, 2018 at 5:00 PM, Etsuro Fujita >> wrote: >>> >>> Since I'm not 100% sure that that is the right way to go, I've been >>> rethinking how to fix this issue. Yet another idea I

Re: why partition pruning doesn't work?

2018-06-14 Thread Tom Lane
Robert Haas writes: > On Thu, Jun 14, 2018 at 7:23 AM, David Rowley > wrote: >> However, I only spent about 10 mins looking into this, there may be >> some giant holes in the idea. It would need much more research. > It kind of flies in the face of the idea that a RangeTblEntry is just > a

Re: [GSoC] current working status

2018-06-14 Thread Charles Cui
Hi Aleksander, I saw the list of errors you posted. That's because I have some new function implemented and pushed without testing(in order forget my change in local machine). So you are saying it is best to keep each commit workable. Right? Thanks Charles. 2018-06-14 1:41 GMT-07:00

Re: ntile() throws ERROR when hashagg is false

2018-06-14 Thread Tom Lane
David Rowley writes: > On 14 June 2018 at 18:57, Andrew Gierth wrote: >> What I think pg is actually doing is taking the value of the ntile() >> argument from the first row and using that for the whole partition. Yes, easily verified by looking at window_ntile(): the argument is only examined

Re: AtEOXact_ApplyLauncher() and subtransactions

2018-06-14 Thread Alvaro Herrera
On 2018-Jun-05, Amit Khandekar wrote: > When a SUBSCRIPTION is altered, then the currently running > table-synchronization workers that are no longer needed for the > altered subscription, are terminated. This is done by the function > AtEOXact_ApplyLauncher() inside CommitTransaction(). So

Re: Microoptimization of Bitmapset usage in postgres_fdw

2018-06-14 Thread Nathan Bossart
The following review has been posted through the commitfest application: make installcheck-world: not tested Implements feature: not tested Spec compliant: not tested Documentation:not tested Hello, The v2 patches look good to me. However, I found a couple other

Re: server crashed with TRAP: FailedAssertion("!(!parallel_aware || pathnode->path.parallel_safe)"

2018-06-14 Thread Tom Lane
Rajkumar Raghuwanshi writes: > I am getting a server crash for below test case. > postgres=# CREATE TABLE test( c1 int, c2 int, c3 text) partition by > range(c1); > CREATE TABLE > postgres=# create table test_p1 partition of test for values from > (minvalue) to (0); > CREATE TABLE > postgres=#

Re: WAL prefetch

2018-06-14 Thread Konstantin Knizhnik
On 14.06.2018 16:25, Robert Haas wrote: On Thu, Jun 14, 2018 at 9:23 AM, Konstantin Knizhnik wrote: Speed of random HDD access is limited by speed of disk head movement. By running several IO requests in parallel we just increase probability of head movement, so actually parallel access to

Re: Locking B-tree leafs immediately in exclusive mode

2018-06-14 Thread Alexander Korotkov
On Thu, Jun 14, 2018 at 4:56 PM Claudio Freire wrote: > Not at all. Insertion cost in unique indexes with lots of duplicates > (happens, dead duplicates) grows quadratically on the number of > duplicates, and that's improved by making the index unique and sorted. Sorry, I've messed up the terms.

Re: WAL prefetch

2018-06-14 Thread Robert Haas
On Thu, Jun 14, 2018 at 9:23 AM, Konstantin Knizhnik wrote: > Speed of random HDD access is limited by speed of disk head movement. > By running several IO requests in parallel we just increase probability of > head movement, so actually parallel access to HDD may even decrease IO speed > rather

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

2018-06-14 Thread Ashutosh Bapat
On Thu, Jun 14, 2018 at 6:49 PM, Robert Haas wrote: > On Wed, Jun 6, 2018 at 7:51 AM, Ashutosh Bapat > wrote: >> On Tue, Jun 5, 2018 at 10:38 PM, Alvaro Herrera >> wrote: >> >>> - BEFORE row triggers are not supported >> >> I think this is fine. The existing wording suggests that the user >>

Re: Locking B-tree leafs immediately in exclusive mode

2018-06-14 Thread Peter Geoghegan
On Thu, Jun 14, 2018 at 5:43 AM, Alexander Korotkov wrote: > Could you, please, clarify what do you mean by "fan-in"? As I > understood, higher "fan-in" means more children on single non-leaf > page, and in turn "better branching". Is my understanding correct? Yes, your understanding is

Re: [Proposal] Table-level Transparent Data Encryption (TDE) and Key Management Service (KMS)

2018-06-14 Thread Masahiko Sawada
On Wed, Jun 13, 2018 at 10:20 PM, Joe Conway wrote: > On 06/11/2018 05:22 AM, Masahiko Sawada wrote: >> As per discussion at PGCon unconference, I think that firstly we need >> to discuss what threats we want to defend database data against. > > Exactly. While certainly there is demand for

Re: Fix some error handling for read() and errno

2018-06-14 Thread Robert Haas
On Mon, Jun 11, 2018 at 6:11 PM, Alvaro Herrera wrote: > I would go as far as suggesting to remove qualifiers that indicate what > the file is for (such as "relation mapping file"); relying on the path > as indicator of what's going wrong should be sufficient, since it's an > error that affects

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

2018-06-14 Thread Peter Geoghegan
I've been thinking about using heap TID as a tie-breaker when comparing B-Tree index tuples for a while now [1]. I'd like to make all tuples at the leaf level unique, as assumed by L This can enable "retail index tuple deletion", which I think we'll probably end up implementing in some form or

Re: Microoptimization of Bitmapset usage in postgres_fdw

2018-06-14 Thread Daniel Gustafsson
> On 14 Jun 2018, at 16:56, Nathan Bossart wrote: > The v2 patches look good to me. However, I found a couple other > places where we might be able to use this micro-optimization. Thanks a lot for your review! > 1) dependencies_clauselist_selectivity() in dependencies.c > > /* >

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

2018-06-14 Thread Daniel Gustafsson
> On 13 Jun 2018, at 21:16, Andres Freund wrote: Thanks for the review! > I'm not sure I really like the appending bit. There's a security > argument to be made about doing so, but from a user POV that mostly > seems restrictive. I wonder if that aspect would be better handled by > adding an

Re: Microoptimization of Bitmapset usage in postgres_fdw

2018-06-14 Thread Bossart, Nathan
Thanks for the updated patch set. On 6/14/18, 2:34 PM, "Daniel Gustafsson" wrote: >> 2) BuildRelationExtStatistics() in extended_stats.c. >> >> /* check allowed number of dimensions */ >> Assert(bms_num_members(stat->columns) >= 2 && >> bms_num_members(stat->columns)

Re: Portability concerns over pq_sendbyte?

2018-06-14 Thread Andres Freund
Hi, On 2018-06-14 16:17:28 -0400, Tom Lane wrote: > Alvaro Herrera writes: > > How about not renaming the functions, but just change argument types? Yea, I'm in favor of this. I don't think the 'u' in there would benefit us, and the cast from signed to unsigned is well defined, so it's safe to

Re: Few cosmetic suggestions for commit 16828d5c (Fast Alter Table Add Column...)

2018-06-14 Thread Andrew Dunstan
Somehow I missed this thread ... On 06/14/2018 02:01 PM, Alvaro Herrera wrote: On 2018-Jun-14, Amit Kapila wrote: On Sun, Jun 3, 2018 at 5:08 AM, Amit Kapila wrote: 2. +/* + * Structure used to represent value to be used when the attribute is not + * present at all in a tuple, i.e. when

Re: Portability concerns over pq_sendbyte?

2018-06-14 Thread Tom Lane
Alvaro Herrera writes: > How about not renaming the functions, but just change argument types? Yeah, I didn't understand why anything else would be on the table. We already changed their arg types for 11, no? This is just second thoughts about what to change them to.

Re: Shared access methods?

2018-06-14 Thread Alvaro Herrera
On 2018-Jun-14, Andres Freund wrote: > But I do think there's a few things that are doable without actually > needing to invoke any user defined code aside of the AM code > itself. E.g. heap pruning / aggressively setting hint bits doesn't need > to invoke operators, and I can think of some ways

Re: WAL prefetch

2018-06-14 Thread Stephen Frost
Greetings, * Konstantin Knizhnik (k.knizh...@postgrespro.ru) wrote: > There was very interesting presentation at pgconf about pg_prefaulter: > > http://www.pgcon.org/2018/schedule/events/1204.en.html I agree and I've chatted a bit w/ Sean further about it. > But it is implemented in GO and

Re: Attempt to fix inheritance limitations: unique and foreign key constraints

2018-06-14 Thread Robert Haas
On Tue, Jun 12, 2018 at 11:28 AM, Raphael Medaer wrote: > Hi pg-hackers, > > I'm trying to fix some of limitations in table inheritance. My first use > case concerns "referencing" foreign keys in parent table. > > The attached patch propagates foreign keys to inherited tables. I'm > automatically

Re: Portability concerns over pq_sendbyte?

2018-06-14 Thread Alvaro Herrera
Hello How about not renaming the functions, but just change argument types? Having to change all callsites to cope with some new naming convention does not strike me as a great idea ... it may collide with any backpatching in the area, for one. -- Álvaro Herrera

Re: Shared access methods?

2018-06-14 Thread Tom Lane
Andres Freund writes: > On 2018-06-14 15:59:22 +0300, Alexander Korotkov wrote: >> We already have CREATE ACCESS METHOD command. I think this command >> should handle that internally. And I don't understand why "ON >> CONFLICT DO NOTHING". If AM with given name already exists in pg_am, >> why

Re: BUG #15237: I got "ERROR: source for a multiple-column UPDATE item must be a sub-SELECT or ROW() expression"

2018-06-14 Thread Robert Haas
On Wed, Jun 13, 2018 at 12:48 AM, Andrew Gierth wrote: > The original patch, a self-described "lazy-sunday project", made > absolutely no mention of any compatibility issue, simply discussed the > new options it was allowing, and got no feedback or review. Had it > mentioned or even hinted that

Re: Transform for pl/perl

2018-06-14 Thread Alvaro Herrera
On 2018-Jun-08, Tom Lane wrote: > I wrote: > > I'm inclined to think that auto-dereference is indeed a good idea, > > and am tempted to go make that change to make all this consistent. > > Comments? > > Here's a draft patch for that. I ended up only changing > plperl_sv_to_datum. There is

Re: [GSoC] current working status

2018-06-14 Thread Charles Cui
Hi mentors, The repo currently can be build on my mac. You can check it out. Also I am working on the CI config to monitor each commit. Thanks 2018-06-14 8:29 GMT-07:00 Charles Cui : > good idea, will keep a feature branch, and set up ci. > > On Thu, Jun 14, 2018, 8:03 AM Aleksander

Re: Partitioning with temp tables is broken

2018-06-14 Thread Amit Langote
On 2018/06/14 23:42, Tom Lane wrote: > Ashutosh Bapat writes: >> If I am reading Tom's reply upthread correctly, we should not allow >> creating a temporary partitioned table as well as temporary partitions >> altogether. > > I think that if possible, we should still allow a partitioned table >

Bogus dependency calculation for expressions involving casts

2018-06-14 Thread Tom Lane
I've identified the underlying cause of the misbehavior reported in https://www.postgresql.org/message-id/7cb957dd12774a52ac8a680b73910...@imaginesoftware.com and it's a bit embarrassing: we're doing dependency logging for casts all wrong. A cast expression produces a FuncExpr parse node, which

Re: Partitioning with temp tables is broken

2018-06-14 Thread Amit Langote
On 2018/06/14 22:11, Ashutosh Bapat wrote: > On Thu, Jun 14, 2018 at 9:42 AM, Amit Langote >> I'm attaching a patch here to forbid adding a temporary table as partition >> of permanent table. I didn't however touch the feature that allows *all* >> members in a partition tree to be temporary

Re: BUG #15237: I got "ERROR: source for a multiple-column UPDATE item must be a sub-SELECT or ROW() expression"

2018-06-14 Thread Justin Pryzby
On Wed, Jun 13, 2018 at 05:48:50AM +0100, Andrew Gierth wrote: > It then apparently went unnoticed until after the release of pg 10, at > which point it got retroactively documented (in the release notes and > nowhere else), in response to a brief discussion of a user complaint > that happened on

Re: Partitioning with temp tables is broken

2018-06-14 Thread David Rowley
On 15 June 2018 at 02:42, Tom Lane wrote: > I think that if possible, we should still allow a partitioned table > in which all the rels are temp tables of the current session. What we > have to disallow is (a) temp/permanent mixes and (b) temp tables from > different sessions. So, this used to

Re: Partitioning with temp tables is broken

2018-06-14 Thread Tom Lane
David Rowley writes: > On 15 June 2018 at 02:42, Tom Lane wrote: >> I think that if possible, we should still allow a partitioned table >> in which all the rels are temp tables of the current session. What we >> have to disallow is (a) temp/permanent mixes and (b) temp tables from >> different

Re: BUG #15237: I got "ERROR: source for a multiple-column UPDATE item must be a sub-SELECT or ROW() expression"

2018-06-14 Thread Andrew Gierth
> "Justin" == Justin Pryzby writes: >> It then apparently went unnoticed until after the release of pg 10, >> at which point it got retroactively documented (in the release notes >> and nowhere else), in response to a brief discussion of a user >> complaint that happened on -general and

Re: automating perl compile time checking

2018-06-14 Thread Peter Eisentraut
On 6/11/18 16:06, Andrew Dunstan wrote: > This affects pretty much nothing. In fact some of the other changes I've > recently committed were arguably more dangerous. Do you want me to > revert the whole lot? No, but this whole let's clean up the Perl code initiative seemed to have come out of

RE: ON CONFLICT DO NOTHING on pg_dump

2018-06-14 Thread Ideriha, Takeshi
Hi, >-Original Message- >From: Surafel Temesgen [mailto:surafel3...@gmail.com] >thank you for the review > > Do you have any plan to support on-conlict-do-update? Supporting this > seems >to me complicated and take much time so I don't mind not implementing this. > > >i agree its

RE: ON CONFLICT DO NOTHING on pg_dump

2018-06-14 Thread Ideriha, Takeshi
>-Original Message- >From: Nico Williams [mailto:n...@cryptonector.com] >On Tue, Jun 12, 2018 at 09:05:23AM +, Ideriha, Takeshi wrote: >> >From: Surafel Temesgen [mailto:surafel3...@gmail.com] >> >Subject: ON CONFLICT DO NOTHING on pg_dump >> >> >Sometimes I have to maintain two

Re: ntile() throws ERROR when hashagg is false

2018-06-14 Thread Andrew Gierth
> "Tom" == Tom Lane writes: >> I wonder if it would be worth adding a run-time check in >> window_ntile() that causes an ERROR on first call if there are any >> Vars or PARAM_EXEC Params in the function argument. An ERROR might >> be better than doing something that the user does not

Re: WAL prefetch

2018-06-14 Thread Amit Kapila
On Fri, Jun 15, 2018 at 12:16 AM, Stephen Frost wrote: > >> I have tested wal_prefetch at two powerful servers with 24 cores, 3Tb NVME >> RAID 10 storage device and 256Gb of RAM connected using InfiniBand. >> The speed of synchronous replication between two nodes is increased from 56k >> TPS to

Re: AtEOXact_ApplyLauncher() and subtransactions

2018-06-14 Thread Peter Eisentraut
On 6/5/18 07:02, Amit Khandekar wrote: > I haven't written a patch for it, but I think we should have a > separate on_commit_stop_workers for eachyou get subtransaction. At > subtransaction commit, we replace the on_commit_stop_workers list of > the parent subtransaction with the one from the

Re: Few cosmetic suggestions for commit 16828d5c (Fast Alter Table Add Column...)

2018-06-14 Thread Amit Kapila
On Fri, Jun 15, 2018 at 12:54 AM, Andrew Dunstan wrote: > > On 06/14/2018 02:01 PM, Alvaro Herrera wrote: >> >> On 2018-Jun-14, Amit Kapila wrote: >> >>> On Sun, Jun 3, 2018 at 5:08 AM, Amit Kapila >>> wrote: 2. +/* + * Structure used to represent value to be used when the

Re: WAL prefetch

2018-06-14 Thread Konstantin Knizhnik
On 14.06.2018 09:52, Thomas Munro wrote: On Thu, Jun 14, 2018 at 1:09 AM, Konstantin Knizhnik wrote: pg_wal_prefetch function will infinitely traverse WAL and prefetch block references in WAL records using posix_fadvise(WILLNEED) system call. Hi Konstantin, Why stop at the page cache...

Re: why partition pruning doesn't work?

2018-06-14 Thread Amit Langote
On 2018/06/13 23:39, Tom Lane wrote: > Robert Haas writes: >> Seems reasonable. Really, I think we should look for a way to hang >> onto the relation at the point where it's originally opened and locked >> instead of reopening it here. But that's probably more invasive than >> we can really

Re: Needless additional partition check in INSERT?

2018-06-14 Thread Amit Langote
On 2018/06/09 3:41, Alvaro Herrera wrote: > BTW, while working on this, I was a bit disturbed by the > execReplication.c changes (namely: if the partitioning is not identical > on both sides, things are likely to blow up pretty badly), but that's a > separate topic. Hmm, yes. If the partition of

ntile() throws ERROR when hashagg is false

2018-06-14 Thread Rajkumar Raghuwanshi
Hi ntile() throws ERROR when hashagg is false, test case given below. postgres=# create table foo (a int, b int, c text); CREATE TABLE postgres=# insert into foo select i%20, i%30, to_char(i%12, 'FM') from generate_series(0, 36) i; INSERT 0 37 postgres=# explain select ntile(a) OVER () from

Re: WAL prefetch

2018-06-14 Thread Thomas Munro
On Thu, Jun 14, 2018 at 1:09 AM, Konstantin Knizhnik wrote: > pg_wal_prefetch function will infinitely traverse WAL and prefetch block > references in WAL records > using posix_fadvise(WILLNEED) system call. Hi Konstantin, Why stop at the page cache... what about shared buffers? -- Thomas

Re: ntile() throws ERROR when hashagg is false

2018-06-14 Thread Andrew Gierth
> "Rajkumar" == Rajkumar Raghuwanshi > writes: Rajkumar> Hi Rajkumar> ntile() throws ERROR when hashagg is false, test case given Rajkumar> below. Rajkumar> postgres=# create table foo (a int, b int, c text); Rajkumar> CREATE TABLE Rajkumar> postgres=# insert into foo select

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

2018-06-14 Thread Ashutosh Bapat
On Tue, Jun 12, 2018 at 8:49 AM, Kyotaro HORIGUCHI wrote: > Thanks for the discussion. > > At Thu, 7 Jun 2018 19:16:57 +0530, Ashutosh Bapat > wrote in > >> On Tue, Jun 5, 2018 at 3:40 PM, Kyotaro HORIGUCHI >> wrote: >> > Hello. >> > >> > At Mon, 04 Jun 2018 20:58:28 +0900 (Tokyo Standard