Re: [HACKERS] Behaviour of take over the synchronous replication

2013-08-24 Thread Amit Kapila
On Sat, Aug 24, 2013 at 2:46 PM, Sawada Masahiko wrote: > On Sat, Aug 24, 2013 at 3:14 AM, Josh Berkus wrote: >> On 08/23/2013 12:42 AM, Sawada Masahiko wrote: >>> in case (a), those priority is clear. So I think that re-taking over >>> is correct behaviour. >>> OHOT, in case (b), even if AAA and

Re: ALTER SYSTEM SET command to change postgresql.conf parameters (RE: [HACKERS] Proposal for Allow postgresql.conf values to be changed via SQL [review])

2013-08-24 Thread Amit Kapila
On Sat, Aug 24, 2013 at 6:08 PM, Martijn van Oosterhout wrote: > On Fri, Aug 23, 2013 at 06:41:04PM +0530, Amit Kapila wrote: >> > Not with this proposal... If it's fixed then it makes no sense to make it >> > look like it can be modified. >> >>This proposal is to have a special include which

[HACKERS] What is the algorithm used for counting the set bit (number of ones) of a bitmap/bitarray/betset in postgresql?

2013-08-24 Thread Kanarupan Kularatnarajah
I've come across lookup tables, Hamming weights and Brain Kernighan's Algo. Are they used (combined or separately) in bitmap counting? Where can I find the coding and please explain the flow a count function (for a bit counting) via coding rather than the high level architectural diagrams (which I

[HACKERS] bitset counting as a user defined function in postgresql 9.2?

2013-08-24 Thread Kanarupan Kularatnarajah
As an initial attempt to try hands-on with postgresql, I've learned on user created functions and some other internals of postgresql. Few materials on postgresql indicate that the aggregate functions are slow due to some internal reasons (index covering, null etc). I'm looking forward to implemen

Re: [HACKERS] Unpacking scalar JSON values

2013-08-24 Thread Daniel Farina
On Sat, Aug 24, 2013 at 6:04 PM, Daniel Farina wrote: > But there's no good way I can find from the documentation to do it > with a scalar: select ('"va\"lue"'::json)::text; Triggered send by accident: select ('"va\"lue"'::json)::text; text --- "va\"lue" (1 row) the JSON escaping is

Re: [HACKERS] Unpacking scalar JSON values

2013-08-24 Thread Daniel Farina
On Sat, Aug 24, 2013 at 3:09 PM, Hannu Krosing wrote: > On 08/24/2013 11:36 PM, Daniel Farina wrote: >> Per report of Armin Ronacher, it's not clear how to take a scalar JSON >> string and unquote it into a regular Postgres "text" value, given what >> I can see here: >> http://www.postgresql.org/d

Re: [HACKERS] Parallel pg_basebackup

2013-08-24 Thread Emanuel Calvo
That looks promising! Thanks Peter! 2013/8/24 Peter Eisentraut > On Fri, 2013-08-23 at 10:51 -0300, Emanuel Calvo wrote: > > I was wondering if there is a proposal for parallelize pg_basebackup > > There isn't one, but after some talk behind the scenes, I think we > should definitely look into

Re: [HACKERS] Re: Request for Patch Feedback: Lag & Lead Window Functions Can Ignore Nulls

2013-08-24 Thread Nicholas White
> Please fix these compiler warnings Fixed - see attached. Thanks - lead-lag-ignore-nulls.patch Description: Binary data -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers

Re: [HACKERS] Unpacking scalar JSON values

2013-08-24 Thread Hannu Krosing
On 08/24/2013 11:36 PM, Daniel Farina wrote: > Per report of Armin Ronacher, it's not clear how to take a scalar JSON > string and unquote it into a regular Postgres "text" value, given what > I can see here: > http://www.postgresql.org/docs/9.3/static/functions-json.html > > Example: > > SELECT '"

[HACKERS] Unpacking scalar JSON values

2013-08-24 Thread Daniel Farina
Per report of Armin Ronacher, it's not clear how to take a scalar JSON string and unquote it into a regular Postgres "text" value, given what I can see here: http://www.postgresql.org/docs/9.3/static/functions-json.html Example: SELECT '"a json string"'::json; (Although this some problem could p

Re: [HACKERS] pgbench progress report improvements

2013-08-24 Thread Fabien COELHO
Here is a patch submission for reference to the next commitfest. Please replace the tabs in the SGML files with spaces. Attached a v2 with tabs replaced by spaces. -- Fabien.diff --git a/contrib/pgbench/pgbench.c b/contrib/pgbench/pgbench.c index ad8e272..a90b188 100644 --- a/contrib/pgbenc

[HACKERS] Call for translations

2013-08-24 Thread Peter Eisentraut
In anticipation of the release of PostgreSQL 9.3, it is once again time to update the message translations. We are now in a string freeze, which has traditionally been associated with the first release candidate, so it's a good time to do this work now. If you want to help, see

Re: [HACKERS] Performance problem in PLPgSQL

2013-08-24 Thread Tom Lane
Marc Cousin writes: > On 23/08/2013 23:55, Tom Lane wrote: >> My previous suggestion was to estimate planning cost as >> 10 * (length(plan->rangetable) + 1) >> but on reflection it ought to be scaled by one of the cpu cost constants, >> so perhaps >> 1000 * cpu_operator_cost * (length(plan->ranget

Re: [HACKERS] PL/pgSQL PERFORM with CTE

2013-08-24 Thread Tom Lane
Pavel Stehule writes: > Oracle has a special function for returning sets from procedures - see a > new functionality "Implicit Result Sets" > http://tkyte.blogspot.cz/2013/07/12c-implicit-result-sets.html That article is worth reading, because Tom K. points out exactly why T-SQL's approach is a b

Re: [HACKERS] Performance problem in PLPgSQL

2013-08-24 Thread Marc Cousin
On 23/08/2013 23:55, Tom Lane wrote: Pavel Stehule writes: please, can you send a self explained test this issue should be fixed, and we need a examples. We already had a perfectly good example at the beginning of this thread. What's missing is a decision on how we ought to approximate the cos

Re: [HACKERS] Re: Request for Patch Feedback: Lag & Lead Window Functions Can Ignore Nulls

2013-08-24 Thread Peter Eisentraut
On Wed, 2013-08-21 at 22:34 -0400, Nicholas White wrote: > > but needs a rebase. > > See attached - thanks! Please fix these compiler warnings: windowfuncs.c: In function ‘leadlag_common’: windowfuncs.c:366:3: warning: passing argument 1 of ‘bms_initialize’ from incompatible pointer type [enabl

Re: [HACKERS] Detail part for still waiting for lock log message

2013-08-24 Thread Peter Eisentraut
On Tue, 2013-08-20 at 19:21 +0300, Tarvi Pillessaar wrote: > About patch: > Patch is tested against 9.2.4. > I was not sure that i should check if the lock holder's proclock was > found (as lock holder's proclock should be always there), check is there > to be on the safe side, but maybe it's unn

Re: [HACKERS] UNNEST with multiple args, and TABLE with multiple funcs

2013-08-24 Thread Peter Eisentraut
On Tue, 2013-08-13 at 13:54 +, Andrew Gierth wrote: > Summary: > > This patch implements a method for expanding multiple SRFs in parallel > that does not have the surprising LCM behaviour of SRFs-in-select-list. > (Functions returning fewer rows are padded with nulls instead.) Fails to build

Re: [HACKERS] pgbench progress report improvements

2013-08-24 Thread Peter Eisentraut
On Tue, 2013-08-06 at 10:47 +0200, Fabien wrote: > Here is a patch submission for reference to the next commitfest. Please replace the tabs in the SGML files with spaces. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.post

Re: [HACKERS] Backup throttling

2013-08-24 Thread Peter Eisentraut
On Wed, 2013-07-24 at 09:20 +0200, Antonin Houska wrote: > the purpose of this patch is to limit impact of pg_backup on running > server. Feedback is appreciated. Please replace the tabs in the SGML files with spaces. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To ma

Re: [HACKERS] Re: Proposal/design feedback needed: WITHIN GROUP (sql standard ordered set aggregate functions)

2013-08-24 Thread Peter Eisentraut
On Fri, 2013-07-19 at 21:29 +0530, Atri Sharma wrote: > Hi all, > > This is our current work-in-progress patch for WITHIN GROUP. Please fix these compiler warnings: parse_agg.c: In function ‘check_ungrouped_columns_walker’: parse_agg.c:848:3: warning: passing argument 1 of ‘check_ungrouped_colu

Re: [HACKERS] [GENERAL] currval and DISCARD ALL

2013-08-24 Thread Peter Eisentraut
On Fri, 2013-04-19 at 11:58 -0300, Fabrízio de Royes Mello wrote: > > Ohh sorry... you're all right... I completely forgot to finish the > ReleaseSequenceCaches to transverse 'seqtab' linked list and free each > node. > > The attached patch have this correct code. Please fix this compiler war

Re: [HACKERS] Patch for fail-back without fresh backup

2013-08-24 Thread Peter Eisentraut
On Thu, 2013-07-11 at 23:42 +0900, Sawada Masahiko wrote: > please find the attached patch. Please fix these compiler warnings: xlog.c:3117:2: warning: implicit declaration of function ‘SyncRepWaitForLSN’ [-Wimplicit-function-declaration] syncrep.c:414:6: warning: variable ‘numdataflush’ set but

Re: [HACKERS] PL/pgSQL PERFORM with CTE

2013-08-24 Thread Pavel Stehule
2013/8/24 Merlin Moncure > On Fri, Aug 23, 2013 at 5:07 PM, Tom Lane wrote: > > Josh Berkus writes: > >> Currently the only way to return query results to the caller is to use > >> some form of RETURN. It is 100% consistent. > > > > I don't find it consistent at all, because what that means is

[HACKERS] PL/pgSQL PERFORM with CTE

2013-08-24 Thread Merlin Moncure
On Fri, Aug 23, 2013 at 5:07 PM, Tom Lane wrote: > Josh Berkus writes: >> Currently the only way to return query results to the caller is to use >> some form of RETURN. It is 100% consistent. > > I don't find it consistent at all, because what that means is that the > data is to be returned to t

Re: ALTER SYSTEM SET command to change postgresql.conf parameters (RE: [HACKERS] Proposal for Allow postgresql.conf values to be changed via SQL [review])

2013-08-24 Thread Martijn van Oosterhout
On Fri, Aug 23, 2013 at 06:41:04PM +0530, Amit Kapila wrote: > > Not with this proposal... If it's fixed then it makes no sense to make it > > look like it can be modified. > >This proposal is to have a special include which user can only use > for enable/disable >which means he can remov

Re: [HACKERS] Behaviour of take over the synchronous replication

2013-08-24 Thread Sawada Masahiko
On Sat, Aug 24, 2013 at 3:14 AM, Josh Berkus wrote: > On 08/23/2013 12:42 AM, Sawada Masahiko wrote: >> in case (a), those priority is clear. So I think that re-taking over >> is correct behaviour. >> OHOT, in case (b), even if AAA and BBB are set same priority, AAA >> server steals SYNC replicati