Re: [HACKERS] Parallel Hash take II

2017-12-21 Thread Andres Freund
Hi, > > Not really happy with the name. ExecParallelHashTableInsert() calling > > ExecParallelHashLoadTuple() to insert a tuple into the hashtable doesn't > > quite strike me as right; the naming similarity to > > ExecParallelHashTableLoad seems problematic too. > > ExecParallelHashAllocTuple() or

Re: [HACKERS] Runtime Partition Pruning

2017-12-21 Thread David Rowley
On 19 December 2017 at 21:54, Beena Emerson wrote: > PFA the updated patch. Hi Beena, Thanks for updating the patch. I've merged a chunk of your latest patch with what I was working on and cleaned up some mistakes that I had made in my WIP version. I've now done the work to make this work with

Re: Cost Model

2017-12-21 Thread Neto BR
2017-12-20 17:32 GMT-02:00 David G. Johnston : > On Wed, Dec 20, 2017 at 12:26 PM, neto brpr wrote: > >> >> About what you said, that some settings can be configured by Tablespace? >> I have already seen this in IBM DB2, but in Postgresql as far as I know, >> for example the Random_page_cost and

Re: [HACKERS] Proposal: Local indexes for partitioned table

2017-12-21 Thread Jesper Pedersen
Hi Alvaro, On 12/20/2017 04:25 PM, Alvaro Herrera wrote: I modified the regression test so that a partitioning hierarchy would be left behind after the test is run, which is useful to test pg_upgrade and pg_dump -- this caught one small bug. That and some reading of the diff resulted in v8, att

Re: Cost Model

2017-12-21 Thread Ashutosh Bapat
On Thu, Dec 21, 2017 at 3:09 PM, Neto BR wrote: > > > 2017-12-20 17:32 GMT-02:00 David G. Johnston : > >> On Wed, Dec 20, 2017 at 12:26 PM, neto brpr wrote: >> >>> >>> About what you said, that some settings can be configured by Tablespace? >>> I have already seen this in IBM DB2, but in Postgre

Fix permissions check on pg_stat_get_wal_senders

2017-12-21 Thread Feike Steenbergen
Fix permissions check on pg_stat_get_wal_senders Commit 25fff40798fc4ac11a241bfd9ab0c45c085e2212 introduced the possibility for the pg_read_all_stats to have access to all pg_stat_* views. In the discussion, the pg_stat_replication and pg_stat_wal_receiver views were also considered to be part of

Re: [HACKERS] Runtime Partition Pruning

2017-12-21 Thread Beena Emerson
Hello David, On Thu, Dec 21, 2017 at 2:31 PM, David Rowley wrote: > On 19 December 2017 at 21:54, Beena Emerson wrote: > The problem is down to the logic in choose_custom_plan() only choosing > a generic plan if the average cost of the generic plan is less than > the average custom plan cost.

condition variable cleanup and subtransactions

2017-12-21 Thread Andres Freund
Hi, On 2017-12-21 02:42:25 -0800, Andres Freund wrote: > Trying to debug this I found another issue. I'd placed a sleep(10) in > ExecParallelHashCloseBatchAccessors() and then ctrl-c'ed the server for > some reason. Segfault time: > > #0 0x55bfbac42539 in tas (lock=0x7fcd82ae14ac memory at

Enhance pg_stat_wal_receiver view to display connected host

2017-12-21 Thread Haribabu Kommi
Hi Hackers, With the multi host connection string feature, it is possible to specify multiple hosts in primary_conninfo that is used in streaming replication to make sure that WAL streaming is not affected. Currently there is no information that is available in the standby node to find out to whi

Re: [HACKERS] path toward faster partition pruning

2017-12-21 Thread David Rowley
On 21 December 2017 at 23:38, Amit Langote wrote: > On 2017/12/20 17:27, Amit Langote wrote: > I think I was able to make this work and in the process of making it work, > also came to the conclusion that this could be made to work sensibly > *only* for list partitioned tables. That's because one

Re: [HACKERS] parallel.c oblivion of worker-startup failures

2017-12-21 Thread Amit Kapila
On Thu, Dec 21, 2017 at 2:39 AM, Robert Haas wrote: > On Tue, Dec 19, 2017 at 11:28 PM, Amit Kapila wrote: >> That is not the main point I am bothered about. I am concerned that >> the patch proposed by you can lead to hang if there is a crash (abrupt >> failure like proc_exit(1)) after attachin

Re: condition variable cleanup and subtransactions

2017-12-21 Thread Thomas Munro
On Fri, Dec 22, 2017 at 12:00 AM, Andres Freund wrote: > Oh. This seems to be a condition variable bug independent of PHJ. The > problem is that the DSM segment etc all get cleaned up in > *subtransaction* abort. > > Afaict it's a bug that AbortTransaction() does > ConditionVariableCancelSleep() b

Re: [HACKERS] path toward faster partition pruning

2017-12-21 Thread David Rowley
On 21 December 2017 at 23:38, Amit Langote wrote: > Attached updated set of patches. Looks like the new not equals code does not properly take into account a missing NULL partition. create table ta (a int not null) partition by list (a); create table ta1 partition of ta for values in(1,2); creat

Re: Enhance pg_stat_wal_receiver view to display connected host

2017-12-21 Thread Michael Paquier
On Thu, Dec 21, 2017 at 8:16 PM, Haribabu Kommi wrote: > The current connected host details are already available in the PGconn > structure, > Exposing those details in the view will suffice this requirement. Currently > these > members are characters pointers, I used them as it is and displayed t

Re: [HACKERS] Runtime Partition Pruning

2017-12-21 Thread David Rowley
On 21 December 2017 at 23:51, Beena Emerson wrote: > On Thu, Dec 21, 2017 at 2:31 PM, David Rowley > wrote: >> On 19 December 2017 at 21:54, Beena Emerson wrote: > >> The problem is down to the logic in choose_custom_plan() only choosing >> a generic plan if the average cost of the generic plan

Re: [HACKERS] Runtime Partition Pruning

2017-12-21 Thread Beena Emerson
Hello, On Thu, Dec 21, 2017 at 6:01 PM, David Rowley wrote: > On 21 December 2017 at 23:51, Beena Emerson wrote: >> On Thu, Dec 21, 2017 at 2:31 PM, David Rowley >> wrote: >>> On 19 December 2017 at 21:54, Beena Emerson wrote: >> >>> The problem is down to the logic in choose_custom_plan() onl

Re: General purpose hashing func in pgbench

2017-12-21 Thread Fabien COELHO
Add the submission to the next CF? I think it is not commitfest ready yet -- I need to add some documentation and tests first. It just helps to that the thread is referenced, and the review process has started anyway. -- Fabien.

Re: [HACKERS] Runtime Partition Pruning

2017-12-21 Thread David Rowley
On 21 December 2017 at 22:01, David Rowley wrote: > I've attached the latest version of the patch. This is based > on Amit's v15 of faster-partition-pruning [1] which I found to cleanly > apply to f94eec490 Well, that went out of date pretty quickly. Amit has now posted v16 of the faster partitio

Re: [HACKERS] parallel.c oblivion of worker-startup failures

2017-12-21 Thread Robert Haas
On Thu, Dec 21, 2017 at 6:46 AM, Amit Kapila wrote: > What if we don't allow to reuse such slots till the backend/session > that has registered it performs unregister? Currently, we don't seem > to have an API corresponding to Register*BackgroundWorker() which can > be used to unregister, but may

Re: [HACKERS] Runtime Partition Pruning

2017-12-21 Thread David Rowley
On 22 December 2017 at 01:43, Beena Emerson wrote: >> I wonder if Robert understands the extent of the problem. The patch >> will be useful to prune away partitions when the partitioned table is >> on the inside of a parameterised nested loop join, but I think we'll >> likely get some complaints a

Re: General purpose hashing func in pgbench

2017-12-21 Thread Ildar Musin
21/12/2017 15:44, Fabien COELHO пишет: > >>> Add the submission to the next CF? >> I think it is not commitfest ready yet -- I need to add some >> documentation and tests first. > > It just helps to that the thread is referenced, and the review process > has started anyway. > You are right, I've su

Re: [HACKERS] Runtime Partition Pruning

2017-12-21 Thread Beena Emerson
Hello, On Thu, Dec 21, 2017 at 6:30 PM, David Rowley wrote: > On 22 December 2017 at 01:43, Beena Emerson wrote: >>> I wonder if Robert understands the extent of the problem. The patch >>> will be useful to prune away partitions when the partitioned table is >>> on the inside of a parameterised

Re: Fix permissions check on pg_stat_get_wal_senders

2017-12-21 Thread Michael Paquier
On Thu, Dec 21, 2017 at 7:30 PM, Feike Steenbergen wrote: > Fix permissions check on pg_stat_get_wal_senders > > Commit 25fff40798fc4ac11a241bfd9ab0c45c085e2212 introduced the > possibility for the pg_read_all_stats to have access to all pg_stat_* > views. > In the discussion, the pg_stat_replicat

Re: Reproducible builds: genbki.pl and Gen_fmgrtab.pl

2017-12-21 Thread Andrew Dunstan
On 12/20/2017 09:50 PM, Tom Lane wrote: > Christoph Berg writes: >> Re: Tom Lane 2017-12-16 <417.1513438...@sss.pgh.pa.us> >>> I think we're talking at cross-purposes. I'm not saying we should not fix >>> this problem. I'm saying that the proposed fix appears incomplete ... >> Grepping through

Re: Postgres with pthread

2017-12-21 Thread Konstantin Knizhnik
I continue experiments with my pthread prototype. Latest results are the following: 1. I have eliminated all (I hope) calls of non-reentrant functions (getopt, setlocale, setitimer, localtime, ...). So now parallel tests are passed. 2. I have implemented deallocation of top memory context (at

Re: Reproducible builds: genbki.pl and Gen_fmgrtab.pl

2017-12-21 Thread Michael Paquier
On Thu, Dec 21, 2017 at 10:13 PM, Andrew Dunstan wrote: > Looks reasonable. Regarding the change to TestLib.pm, we should make > sure that the tests have unique names. There is a small amount of > duplication currently: > > ./src/bin/pg_dump/t/001_basic.pl > ./src/bin/pg_rewind/t/001_basic

Re: [HACKERS] Runtime Partition Pruning

2017-12-21 Thread David Rowley
On 22 December 2017 at 02:06, Beena Emerson wrote: >> Thanks for sending. Will the tests still pass if you remove the hack >> from choose_custom_plan()? >> > > The hack has been removed in the v7 patch sent and yes the tests work > without any additional adjustments. Oh nice. I see you've includ

Re: Reproducible builds: genbki.pl and Gen_fmgrtab.pl

2017-12-21 Thread Andrew Dunstan
On 12/21/2017 08:27 AM, Michael Paquier wrote: > On Thu, Dec 21, 2017 at 10:13 PM, Andrew Dunstan > wrote: >> Looks reasonable. Regarding the change to TestLib.pm, we should make >> sure that the tests have unique names. There is a small amount of >> duplication currently: >> >> ./src/bin/pg

Re: Basebackups reported as idle

2017-12-21 Thread Magnus Hagander
On Thu, Dec 21, 2017 at 1:38 AM, Michael Paquier wrote: > On Wed, Dec 20, 2017 at 9:02 PM, Magnus Hagander > wrote: > > On Wed, Dec 20, 2017 at 12:50 PM, Michael Paquier > > wrote: > > Yes. Of course. I can't read. That's the same as the notice below about > it > > not returning false -- I mana

Re: Postgres with pthread

2017-12-21 Thread Pavel Stehule
2017-12-21 14:25 GMT+01:00 Konstantin Knizhnik : > I continue experiments with my pthread prototype. > Latest results are the following: > > 1. I have eliminated all (I hope) calls of non-reentrant functions > (getopt, setlocale, setitimer, localtime, ...). So now parallel tests are > passed. > >

Re: The pg_indent on on ftp is outdated

2017-12-21 Thread Magnus Hagander
On Thu, Dec 21, 2017 at 12:42 PM, Craig Ringer wrote: > On 21 December 2017 at 18:22, Magnus Hagander wrote: > >> >> >> On Thu, Dec 21, 2017 at 8:20 AM, Craig Ringer >> wrote: >> >>> Hi all >>> >>> The pg_indent on www is outdated, and doesn't understand --version . >>> >>> https://www.postgres

Re: Reproducible builds: genbki.pl and Gen_fmgrtab.pl

2017-12-21 Thread Christoph Berg
Re: Andrew Dunstan 2017-12-21 > >> ./src/bin/pg_dump/t/001_basic.pl > >> ./src/bin/pg_rewind/t/001_basic.pl > >> ./src/test/modules/commit_ts/t/001_base.pl > >> ./src/test/modules/test_pg_dump/t/001_base.pl > > Why does the uniqueness of application_name set in the TAP test suite

Re: AS OF queries

2017-12-21 Thread Konstantin Knizhnik
On 20.12.2017 19:26, Tom Lane wrote: Peter Eisentraut writes: On 12/20/17 10:29, Tom Lane wrote: Please say that's just an Oracle-ism and not SQL standard, because it's formally ambiguous. The SQL standard syntax appears to be something like "tablename" [ AS OF SYSTEM TIME 'something' ] [ [

PGLister gitlab repo

2017-12-21 Thread Stephen Frost
Greetings all, Since a few different people asked about it (and replies have been posted to those threads), we figured it made sense to also post here about it. PGLister's (finally) been reviewed by a couple of people and hopefully we didn't miss anything vital, but we've opened up the repo to th

Re: [HACKERS] Runtime Partition Pruning

2017-12-21 Thread Beena Emerson
Hello, On Thu, Dec 21, 2017 at 6:26 PM, David Rowley wrote: > On 21 December 2017 at 22:01, David Rowley > wrote: >> I've attached the latest version of the patch. This is based >> on Amit's v15 of faster-partition-pruning [1] which I found to cleanly >> apply to f94eec490 > > Well, that went o

Re: [HACKERS] parallel.c oblivion of worker-startup failures

2017-12-21 Thread Amit Kapila
On Thu, Dec 21, 2017 at 6:26 PM, Robert Haas wrote: > On Thu, Dec 21, 2017 at 6:46 AM, Amit Kapila wrote: >> What if we don't allow to reuse such slots till the backend/session >> that has registered it performs unregister? Currently, we don't seem >> to have an API corresponding to Register*Bac

Re: Reproducible builds: genbki.pl and Gen_fmgrtab.pl

2017-12-21 Thread Alvaro Herrera
Christoph Berg wrote: > Re: Andrew Dunstan 2017-12-21 > > > I've found it annoying in the past. Probably now that the buildfarm > > reports each test series separately it matters less. Previously we > > reported many of the TAP tests together. > > Rename them to the directory name: > > ./s

Re: domain cast in parameterized vs. non-parameterized query

2017-12-21 Thread Tom Lane
Pavel Stehule writes: > 2017-12-20 23:41 GMT+01:00 Tom Lane : >> Hm, scratch that --- experimentation shows that the parser still produces >> a CoerceToDomain node in that case, not a literal of the domain type. > Why the rewrite doesn't reduce it? Or why parser does it? Because ALTER DOMAIN can

Re: Reproducible builds: genbki.pl and Gen_fmgrtab.pl

2017-12-21 Thread Tom Lane
Andrew Dunstan writes: > Looks reasonable. Regarding the change to TestLib.pm, we should make > sure that the tests have unique names. There is a small amount of > duplication currently: > ./src/bin/pg_dump/t/001_basic.pl > ./src/bin/pg_rewind/t/001_basic.pl > ./src/test/modules/commi

Re: condition variable cleanup and subtransactions

2017-12-21 Thread Robert Haas
On Thu, Dec 21, 2017 at 6:46 AM, Thomas Munro wrote: > On Fri, Dec 22, 2017 at 12:00 AM, Andres Freund wrote: >> Oh. This seems to be a condition variable bug independent of PHJ. The >> problem is that the DSM segment etc all get cleaned up in >> *subtransaction* abort. >> >> Afaict it's a bug th

Re: domain cast in parameterized vs. non-parameterized query

2017-12-21 Thread Pavel Stehule
2017-12-21 15:19 GMT+01:00 Tom Lane : > Pavel Stehule writes: > > 2017-12-20 23:41 GMT+01:00 Tom Lane : > >> Hm, scratch that --- experimentation shows that the parser still > produces > >> a CoerceToDomain node in that case, not a literal of the domain type. > > > Why the rewrite doesn't reduce

Re: vacuum vs heap_update_tuple() and multixactids

2017-12-21 Thread Amit Kapila
On Wed, Dec 20, 2017 at 12:12 AM, Andres Freund wrote: > On 2017-12-19 15:35:12 -0300, Alvaro Herrera wrote: >> Andres Freund wrote: >> >> > I think the bugfix is going to have to essentially be something similar >> > to FreezeMultiXactId(). I.e. when reusing an old tuple's xmax for a new >> > tup

Re: [HACKERS] Runtime Partition Pruning

2017-12-21 Thread David Rowley
On 22 December 2017 at 03:02, Beena Emerson wrote: > postgres=# create table ta (a int not null) partition by list (a); > CREATE TABLE > postgres=# create table ta1 partition of ta for values in(1,2); > CREATE TABLE > postgres=# create table ta2 partition of ta for values in(3,4); > CREATE TABLE >

ddd

2017-12-21 Thread Andres Freund
Hi Robert, Todd, All, I think both I and commit e9baa5e9fa147e are confused. Mantid started to fail with the parallel hash join commit, with the following assert failure [1]: #2 0x008698e7 in ExceptionalCondition (conditionName=conditionName@entry=0x8efee8 "!(CurrentTransactionState->p

force parallel mode vs CTAS

2017-12-21 Thread Andres Freund
Hi, Err, the subject ought to have been "force parallel mode vs CTAS" or such. On 2017-12-21 06:31:06 -0800, Andres Freund wrote: > Hi Robert, Todd, All, > > I think both I and commit e9baa5e9fa147e are confused. > > Mantid started to fail with the parallel hash join commit, with the following

Re: The pg_indent on on ftp is outdated

2017-12-21 Thread Tom Lane
Magnus Hagander writes: > On Thu, Dec 21, 2017 at 12:42 PM, Craig Ringer > wrote: >>> The pg_indent on www is outdated, and doesn't understand --version . >>> https://www.postgresql.org/ftp/dev/ > Is there a reason to keep it at all if its obsolete, or should we just > delete it? The only reaso

Re: [HACKERS] Flexible configuration for full-text search

2017-12-21 Thread Arthur Zakirov
Hello, On Tue, Dec 19, 2017 at 05:31:09PM +0300, Aleksandr Parfenov wrote: > > The new version of the patch is in attachment as well as a > little README file with a description of changes in each file. Any > feedback is welcome. > I looked the patch a little bit. The patch is applied and tests

Re: != should give error?

2017-12-21 Thread Alvaro Herrera
Mikael Kjellström wrote: > BTW isn't the "preferred" way of writing different from / not equal in SQL > to use the <> operator? Yes, <> is the operator mandated by the SQL standard. I don't think != appears anywhere -- it's our extension only and thus if you use it you should not expect your app

Re: force parallel mode vs CTAS

2017-12-21 Thread Todd A. Cook
On 12/21/17 09:32, Andres Freund wrote: Why mantid's earlier builds don't show the problem, even though I can locally reproduce the issue escapes me. Todd, did you recently change anything on Mantid? Not within the buildfarm set-up. Otherwise, the most recent change was on Dec. 14 when I ap

Re: ddd

2017-12-21 Thread Robert Haas
Great subject line! On Thu, Dec 21, 2017 at 9:31 AM, Andres Freund wrote: > I think both I and commit e9baa5e9fa147e are confused. > > By my reading this is the fault of e9baa5e9fa147e [3]. Robert, Haribabu > any idea? If I run the regression tests with force_parallel_mode=on prior to the parall

Re: General purpose hashing func in pgbench

2017-12-21 Thread Fabien COELHO
I think it is not commitfest ready yet -- I need to add some documentation and tests first. Yes, doc & test are missing. From your figures, the murmur2 algorithm output looks way better. I'm wondering whether it makes sense to provide a bad hash function if a good/better one is available, u

Re: force parallel mode vs CTAS

2017-12-21 Thread Tom Lane
Robert Haas writes: > Great subject line! fixed ... > If I run the regression tests with force_parallel_mode=on prior to the > parallel hash join patch, they pass. If I run them now, they fail > inside the parallel hash join tests here: > create table wide as select generate_series(1, 2) as id,

Re: != should give error?

2017-12-21 Thread Dagfinn Ilmari Mannsåker
Alvaro Herrera writes: > Mikael Kjellström wrote: > >> BTW isn't the "preferred" way of writing different from / not equal in SQL >> to use the <> operator? > > Yes, <> is the operator mandated by the SQL standard. I don't think != > appears anywhere -- it's our extension only and thus if you us

Re: ddd

2017-12-21 Thread Robert Haas
On Thu, Dec 21, 2017 at 10:18 AM, Robert Haas wrote: > If I run the regression tests with force_parallel_mode=on prior to the > parallel hash join patch, they pass. If I run them now, they fail > inside the parallel hash join tests here: > > create table wide as select generate_series(1, 2) as id

Re: != should give error?

2017-12-21 Thread Alvaro Herrera
Dagfinn Ilmari Mannsåker wrote: > Alvaro Herrera writes: > > Yes, <> is the operator mandated by the SQL standard. I don't think != > > appears anywhere -- it's our extension only and thus if you use it you > > should not expect your applications to work on other DBMSs. > So while it might not

Re: force parallel mode vs CTAS

2017-12-21 Thread Robert Haas
On Thu, Dec 21, 2017 at 10:34 AM, Tom Lane wrote: > Robert Haas writes: >> Great subject line! > > fixed ... Ack, sorry, I replied on the original thread, not realizing there was a second one. Basically, I think the assertion is wrong-headed and can be adjusted so it doesn't fail, and I attache

Re: [HACKERS] path toward faster partition pruning

2017-12-21 Thread Alvaro Herrera
Just trying to understand the code here; some very minor comments as I go along. partition_op_strategy returning int32 looks pretty ugly, and the calling code is not super-intelligible either. How about returning a value from a new enum? typedef PartClause is missing a struct name, as is our tra

Re: force parallel mode vs CTAS

2017-12-21 Thread Tom Lane
Robert Haas writes: > Ack, sorry, I replied on the original thread, not realizing there was > a second one. Basically, I think the assertion is wrong-headed and > can be adjusted so it doesn't fail, and I attached a patch over there. Yeah, I saw. Looks plausible to me, but I haven't studied the

Re: domain cast in parameterized vs. non-parameterized query

2017-12-21 Thread David Kamholz
> > > Why the rewrite doesn't reduce it? Or why parser does it? > > Because ALTER DOMAIN can change what would be a valid value. In the view case that makes sense, but I don't see how ALTER DOMAIN is relevant to my original example. You can't alter a domain between the time the query is parsed an

Re: domain cast in parameterized vs. non-parameterized query

2017-12-21 Thread Tom Lane
David Kamholz writes: > In the view case that makes sense, but I don't see how ALTER DOMAIN is > relevant to my original example. You can't alter a domain between the time > the query is parsed and executed, can you? Yes, you can. Especially so for prepared statements. r

Re: AS OF queries

2017-12-21 Thread David Fetter
On Thu, Dec 21, 2017 at 05:00:35PM +0300, Konstantin Knizhnik wrote: > On 20.12.2017 19:26, Tom Lane wrote: > >Peter Eisentraut writes: > >>On 12/20/17 10:29, Tom Lane wrote: > >>>Please say that's just an Oracle-ism and not SQL standard, because it's > >>>formally ambiguous. > >>The SQL standard

Re: ddd

2017-12-21 Thread Andres Freund
Hi, On 2017-12-21 10:35:06 -0500, Robert Haas wrote: > Great subject line! Had started written the email before finishing testing, forgot to fill in the blank. mutt annoyingly aborts with an empty subject, hence smashing one key a couple times. > On Thu, Dec 21, 2017 at 10:18 AM, Robert Haas w

Re: Letting plpgsql in on the fun with the new expression eval stuff

2017-12-21 Thread Tom Lane
Robert Haas writes: > On Wed, Dec 20, 2017 at 6:06 PM, Tom Lane wrote: >> Anyway, I left it as-is, but I'm willing to make the change if >> people feel the other way is better. > I feel the other way -- let's not add more pointer indirections if it > isn't really necessary. OK --- with any luck

Re: Bitmap table scan cost per page formula

2017-12-21 Thread Tels
Moin, On Wed, December 20, 2017 11:51 pm, Jeff Janes wrote: > On Wed, Dec 20, 2017 at 2:18 PM, Robert Haas > wrote: > >> On Wed, Dec 20, 2017 at 4:20 PM, Jeff Janes >> wrote: >>> >>> It is not obvious to me that the parabola is wrong. I've certainly >>> seen >>> cases where reading every 2nd or

Re: ddd

2017-12-21 Thread Robert Haas
On Thu, Dec 21, 2017 at 12:55 PM, Andres Freund wrote: > Had started written the email before finishing testing, forgot to fill > in the blank. mutt annoyingly aborts with an empty subject, hence > smashing one key a couple times. Yeah, I figured that was what happened. It probably came across a

Re: [HACKERS] pow support for pgbench

2017-12-21 Thread Raúl Marín Rodríguez
Hi, Rebased the patch on top of current master/HEAD and changed to always return double. On Thu, Dec 14, 2017 at 12:48 PM, Fabien COELHO wrote: > > Fixed in the attached patch. >> > > v7 needs a rebase. > > Also, you might try to produce a version which is compatible with Robert's > constraints

Re: pgsql: Get rid of copy_partition_key

2017-12-21 Thread Robert Haas
On Thu, Dec 21, 2017 at 12:43 PM, Alvaro Herrera wrote: > Get rid of copy_partition_key > > That function currently exists to avoid leaking memory in > CacheMemoryContext in case of trouble while the partition key is being > built, but there's a better way: allocate everything in a memcxt that > g

Finalizing logical replication limitations as well as potential features

2017-12-21 Thread Joshua D. Drake
-Hackers, As I continue to test Logical Replication and its native capabilities I have found the following: It appears it is not possible to do this: publisher->public.foo replicates to subscriber->private.foo This one seems like a relatively simple fix (theoretically) and I think should

Re: pgsql: Get rid of copy_partition_key

2017-12-21 Thread Alvaro Herrera
Robert Haas wrote: > On Thu, Dec 21, 2017 at 12:43 PM, Alvaro Herrera > wrote: > > Get rid of copy_partition_key > > > > That function currently exists to avoid leaking memory in > > CacheMemoryContext in case of trouble while the partition key is being > > built, but there's a better way: allocat

Re: [HACKERS] pow support for pgbench

2017-12-21 Thread Fabien COELHO
Hello Raúl, v7 needs a rebase. Also, you might try to produce a version which is compatible with Robert's constraints. My 0.02€ on this new version: Applies cleanly, compiles and works. I cannot say that I like it more than the previous version. If a double is always returned, I'm wonderin

Re: WIP: a way forward on bootstrap data

2017-12-21 Thread Alvaro Herrera
Pushed 0001 and 0002. -- Álvaro Herrerahttps://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Re: WIP: a way forward on bootstrap data

2017-12-21 Thread Alvaro Herrera
Hmm, patch 0008 removes data lines from the .h but leaves the dependent OID define lines around: #define BTREE_AM_OID 403 This is not good, because then the define depends on data that appears in a distant file. Another consideration is that the current system has the property that these OIDs ar

Re: genomic locus

2017-12-21 Thread Gene Selkov
> On Dec 15, 2017, at 4:50 PM, Michael Paquier > wrote: > If you wish to fix seg in some way, you could always > patch them. But I am not sure what you are trying to fix, so more > details would be welcome. I was contemplating how much functionality I could borrow from seg to build another int

Re: genomic locus

2017-12-21 Thread Gene Selkov
Nice work, Andrew! I wish I knew about it earlier. > On Dec 16, 2017, at 8:53 AM, Andrew Dunstan > wrote: > > I keep most of the out-of-tree extensions I maintain green by building > and testing them in a buildfarm member. That way I become aware pretty > quickly if any API change has broken t

Re: [HACKERS] Runtime Partition Pruning

2017-12-21 Thread Robert Haas
On Thu, Dec 21, 2017 at 4:01 AM, David Rowley wrote: > The problem is down to the logic in choose_custom_plan() only choosing > a generic plan if the average cost of the generic plan is less than > the average custom plan cost. The problem is that the generic plan can > have many extra Append subn

Re: [HACKERS] Runtime Partition Pruning

2017-12-21 Thread David Rowley
On 22 December 2017 at 03:02, Beena Emerson wrote: > This seems like having two different patches for the same feature. I > will post my version of the patch which uses the struct > PartitionPruneInfo from your patch and I will add the other additional > features you added like optimizing the prun

Re: [HACKERS] Runtime Partition Pruning

2017-12-21 Thread David Rowley
On 22 December 2017 at 12:45, Robert Haas wrote: > PREPARE q3 (int, int) AS SELECT * FROM unpartitioned_table WHERE > partkey BETWEEN $1 AND $2; > > ...that has to decide whether to use an index. And to do that it has > to estimate what fraction of the table will match the BETWEEN clause. > That

Re: genomic locus

2017-12-21 Thread Gene Selkov
> On Dec 17, 2017, at 7:57 PM, Robert Haas wrote: > > On Fri, Dec 15, 2017 at 2:49 PM, Gene Selkov wrote: >> I need a data type to represent genomic positions, which will consist of a >> string and a pair of integers with interval logic and access methods. Sort >> of like my seg type, but more

Re: genomic locus

2017-12-21 Thread Gene Selkov
> On Dec 18, 2017, at 5:00 AM, PostgreSQL - Hans-Jürgen Schönig > wrote: > > maybe this one is also helpful: > https://wiki.postgresql.org/images/1/1b/Postbis_pgcon_eu_2012.pdf > > it seems they have put a lot of work into th

Re: The pg_indent on on ftp is outdated

2017-12-21 Thread Craig Ringer
On 21 Dec. 2017 22:42, "Tom Lane" wrote: Magnus Hagander writes: > On Thu, Dec 21, 2017 at 12:42 PM, Craig Ringer > wrote: >>> The pg_indent on www is outdated, and doesn't understand --version . >>> https://www.postgresql.org/ftp/dev/ > Is there a reason to keep it at all if its obsolete, or

Re: force parallel mode vs CTAS

2017-12-21 Thread Haribabu Kommi
On Fri, Dec 22, 2017 at 2:34 AM, Tom Lane wrote: > Robert Haas writes: > > Great subject line! > > fixed ... > Thanks for the fix Robert. This could have been caught, if I have test that creates toast table using CTAS during development of the patch. Regards, Hari Babu Fujitsu Australia

Re: [HACKERS] path toward faster partition pruning

2017-12-21 Thread Amit Langote
David On 2017/12/21 21:04, David Rowley wrote: > On 21 December 2017 at 23:38, Amit Langote > wrote: >> Attached updated set of patches. > > Looks like the new not equals code does not properly take into account > a missing NULL partition. > > create table ta (a int not null) partition by list

Re: [HACKERS] Runtime Partition Pruning

2017-12-21 Thread Robert Haas
On Thu, Dec 21, 2017 at 6:53 PM, David Rowley wrote: > On 22 December 2017 at 12:45, Robert Haas wrote: >> PREPARE q3 (int, int) AS SELECT * FROM unpartitioned_table WHERE >> partkey BETWEEN $1 AND $2; >> >> ...that has to decide whether to use an index. And to do that it has >> to estimate what

Re: Basebackups reported as idle

2017-12-21 Thread Michael Paquier
On Thu, Dec 21, 2017 at 02:46:15PM +0100, Magnus Hagander wrote: > On Thu, Dec 21, 2017 at 1:38 AM, Michael Paquier > wrote: >> I think that the call to pgstat_report_activity in WalSndLoop() should >> be kept as well. There is a small gap between the moment the process >> is started and the first

Re: WIP: a way forward on bootstrap data

2017-12-21 Thread Robert Haas
On Thu, Dec 21, 2017 at 5:32 PM, Alvaro Herrera wrote: > Hmm, patch 0008 removes data lines from the .h but leaves the dependent > OID define lines around: Just a question here -- do we actually have consensus on doing the stuff that these patches do? Because I'm not sure we do. -- Robert Haas

Re: [HACKERS] path toward faster partition pruning

2017-12-21 Thread David Rowley
On 22 December 2017 at 13:57, Amit Langote wrote: > Will post the fixed version shortly, thanks. I've made another partial pass on the patch and have a few more things. #3 and #4 are just comments rather than requests to change something. I think we should change those before PG11 though. 1. If

Re: [HACKERS] Runtime Partition Pruning

2017-12-21 Thread David Rowley
On 22 December 2017 at 14:29, Robert Haas wrote: > On Thu, Dec 21, 2017 at 6:53 PM, David Rowley > wrote: >> Are you considering some sort of clauselist_selectivity() estimate on >> the given parameters and comparing that to the same selectivities that >> were determined for the previous custom p

Re: genomic locus

2017-12-21 Thread Gene Selkov
> On Dec 18, 2017, at 6:59 AM, Craig Ringer wrote: > > If you think it'd make logical sense to extend seg with a string descriptor > of some sort and could come up with a name/use case that's not quite so > narrowly focused as genetics alone, then I could see adding it as a secondary > type i

Re: [HACKERS] path toward faster partition pruning

2017-12-21 Thread Amit Langote
On 2017/12/22 1:06, Alvaro Herrera wrote: > Just trying to understand the code here; some very minor comments as I > go along. > > partition_op_strategy returning int32 looks pretty ugly, and the calling > code is not super-intelligible either. How about returning a value from > a new enum? OK,

Re: Finalizing logical replication limitations as well as potential features

2017-12-21 Thread Craig Ringer
On 22 December 2017 at 05:24, Joshua D. Drake wrote: > -Hackers, > > > As I continue to test Logical Replication and its native capabilities I > have found the following: > > > It appears it is not possible to do this: > > publisher->public.foo replicates to subscriber->private.foo > > This one s

Re: genomic locus

2017-12-21 Thread Gene Selkov
Hi Oleg, Great to hear from you. I wondered how many of the old-timers were still around. > Why not use composite type ? For simple interval approach it's worked for us > (see attached hdate.sql). I have just begun looking at your hdate example; I see potentially useful stuff in it, but the fir

Re: [JDBC] [HACKERS] Channel binding support for SCRAM-SHA-256

2017-12-21 Thread Michael Paquier
On Wed, Dec 20, 2017 at 09:35:55AM +0900, Michael Paquier wrote: > However, it is possible to simply optimize the frontend code as in > pg_SASL_init() we already know the channel binding type selected when > calling pgtls_get_finished() and pgtls_get_peer_certificate_hash(). So > while I agree with

Condition variable live lock

2017-12-21 Thread Thomas Munro
Hi hackers, While debugging a build farm assertion failure after commit 18042840, and with the assumption that the problem is timing/scheduling sensitive, I tried hammering the problem workload on a few different machines and noticed that my slow 2-core test machine fairly regularly got into a liv

reassure me that it's good to copy pg_control last in a base backup

2017-12-21 Thread Chapman Flack
I've been using a base backup script that takes special care to have pg_control be the last file it grabs. And I see that basebackup.c takes similar care: https://git.postgresql.org/gitweb/?p=postgresql.git;a=blobdiff;f=src/backend/replication/basebackup.c;h=81203c9f5ac9dbf38da09e1ff55b29846c83f51

Re: Enhance pg_stat_wal_receiver view to display connected host

2017-12-21 Thread Haribabu Kommi
On Thu, Dec 21, 2017 at 11:12 PM, Michael Paquier wrote: > On Thu, Dec 21, 2017 at 8:16 PM, Haribabu Kommi > wrote: > > The current connected host details are already available in the PGconn > > structure, > > Exposing those details in the view will suffice this requirement. > Currently > > thes

Re: WIP: a way forward on bootstrap data

2017-12-21 Thread John Naylor
On 12/22/17, Alvaro Herrera wrote: > Hmm, patch 0008 removes data lines from the .h but leaves the dependent > OID define lines around: > > #define BTREE_AM_OID 403 > > This is not good, because then the define depends on data that appears > in a distant file. I see what you mean. > Another cons

archive restore command failure status [was Re: patch proposal]

2017-12-21 Thread Chapman Flack
>On 16 August 2016 at 09:06, Stephen Frost wrote: >> From PG's perspective, >> your restore command has said that all of the WAL has been replayed. >> >> If that's not what you want then change your restore command to >> return an exit code > 125, which tells PG that it's unable to restore >> that

Re: Protect syscache from bloating with negative cache entries

2017-12-21 Thread Kyotaro HORIGUCHI
At Tue, 19 Dec 2017 13:14:09 -0500, Tom Lane wrote in <748.1513707...@sss.pgh.pa.us> > Robert Haas writes: > > On Tue, Dec 19, 2017 at 3:31 AM, Kyotaro HORIGUCHI > > wrote: > >> I see three kinds of syscache entries. > >> > >> A. An entry for an actually existing object. > >> B. An entry for a

Re: Using ProcSignal to get memory context stats from a running backend

2017-12-21 Thread Craig Ringer
On 21 December 2017 at 15:55, Craig Ringer wrote: > On 21 December 2017 at 15:24, Andres Freund wrote: > >> Hi, >> >> On 2017-12-21 15:13:13 +0800, Craig Ringer wrote: >> > There tons of callers to enlargeStringInfo, so a 'noerror' parameter >> would >> > be viable. >> >> Not sure what you mean

Re: Using ProcSignal to get memory context stats from a running backend

2017-12-21 Thread Craig Ringer
On 22 December 2017 at 13:05, Craig Ringer wrote: > On 21 December 2017 at 15:55, Craig Ringer wrote: > >> On 21 December 2017 at 15:24, Andres Freund wrote: >> >>> Hi, >>> >>> On 2017-12-21 15:13:13 +0800, Craig Ringer wrote: >>> > There tons of callers to enlargeStringInfo, so a 'noerror' pa

  1   2   >