Re: [HACKERS] WIP: multivariate statistics / proof of concept

2016-01-19 Thread Gavin Flower
On 12/12/14 05:53, Heikki Linnakangas wrote: On 10/13/2014 01:00 AM, Tomas Vondra wrote: Hi, attached is a WIP patch implementing multivariate statistics. Great! Really glad to see you working on this. + * FIXME This sample sizing is mostly OK when computing stats for + *

Re: [HACKERS] Removing service-related code in pg_ctl for Cygwin

2016-01-19 Thread Marco Atzeri
On 18/01/2016 18:32, Andrew Dunstan wrote: On 01/14/2016 12:38 AM, Michael Paquier wrote: Hi all, Beginning a new thread seems more adapted regarding $subject but that's mentioned here as well:

Re: [HACKERS] checkpointer continuous flushing

2016-01-19 Thread Fabien COELHO
I measured it in a different number of cases, both on SSDs and spinning rust. I just reproduced it with: postgres-ckpt14 \ -D /srv/temp/pgdev-dev-800/ \ -c maintenance_work_mem=2GB \ -c fsync=on \ -c synchronous_commit=off \ -c

Re: [HACKERS] jsonb - jsonb operators

2016-01-19 Thread Merlin Moncure
On Mon, Jan 18, 2016 at 10:50 AM, Tom Lane wrote: > Dmitry Dolgov <9erthali...@gmail.com> writes: >>> if there's any future intention to add a delete operator that removes >> element/pair matches? > >> I think the operator (jsonb - jsonb) is logical because we have a shallow

Re: [HACKERS] Move PinBuffer and UnpinBuffer to atomics

2016-01-19 Thread Dilip Kumar
On Thu, Dec 24, 2015 at 8:26 AM, Michael Paquier wrote: > On Sun, Dec 13, 2015 at 11:05 PM, Amit Kapila > wrote: > > On Fri, Dec 11, 2015 at 6:34 PM, Andres Freund > wrote: > I was looking into this patch, overall patch

Re: [HACKERS] checkpointer continuous flushing

2016-01-19 Thread Andres Freund
On 2016-01-19 10:27:31 +0100, Fabien COELHO wrote: > Also, the performance level is around 160 tps on HDDs, which make sense to > me for a 7200 rpm HDD capable of about x00 random writes per second. It > seems to me that you reported much better performance on HDD, but I cannot > really see how

[HACKERS] Window2012R2: initdb error: "The current directory is invalid."

2016-01-19 Thread Huong Dangminh
Hi all, I have failed in execute initdb in "c:\Windows\Temp\dir" folder as reproduce logs below. The OS's messages "The current directory is invalid." was returned. I think it is a specification of Window2012R2 (because i could not reproduce In Windows 7) but not PostgreSQL's problem. But is

[HACKERS] Column merging for inherited tables aren't schema-qualified

2016-01-19 Thread Thom Brown
Hi, I've noticed that if I alter the parent of a inheritance tree, there can be ambiguity of which tables the column definitions were merged with. For example: # CREATE SCHEMA remote; CREATE SCHEMA # IMPORT public FROM SERVER remote INTO remote; IMPORT FOREIGN SCHEMA # CREATE TABLE

Re: [HACKERS] COPY (... tab completion

2016-01-19 Thread Andreas Karlsson
On 01/19/2016 07:55 AM, Michael Paquier wrote: +/* If we have COPY BINARY, compelete with list of tables */ s/compelete/complete Fixed. +else if (TailMatches2("COPY|\\copy", "(")) +COMPLETE_WITH_LIST7("SELECT", "TABLE", "VALUES", "INSERT", "UPDATE", "DELETE", "WITH"); This

Re: [HACKERS] Proposal: Trigonometric functions in degrees

2016-01-19 Thread Dean Rasheed
On 19 January 2016 at 06:32, Michael Paquier wrote: > The first patch looks fine to me, a nitpick: > + /* Be sure to throw an error if the input is infinite --- see dcos */ > s/dcos/docs > No, I meant dcos the function there. I would normally write that as dcos()

Re: [HACKERS] Re: BUG #13685: Archiving while idle every archive_timeout with wal_level hot_standby

2016-01-19 Thread Amit Kapila
On Tue, Jan 19, 2016 at 12:41 PM, Michael Paquier wrote: > > On Mon, Jan 18, 2016 at 10:19 PM, Amit Kapila wrote: > > On Mon, Jan 18, 2016 at 10:54 AM, Michael Paquier > > wrote: > >> Yes, the thing is that, as

Re: [HACKERS] plpgsql - DECLARE - cannot to use %TYPE or %ROWTYPE for composite types

2016-01-19 Thread Pavel Stehule
2016-01-18 22:48 GMT+01:00 Robert Haas : > On Mon, Jan 18, 2016 at 4:35 PM, Pavel Stehule > wrote: > >> I know that Oracle uses syntax of this general type, but I've always > >> found it ugly. It's also pretty non-extensible. You could want > >>

Re: Odd behavior in foreign table modification (Was: Re: [HACKERS] Optimization for updating foreign tables in Postgres FDW)

2016-01-19 Thread Thom Brown
On 12 January 2016 at 11:49, Etsuro Fujita wrote: > On 2016/01/12 20:36, Thom Brown wrote: >> >> On 8 January 2016 at 05:08, Etsuro Fujita >> wrote: > > On 2016/01/06 20:37, Thom Brown wrote: > > I've run into an issue: >

Re: [HACKERS] COPY (... tab completion

2016-01-19 Thread Michael Paquier
On Tue, Jan 19, 2016 at 8:00 PM, Andreas Karlsson wrote: > On 01/19/2016 07:55 AM, Michael Paquier wrote: >> >> +/* If we have COPY BINARY, compelete with list of tables */ >> s/compelete/complete > > Fixed. > >> +else if (TailMatches2("COPY|\\copy", "(")) >> +

Re: [HACKERS] Move PinBuffer and UnpinBuffer to atomics

2016-01-19 Thread Michael Paquier
On Tue, Jan 19, 2016 at 7:31 PM, Dilip Kumar wrote: > Test2: > pgbench -i -s 300 postgres > pgbench -c$ -j$ -Mprepared -S postgres > > Client Base Pached > > 1 2055519404 > 32 375919 332670

[HACKERS] Infer INOUT Parameters from Frontend/Backend Protocol

2016-01-19 Thread Brar Piening
Hi, I'm currently working on improving Npgsql's NpgsqlCommandBuilder.DeriveParameters method which is intended to automatically populate parameter information for a NpgsqlCommand. As Shay Rojansky suggested to use a Parse/Describe -> ParameterDescription/RowDescription over the backend

Re: [HACKERS] PATCH: Extending the HyperLogLog API a bit

2016-01-19 Thread Alvaro Herrera
Robert Haas wrote: > On Mon, Jan 11, 2016 at 2:22 PM, Alvaro Herrera > wrote: > > Tomas Vondra wrote: > >> Attached is v2 of the patch, adding the comments. > > > > Looks pretty reasonable to me. I'm not sure we want to push this ahead > > of the bloom filter stuff, but

Re: [HACKERS] PATCH: Extending the HyperLogLog API a bit

2016-01-19 Thread Peter Geoghegan
On Tue, Jan 19, 2016 at 2:03 PM, Tomas Vondra wrote: > > FWIW I've been considering adding APPROX_COUNT_DISTINCT() aggregate, > similarly to what other databases (e.g. Vertica) have built-in. Now, that > would not require the merge too, but we're currently baking

[HACKERS] Re: pglogical_output - a general purpose logical decoding output plugin

2016-01-19 Thread Tomasz Rybak
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 First part of code review (for about 1/3rd of code): pglogical_output.h: +

[HACKERS] Rethinking TRANSFORM FOR TYPE ...

2016-01-19 Thread Jim Nasby
I'm using the TRANSFORM feature to implement a new data type for python (ndarrays from numpy). I'm constantly getting tripped up by forgetting to add TRANSFORM FOR TYPE. Worse, the requirement for explicitly stating transform means I can't use a polymorphic type. In the case of adding a new

Re: [HACKERS] postgres_fdw join pushdown (was Re: Custom/Foreign-Join-APIs)

2016-01-19 Thread Robert Haas
On Wed, Aug 19, 2015 at 8:40 AM, Ashutosh Bapat wrote: > I started reviewing the other patches. > > In patch foreign_join_v16.patch, the user mapping structure being passed to > GetConnection() is the one obtained from GetUserMappingById(). > GetUserMappingById()

Re: [HACKERS] Combining Aggregates

2016-01-19 Thread David Rowley
On 20 January 2016 at 05:58, Robert Haas wrote: > > On Mon, Dec 21, 2015 at 4:02 AM, David Rowley > > wrote: > >> Now, there has been talk of this previously, on various threads, but I > don't > >> believe any final decisions were made on how

Re: [HACKERS] PATCH: Extending the HyperLogLog API a bit

2016-01-19 Thread Tomas Vondra
On 01/19/2016 10:54 PM, Peter Geoghegan wrote: On Tue, Jan 19, 2016 at 9:37 AM, Alvaro Herrera wrote: Our transcript seems to predate that bugfix commit, so I assume we need to apply this to our copy too. Sadly, Hideaki-san commit message isn't very descriptive.

Re: [HACKERS] PATCH: Extending the HyperLogLog API a bit

2016-01-19 Thread Peter Geoghegan
On Tue, Jan 19, 2016 at 2:22 PM, Peter Geoghegan wrote: > I don't have time right now to do a full analysis of whether or not it's > possible to just fix the bug without doing all that, but I think it > might not be. IOW: I think that Hideaki's bug fix might itself be wrong

Re: [HACKERS] make error - libpqdll.def No such file or directory

2016-01-19 Thread Igal @ Lucee.org
On 1/19/2016 10:58 AM, Alvaro Herrera wrote: Yes, probably something like that. I think it failed the first time because there was a bug (the one I introduced in a967613911f7), then probably changed to src/backend and ran compiles there which probably worked fine, leading to commit

Re: [HACKERS] Combining Aggregates

2016-01-19 Thread David Rowley
On 20 January 2016 at 05:56, Robert Haas wrote: > > On Mon, Dec 21, 2015 at 4:02 AM, David Rowley > wrote: > > Now, there has been talk of this previously, on various threads, but I > don't > > believe any final decisions were made on how

Re: [HACKERS] Combining Aggregates

2016-01-19 Thread Robert Haas
On Tue, Jan 19, 2016 at 4:50 PM, David Rowley wrote: >> Oh, one more point: is there any reason why all of this needs to be a >> single (giant) patch? I feel like the handling of internal states >> could be a separate patch from the basic patch to allow partial >>

Re: [HACKERS] checkpointer continuous flushing

2016-01-19 Thread Andres Freund
On 2016-01-19 12:58:38 -0500, Robert Haas wrote: > This seems like a problem with the WAL writer quite independent of > anything else. It seems likely to be inadvertent fallout from this > patch: > > Author: Simon Riggs > Branch: master Release: REL9_2_BR [4de82f7d7]

Re: [HACKERS] PATCH: postpone building buckets to the end of Hash (in HashJoin)

2016-01-19 Thread Tomas Vondra
On 01/19/2016 08:34 PM, Robert Haas wrote: On Mon, Jan 18, 2016 at 10:57 PM, Tomas Vondra wrote: If this doesn't regress performance in the case where the number of buckets is estimated accurately to begin with, then I think this is a great idea. Can you supply

Re: [HACKERS] PATCH: Extending the HyperLogLog API a bit

2016-01-19 Thread Peter Geoghegan
On Tue, Jan 19, 2016 at 9:37 AM, Alvaro Herrera wrote: > Our transcript seems to predate that bugfix commit, so I assume we need > to apply this to our copy too. Sadly, Hideaki-san commit message isn't > very descriptive. Fortunately, the function mergeHyperLogLog() in

Re: [HACKERS] make error - libpqdll.def No such file or directory

2016-01-19 Thread Igal @ Lucee.org
On 1/17/2016 8:17 PM, Igal @ Lucee.org wrote: On 1/17/2016 3:24 PM, Igal @ Lucee.org wrote: When running make I encounter the following error: gcc.exe: error: libpqdll.def: No such file or directory /home/Admin/sources/postgresql-9.5.0/src/Makefile.shlib:393: recipe for target 'libpq.dll'

Re: [HACKERS] make error - libpqdll.def No such file or directory

2016-01-19 Thread Igal @ Lucee.org
On 1/19/2016 10:17 AM, Alvaro Herrera wrote: Igal @ Lucee.org wrote: So when I try to run `make` I still get that error. Please note that I am doing a VPATH build (the build in a separate directory from the downloaded sources), which might play a role here: x86_64-w64-mingw32-gcc.exe: error:

Re: [HACKERS] Advices on custom data type and extension development

2016-01-19 Thread Alvaro Herrera
Luciano Coutinho Barcellos wrote: > * the type would be 8 bytes long, being 4 dedicated to storing the > Date, and 4 dedicated to storing a serial within that day; Another thing to consider -- have you carefully defined what the "current day" is? This might sound a stupid question, but

Re: [HACKERS] checkpointer continuous flushing

2016-01-19 Thread Robert Haas
On Mon, Jan 18, 2016 at 11:39 AM, Andres Freund wrote: > On 2016-01-16 10:01:25 +0100, Fabien COELHO wrote: >> Hello Andres, >> >> >I measured it in a different number of cases, both on SSDs and spinning >> >rust. I just reproduced it with: >> > >> >postgres-ckpt14 \ >> >

Re: [HACKERS] make error - libpqdll.def No such file or directory

2016-01-19 Thread Andrew Dunstan
On 01/19/2016 02:01 PM, Alvaro Herrera wrote: Andrew Dunstan wrote: jacana does VPATH builds with pretty much this setup all the time. See for example Yes, it builds a tree *once*, then deletes the result,

Re: [HACKERS] jsonb array-style subscription

2016-01-19 Thread Alvaro Herrera
Dmitry Dolgov wrote: > I've cleaned up the code, created a separate JsonbRef node (and there are a > lot of small changes because of that), abandoned an idea of "deep nesting" > of assignments (because it doesn't relate to jsonb subscription, is more > about the > "jsonb_set" function, and anyway

Re: [HACKERS] make error - libpqdll.def No such file or directory

2016-01-19 Thread Alvaro Herrera
Igal @ Lucee.org wrote: > So when I try to run `make` I still get that error. Please note that I am > doing a VPATH build (the build in a separate directory from the downloaded > sources), which might play a role here: > > x86_64-w64-mingw32-gcc.exe: error: libpqdll.def: No such file or

Re: [HACKERS] Stream consistent snapshot via a logical decoding plugin as a series of INSERTs

2016-01-19 Thread Shulgin, Oleksandr
On Fri, Jan 15, 2016 at 5:31 PM, Shulgin, Oleksandr < oleksandr.shul...@zalando.de> wrote: > > POC patch attached. Findings: > > 1) Needs an actual slot for all the decode machinery to work (code depends > on MyReplicationSlot being set). > 2) Requires a core patch. > 3) Currently only supports

Re: Odd behavior in foreign table modification (Was: Re: [HACKERS] Optimization for updating foreign tables in Postgres FDW)

2016-01-19 Thread Robert Haas
On Tue, Jan 19, 2016 at 1:59 AM, Etsuro Fujita wrote: I've run into an issue: *# UPDATE master_customers SET id = 22 WHERE id = 16 RETURNING tableoid::regclass; ERROR: CONTEXT: Remote SQL command: UPDATE public.customers SET id = 22

Re: [HACKERS] make error - libpqdll.def No such file or directory

2016-01-19 Thread Alvaro Herrera
Igal @ Lucee.org wrote: > Alvaro -- thank you for your reply! > > So to clarify (in the hopes that it would allow me to keep some hair on my > head by the end of this process, as I already pulled out most of it by > now)... > your process was as follows? > > build-dir$ ~/source-dir/configure

Re: [HACKERS] Advices on custom data type and extension development

2016-01-19 Thread Corey Huinker
> > Seriously, you should consider having a primary key with two > columns, of type date and int. It would take exactly the same > space as your current plan, and performance should be very close to > what you propose. As long as you aren't using some ORM that is too > dumb to deal with this, it

Re: [HACKERS] make error - libpqdll.def No such file or directory

2016-01-19 Thread Alvaro Herrera
Andrew Dunstan wrote: > jacana does VPATH builds with pretty much this setup all the time. See for > example > Yes, it builds a tree *once*, then deletes the result, and the next BF run uses a completely new

Re: [HACKERS] checkpointer continuous flushing

2016-01-19 Thread Fabien COELHO
synchronous_commit = off does make a significant difference. Sure, but I had thought about that and kept this one... But why are you then saying this is fundamentally limited to 160 xacts/sec? I'm just saying that the tested load generates mostly random IOs (probably on average over 1

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-01-19 Thread Robert Haas
On Mon, Jan 18, 2016 at 10:41 PM, Amit Kapila wrote: > Initially, we started with extending the 'waiting' column in > pg_stat_activity, > to which some people have raised concerns about backward > compatability, so another option that came-up during discussion was to >

[HACKERS] Re: [BUGS] about test_parser installation failure problem(PostgreSQL in 9.5.0)?

2016-01-19 Thread Alvaro Herrera
閬閬イふ wrote: > hi postgreSql ! > test_parser install is ok (postgresql 9.2.4) > but at (postgresql 9.5.0) failure? > why?the postgresql say: > CREATE EXTENSION zhparser What is zhparser anyway? There is one such thing at https://github.com/amutu/zhparser but I don't think it depends on

Re: [HACKERS] PATCH: postpone building buckets to the end of Hash (in HashJoin)

2016-01-19 Thread Robert Haas
On Mon, Jan 18, 2016 at 10:57 PM, Tomas Vondra wrote: >>> If this doesn't regress performance in the case where the number of >>> buckets is estimated accurately to begin with, then I think this is >>> a great idea. Can you supply some performance tests results for

Re: [HACKERS] Re: [JDBC] 9.4-1207 behaves differently with server side prepared statements compared to 9.2-1102

2016-01-19 Thread Robert Haas
On Mon, Jan 18, 2016 at 5:50 PM, Thomas Kellerer wrote: > With all the problems I have seen (in Oracle and Postgres) I think that > maybe a better solution to this problem is to make the planner fast (and > reliable) enough so that plan caching isn't necessary in the first

Re: [HACKERS] make error - libpqdll.def No such file or directory

2016-01-19 Thread Andrew Dunstan
On 01/19/2016 01:08 PM, Igal @ Lucee.org wrote: On 1/17/2016 8:17 PM, Igal @ Lucee.org wrote: On 1/17/2016 3:24 PM, Igal @ Lucee.org wrote: When running make I encounter the following error: gcc.exe: error: libpqdll.def: No such file or directory

Re: [HACKERS] postgres_fdw join pushdown (was Re: Custom/Foreign-Join-APIs)

2016-01-19 Thread Robert Haas
On Mon, Jan 18, 2016 at 6:47 AM, Ashutosh Bapat wrote: > Thanks Thom for bringing it to my notice quickly. Sorry for the same. > > Here are the patches. > > 1. pg_fdw_core_v2.patch: changes in core related to user mapping handling, > GUC >

Re: [HACKERS] make error - libpqdll.def No such file or directory

2016-01-19 Thread Alvaro Herrera
Igal @ Lucee.org wrote: > On 1/19/2016 10:58 AM, Alvaro Herrera wrote: > >Yes, probably something like that. I think it failed the first time > >because there was a bug (the one I introduced in a967613911f7), then > >probably changed to src/backend and ran compiles there which probably > >worked

[HACKERS] Buildfarm server move complete

2016-01-19 Thread Andrew Dunstan
The buildfarm server move is complete. Thanks to all who helped, especially Stephen Frost. There might be some small performance regressions which we'll be digging into. Next step: move the mailing lists off pgfoundry. The new lists have been set up I will be working on that migration

Re: NextXID format change (was Re: [HACKERS] exposing pg_controldata and pg_config as functions)

2016-01-19 Thread Alvaro Herrera
Joe Conway wrote: > The attached includes Bruce's change, plus I found two additional sites > that appear to need the same change. The xlog.c change is just a DEBUG > message, so not a big deal. I'm less certain if the xlogdesc.c change > might create some fallout. Hm, pg_xlogdump links the

Re: NextXID format change (was Re: [HACKERS] exposing pg_controldata and pg_config as functions)

2016-01-19 Thread Michael Paquier
On Wed, Jan 20, 2016 at 11:41 AM, Alvaro Herrera wrote: > Joe Conway wrote: > >> The attached includes Bruce's change, plus I found two additional sites >> that appear to need the same change. The xlog.c change is just a DEBUG >> message, so not a big deal. I'm less

[HACKERS] Why format() adds double quote?

2016-01-19 Thread Tatsuo Ishii
test=# select format('%I', t) from t1; format -- aaa "AAA" "あいう" (3 rows) Why is the text value of the third line needed to be double quoted? (note that it is a multi byte character). Same thing can be said to quote_ident(). We treat identifiers made of the multi byte characters

Re: [HACKERS] plpgsql - DECLARE - cannot to use %TYPE or %ROWTYPE for composite types

2016-01-19 Thread Robert Haas
On Tue, Jan 19, 2016 at 4:53 AM, Pavel Stehule wrote: > It is, but sometime the polymorphic types can help. > > The proposed feature/syntax has sense primary for polymorphic types. It > should to follow our polymorphic types. The primary pair is > "anyarray","anyelement"

Re: [HACKERS] Proposal: "Causal reads" mode for load balancing reads without stale data

2016-01-19 Thread Michael Paquier
On Wed, Jan 20, 2016 at 1:12 PM, Thomas Munro wrote: > On Wed, Dec 30, 2015 at 5:15 PM, Thomas Munro > wrote: >> On Wed, Nov 18, 2015 at 11:50 PM, Thomas Munro >> wrote: >>> Here is a new version of the

Re: [HACKERS] Support for N synchronous standby servers - take 2

2016-01-19 Thread Masahiko Sawada
On Tue, Jan 19, 2016 at 1:52 AM, Thom Brown wrote: > On 3 January 2016 at 13:26, Masahiko Sawada wrote: >> On Fri, Dec 25, 2015 at 7:21 AM, Thomas Munro >> wrote: >>> On Fri, Dec 25, 2015 at 8:50 AM, Masahiko Sawada

Re: [HACKERS] Why format() adds double quote?

2016-01-19 Thread Pavel Stehule
2016-01-20 3:47 GMT+01:00 Tatsuo Ishii : > test=# select format('%I', t) from t1; > format > -- > aaa > "AAA" > "あいう" > (3 rows) > > Why is the text value of the third line needed to be double quoted? > (note that it is a multi byte character). Same thing can be

Re: [HACKERS] Window2012R2: initdb error: "The current directory is invalid."

2016-01-19 Thread Craig Ringer
On 19 January 2016 at 18:49, Huong Dangminh wrote: > Hi all, > > I have failed in execute initdb in "c:\Windows\Temp\dir" folder as > reproduce logs below. The OS's messages "The current directory is invalid." > was returned. > Is that directory or any parent of it a

Re: [HACKERS] dynloader.h missing in prebuilt package for Windows?

2016-01-19 Thread Bruce Momjian
On Mon, Jan 4, 2016 at 09:50:40PM -0800, Michael Paquier wrote: > On Tue, Jan 5, 2016 at 2:27 PM, Tom Lane wrote: > > Michael Paquier writes: > >> The patch would put the buildfarm in red as it is incomplete anyway, > >> with MSVC what is used

Re: [HACKERS] plpgsql - DECLARE - cannot to use %TYPE or %ROWTYPE for composite types

2016-01-19 Thread Pavel Stehule
2016-01-20 0:34 GMT+01:00 Robert Haas : > On Tue, Jan 19, 2016 at 4:53 AM, Pavel Stehule > wrote: > > It is, but sometime the polymorphic types can help. > > > > The proposed feature/syntax has sense primary for polymorphic types. It > > should to

Re: [HACKERS] Support for N synchronous standby servers - take 2

2016-01-19 Thread Masahiko Sawada
On Tue, Jan 19, 2016 at 2:55 PM, Michael Paquier wrote: > On Tue, Jan 19, 2016 at 1:40 AM, Masahiko Sawada > wrote: >> On Mon, Jan 18, 2016 at 1:20 PM, Michael Paquier >> wrote: >>> On Sun, Jan 17, 2016 at 11:09 PM,

Re: [HACKERS] Re: pglogical_output - a general purpose logical decoding output plugin

2016-01-19 Thread Craig Ringer
On 20 January 2016 at 06:23, Tomasz Rybak wrote: > The following review has been posted through the commitfest application: > Thanks! > > + /* Protocol capabilities */ > + #define PGLOGICAL_PROTO_VERSION_NUM 1 > + #define PGLOGICAL_PROTO_MIN_VERSION_NUM 1 > Is this

Re: [HACKERS] Proposal: "Causal reads" mode for load balancing reads without stale data

2016-01-19 Thread Thomas Munro
On Wed, Dec 30, 2015 at 5:15 PM, Thomas Munro wrote: > On Wed, Nov 18, 2015 at 11:50 PM, Thomas Munro > wrote: >> Here is a new version of the patch with a few small improvements: >> ... >> [causal-reads-v3.patch] > > That didn't

[HACKERS] Commented code related to flock() in be-secure-openssl.c

2016-01-19 Thread Michael Paquier
Hi all, I just bumped into the following code in be-secure-openssl.c: /* flock(fileno(fp), LOCK_SH); */ dh = PEM_read_DHparams(fp, NULL, NULL, NULL); /* flock(fileno(fp), LOCK_UN); */ Those have been added by 55d0532, dated as of 2002. Perhaps there is some point to remove those lines?

Re: [HACKERS] dynloader.h missing in prebuilt package for Windows?

2016-01-19 Thread Michael Paquier
On Wed, Jan 20, 2016 at 1:34 PM, Bruce Momjian wrote: > On Mon, Jan 4, 2016 at 09:50:40PM -0800, Michael Paquier wrote: >> On Tue, Jan 5, 2016 at 2:27 PM, Tom Lane wrote: >> > Michael Paquier writes: >> >> The patch would put the

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-01-19 Thread Amit Kapila
On Wed, Jan 20, 2016 at 12:41 AM, Robert Haas wrote: > > On Mon, Jan 18, 2016 at 10:41 PM, Amit Kapila wrote: > > Second important and somewhat related point is whether we should save > > this information in PGPROC as 4 bytes or keep it in

Re: [HACKERS] Why format() adds double quote?

2016-01-19 Thread Tatsuo Ishii
> 2016-01-20 3:47 GMT+01:00 Tatsuo Ishii : > >> test=# select format('%I', t) from t1; >> format >> -- >> aaa >> "AAA" >> "あいう" >> (3 rows) >> >> Why is the text value of the third line needed to be double quoted? >> (note that it is a multi byte character).

Re: [HACKERS] Logical decoding on standby

2016-01-19 Thread Craig Ringer
On 19 January 2016 at 23:30, Дмитрий Сарафанников wrote: When you plan to add logical decoding on standby? > > it is useful to have separate standby server for logical replication that > will not break the master if you make a mistake in plugin. > Indeed. It might PANIC

Re: [HACKERS] Rethinking TRANSFORM FOR TYPE ...

2016-01-19 Thread Pavel Stehule
Hi 2016-01-19 22:34 GMT+01:00 Jim Nasby : > I'm using the TRANSFORM feature to implement a new data type for python > (ndarrays from numpy). I'm constantly getting tripped up by forgetting to > add TRANSFORM FOR TYPE. Worse, the requirement for explicitly stating >

Re: [HACKERS] Stream consistent snapshot via a logical decoding plugin as a series of INSERTs

2016-01-19 Thread Craig Ringer
On 15 January 2016 at 16:30, Shulgin, Oleksandr < oleksandr.shul...@zalando.de> wrote: > I'd like to propose generic functions (probably in an extension, or in > core if not possible otherwise) to facilitate streaming existing data from > the database *in the same format* that one would get if

Re: [HACKERS] Inconsistent error handling in START_REPLICATION command

2016-01-19 Thread Craig Ringer
On 5 January 2016 at 18:35, Shulgin, Oleksandr wrote: > psycopg2test=# START_REPLICATION SLOT "test1" LOGICAL 0/0 ("invalid" >> 'value'); >> unexpected PQresultStatus: 8 >> > I think the point here is that START_REPLICATION issues useful errors and returns to the

Re: [HACKERS] Logical decoding on standby

2016-01-19 Thread Andres Freund
On 2016-01-20 15:11:06 +0800, Craig Ringer wrote: > Unfortunately it's not particularly simple and nobody seems to have time to > implement it. FWIW, I don't think it's *that* hard. > As Álvaro pointed out, sometimes you have to do the work if > you want the change to happen. Or find someone

Re: [HACKERS] Stream consistent snapshot via a logical decoding plugin as a series of INSERTs

2016-01-19 Thread Shulgin, Oleksandr
On Wed, Jan 20, 2016 at 7:57 AM, Craig Ringer wrote: > On 15 January 2016 at 16:30, Shulgin, Oleksandr < > oleksandr.shul...@zalando.de> wrote: > > >> I'd like to propose generic functions (probably in an extension, or in >> core if not possible otherwise) to facilitate

Re: [HACKERS] Why format() adds double quote?

2016-01-19 Thread Pavel Stehule
Hi 2016-01-20 7:20 GMT+01:00 Tatsuo Ishii : > > 2016-01-20 3:47 GMT+01:00 Tatsuo Ishii : > > > >> test=# select format('%I', t) from t1; > >> format > >> -- > >> aaa > >> "AAA" > >> "あいう" > >> (3 rows) > >> > >> Why is the text value of

Re: [HACKERS] Re: [JDBC] 9.4-1207 behaves differently with server side prepared statements compared to 9.2-1102

2016-01-19 Thread Amit Kapila
On Tue, Jan 19, 2016 at 4:20 AM, Thomas Kellerer wrote: > > Robert Haas wrote: > > This isn't the first complaint about this mechanism that we've gotten, > > and it won't be the last. Way too many of our users are way more > > aware than they should be that the threshold here

Re: [HACKERS] custom function for converting human readable sizes to bytes

2016-01-19 Thread Robert Haas
On Mon, Jan 18, 2016 at 6:56 PM, Vitaly Burovoy wrote: > On 1/4/16, Robert Haas wrote: >> On Mon, Jan 4, 2016 at 10:17 AM, Pavel Stehule >> wrote: >>> [ new patch ] >> >> + case '-': >> +

Re: [HACKERS] Combining Aggregates

2016-01-19 Thread Robert Haas
On Mon, Jan 18, 2016 at 11:24 PM, Tom Lane wrote: > Robert Haas writes: >> Here is a patch that helps a good deal. I changed things so that when >> we create a context, we always allocate at least 1kB. > > That's going to kill performance in some other

Re: [HACKERS] Advices on custom data type and extension development

2016-01-19 Thread Kevin Grittner
On Mon, Jan 18, 2016 at 9:36 PM, Luciano Coutinho Barcellos wrote: > * a lot of data being generated every day, which are mainly queried > by an immutable column of type date or timestamp; > * as a standard, almost every table has a bigserial id column

Re: [HACKERS] [Proposal] Table partition + join pushdown

2016-01-19 Thread Greg Stark
On Mon, Jan 18, 2016 at 5:55 PM, Robert Haas wrote: > For > example, suppose that x and y are numeric columns and P(x) is > length(x::text) == 3. Then you could have 1 in one table and 1.0 in > the table; they join, but P(x) is true for one and false for the > other.

Re: [HACKERS] custom function for converting human readable sizes to bytes

2016-01-19 Thread Pavel Stehule
2016-01-19 13:42 GMT+01:00 Robert Haas : > On Mon, Jan 18, 2016 at 6:56 PM, Vitaly Burovoy > wrote: > > On 1/4/16, Robert Haas wrote: > >> On Mon, Jan 4, 2016 at 10:17 AM, Pavel Stehule > > >>

Re: [HACKERS] Additional role attributes && superuser review

2016-01-19 Thread David Steele
On 1/17/16 9:10 PM, Stephen Frost wrote: > but if it's possible to do a backup without > being a superuser and with only read access to the data directory, I > would expect every backup soltuion to view that as a feature which they > want to support, as there are environments which will find it

Re: [HACKERS] checkpointer continuous flushing

2016-01-19 Thread Fabien COELHO
synchronous_commit = off does make a significant difference. Sure, but I had thought about that and kept this one... I think I found one possible culprit: I automatically wrote 300 seconds for checkpoint_timeout, instead of 30 seconds in your settings. I'll have to rerun the tests with

[HACKERS] Logical decoding on standby

2016-01-19 Thread Дмитрий Сарафанников
Hi, If i try to create logical replication slot on standby i get error: ERROR:  logical decoding cannot be used while in recovery In code i found this comment: /* * TODO: We got to change that someday soon... * * There's basically three things missing to allow this: * 1) We need to be

Re: [HACKERS] COPY (... tab completion

2016-01-19 Thread Tom Lane
Michael Paquier writes: > This patch makes me wonder: are we going to nuke the grammar "COPY [ > BINARY ] table_name" at some point? This was used up to 7.3. I'm not particularly in a hurry to remove obsolete syntaxes, as long as they're not blocking forward progress

Re: [HACKERS] Move PinBuffer and UnpinBuffer to atomics

2016-01-19 Thread Dilip Kumar
On Tue, Jan 19, 2016 at 5:44 PM, Michael Paquier wrote: > > Test3: > > pgbench -i -s 100 postgres > > pgbench -c$ -j$ -Mprepared -S postgres > > > > Client Base Pached > > > > 1 2055519404 > > 32

Re: [HACKERS] Patch: Implement failover on libpq connect level.

2016-01-19 Thread Thom Brown
On 21 December 2015 at 14:50, Victor Wagner wrote: > On Mon, 21 Dec 2015 17:18:37 +0300 > Teodor Sigaev wrote: > >> Sorry, but there is something wrong with your patch: >> % patch -p1 -C < ~/Downloads/libpq-failover-5.patch > > Really, somehow broken version

Re: [HACKERS] Logical decoding on standby

2016-01-19 Thread Alvaro Herrera
Hi Dimitriy, Дмитрий Сарафанников wrote: > /* > * TODO: We got to change that someday soon... [ more code ] > if (RecoveryInProgress()) > ereport(ERROR, > (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), > errmsg("logical decoding cannot be used while in recovery"))); > When you plan to add logical

[HACKERS] about test_parser installation failure problem(PostgreSQL in 9.5.0)?

2016-01-19 Thread 閬閬イふ
hi postgreSql ! test_parser install is ok (postgresql 9.2.4) but at (postgresql 9.5.0) failure? why?the postgresql say: CREATE EXTENSION zhparser say: ERROR: syntax error at or near "" LINE 1: CREATE EXTENSION zhparser ^ ** 错误 ** ERROR: syntax error at or

Re: [HACKERS] PATCH: postpone building buckets to the end of Hash (in HashJoin)

2016-01-19 Thread Robert Haas
On Tue, Jan 19, 2016 at 4:49 PM, Tomas Vondra wrote: > I can totally see why this would slow-down the BuildBuckets function, but I > don't quite see why it should make the other code significantly slower. Yet > BuildBuckets takes just ~25ms while the total duration

NextXID format change (was Re: [HACKERS] exposing pg_controldata and pg_config as functions)

2016-01-19 Thread Joe Conway
On 01/19/2016 09:02 AM, Bruce Momjian wrote: > Ok. Notwithstanding Simon's reply, there seems to be consensus that this > is the way to go. Will commit it this way unless some additional > objections surface in the next day or so. FYI, this slash-colon change will break

Re: [HACKERS] Combining Aggregates

2016-01-19 Thread Robert Haas
On Tue, Jan 19, 2016 at 12:22 AM, Tomas Vondra wrote: > I dare to claim that if expanded objects require a separate memory context > per aggregate state (I don't see why would be the case), it's a dead end. > Not so long ago we've fixed exactly this issue in

Re: [HACKERS] Combining Aggregates

2016-01-19 Thread Robert Haas
On Tue, Jan 19, 2016 at 11:56 AM, Robert Haas wrote: > [ rewinding to here from the detour I led us on ] > > On Mon, Dec 21, 2015 at 4:02 AM, David Rowley > wrote: >> Now, there has been talk of this previously, on various threads, but I don't

Re: [HACKERS] exposing pg_controldata and pg_config as functions

2016-01-19 Thread Bruce Momjian
On Mon, Jan 18, 2016 at 07:50:12PM -0500, Bruce Momjian wrote: > > 1) Change NextXID output format from "%u/%u" to "%u:%u" > > (see recent hackers thread) > > >>> > > >>> ! printf(_("Latest checkpoint's NextXID: %u/%u\n"), > > >>>

Re: [HACKERS] Combining Aggregates

2016-01-19 Thread Robert Haas
[ rewinding to here from the detour I led us on ] On Mon, Dec 21, 2015 at 4:02 AM, David Rowley wrote: > Now, there has been talk of this previously, on various threads, but I don't > believe any final decisions were made on how exactly it should be done. At > the

Re: [HACKERS] checkpointer continuous flushing

2016-01-19 Thread Andres Freund
On 2016-01-19 13:34:14 +0100, Fabien COELHO wrote: > > >synchronous_commit = off does make a significant difference. > > Sure, but I had thought about that and kept this one... But why are you then saying this is fundamentally limited to 160 xacts/sec? > I think I found one possible culprit: I

Re: [HACKERS]WIP: Covering + unique indexes.

2016-01-19 Thread Anastasia Lubennikova
18.01.2016 01:02, David Rowley пишет: On 14 January 2016 at 08:24, David Rowley > wrote: I will try to review the omit_opclass_4.0.patch soon. Hi, as promised, here's my review of the omit_opclass_4.0.patch patch.

Re: [HACKERS]WIP: Covering + unique indexes.

2016-01-19 Thread Anastasia Lubennikova
12.01.2016 20:47, Jeff Janes: It looks like the "covering" patch, with or without the "omit_opclass" patch, does not support expressions as included columns: create table foobar (x text, y xml); create index on foobar (x) including (md5(x)); ERROR: unrecognized node type: 904 create index

Re: [HACKERS] [Proposal] Table partition + join pushdown

2016-01-19 Thread Robert Haas
On Tue, Jan 19, 2016 at 7:59 AM, Greg Stark wrote: > On Mon, Jan 18, 2016 at 5:55 PM, Robert Haas wrote: >> For >> example, suppose that x and y are numeric columns and P(x) is >> length(x::text) == 3. Then you could have 1 in one table and 1.0 in >> the

Re: [HACKERS] exposing pg_controldata and pg_config as functions

2016-01-19 Thread Robert Haas
On Mon, Jan 18, 2016 at 7:42 PM, Michael Paquier wrote: >> Yeah, I really don't see anything in the pg_controldata output that >> looks sensitive. The WAL locations are the closest of anything, >> AFAICS. > > The system identifier perhaps? I honestly don't have on top

  1   2   >