Re: [HACKERS] Function to know last log write timestamp

2014-08-11 Thread Andres Freund
On 2014-08-11 12:42:06 +0900, Fujii Masao wrote: On Mon, Aug 11, 2014 at 10:48 AM, Tatsuo Ishii is...@postgresql.org wrote: On Mon, Aug 11, 2014 at 9:23 AM, Tatsuo Ishii is...@postgresql.org wrote: We can know the LSN of last committed WAL record on primary by using

Re: [HACKERS] nulls in GIN index

2014-08-11 Thread Heikki Linnakangas
On 08/11/2014 01:19 AM, worthy7 wrote: http://www.postgresql.org/docs/9.1/static/gin-implementation.html As of PostgreSQL 9.1, NULL key values can be included in the index. Also, placeholder NULLs are included in the index for indexed items that are NULL or contain no keys according to

Re: [HACKERS] Function to know last log write timestamp

2014-08-11 Thread Fujii Masao
On Mon, Aug 11, 2014 at 3:54 PM, Andres Freund and...@2ndquadrant.com wrote: On 2014-08-11 12:42:06 +0900, Fujii Masao wrote: On Mon, Aug 11, 2014 at 10:48 AM, Tatsuo Ishii is...@postgresql.org wrote: On Mon, Aug 11, 2014 at 9:23 AM, Tatsuo Ishii is...@postgresql.org wrote: We can know

Re: [HACKERS] Support for N synchronous standby servers

2014-08-11 Thread Fujii Masao
On Mon, Aug 11, 2014 at 2:10 PM, Michael Paquier michael.paqu...@gmail.com wrote: On Mon, Aug 11, 2014 at 1:26 PM, Fujii Masao masao.fu...@gmail.com wrote: Thanks for updating the patch! Again I tested the feature and found something wrong. I set synchronous_standby_num to 2 and started

Re: [HACKERS] Function to know last log write timestamp

2014-08-11 Thread Andres Freund
On 2014-08-11 16:20:41 +0900, Fujii Masao wrote: On Mon, Aug 11, 2014 at 3:54 PM, Andres Freund and...@2ndquadrant.com wrote: On 2014-08-11 12:42:06 +0900, Fujii Masao wrote: On Mon, Aug 11, 2014 at 10:48 AM, Tatsuo Ishii is...@postgresql.org wrote: On Mon, Aug 11, 2014 at 9:23 AM,

Re: [HACKERS] Support for N synchronous standby servers

2014-08-11 Thread Michael Paquier
On Mon, Aug 11, 2014 at 4:26 PM, Fujii Masao masao.fu...@gmail.com wrote: On Mon, Aug 11, 2014 at 2:10 PM, Michael Paquier michael.paqu...@gmail.com wrote: Oh, that worked in my machine, too, this time... I did something wrong. Sorry for the noise. No problem, thanks for spending time testing.

Re: [HACKERS] [REVIEW] pg_last_xact_insert_timestamp

2014-08-11 Thread Andres Freund
Hi, On 2011-10-04 20:52:59 +0900, Fujii Masao wrote: *** a/src/backend/access/transam/xact.c --- b/src/backend/access/transam/xact.c *** *** 1066,1071 RecordTransactionCommit(void) --- 1066,1074 (void) XLogInsert(RM_XACT_ID,

Re: [HACKERS] nulls in GIN index

2014-08-11 Thread worthy7
Perhaps I'm missing something Table has 2 columns, text and ftstext text: how are you ftstest: (nothing) Because how and are and you are too common to be tsvectored. Which is fine. So if a user searches for how are you: select * from tbl_lines WHERE ftstext @@ plainto_tsquery('English', 'how

Re: [HACKERS] [REVIEW] pg_last_xact_insert_timestamp

2014-08-11 Thread Fujii Masao
On Mon, Aug 11, 2014 at 4:46 PM, Andres Freund and...@2ndquadrant.com wrote: Hi, On 2011-10-04 20:52:59 +0900, Fujii Masao wrote: *** a/src/backend/access/transam/xact.c --- b/src/backend/access/transam/xact.c *** *** 1066,1071 RecordTransactionCommit(void) --- 1066,1074

Re: [HACKERS] psql: show only failed queries

2014-08-11 Thread Fujii Masao
On Sat, Aug 9, 2014 at 4:16 AM, Pavel Stehule pavel.steh...@gmail.com wrote: Hi 2014-08-08 13:58 GMT+02:00 Fujii Masao masao.fu...@gmail.com: On Fri, Aug 8, 2014 at 4:31 AM, Pavel Stehule pavel.steh...@gmail.com wrote: 2014-08-07 7:10 GMT+02:00 Fujii Masao masao.fu...@gmail.com:

[HACKERS] ProcessUtilityHook DropStmt RenameStmt

2014-08-11 Thread geohas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi! I try to catch a DropStmt and convert it to a Rename Stmt, like petere's pg_trashcan, but i don't like to create new schema. I only like to rename the table in case of a drop table query. Is this possible with something like: ProcessUtility

Re: [HACKERS] Proposal to add a QNX 6.5 port to PostgreSQL

2014-08-11 Thread Kevin Grittner
Stephen Frost sfr...@snowman.net wrote: Our grace period for active backends after unclean exit of one of their peers is low, milliseconds to seconds.  Our grace period for active backends after unclean exit of the postmaster is unconstrained.  At least one of those policies has to be wrong.

Re: [HACKERS] nulls in GIN index

2014-08-11 Thread Andreas Joseph Krogh
På mandag 11. august 2014 kl. 11:17:56, skrev worthy7 worthy@gmail.com mailto:worthy@gmail.com: Perhaps I'm missing something Table has 2 columns, text and ftstext text: how are you ftstest: (nothing) Because how and are and you are too common to be tsvectored. Which is fine. So

Re: [HACKERS] Hokey wrong versions of libpq in apt.postgresql.org

2014-08-11 Thread Stephen Frost
JD, * Joshua D. Drake (j...@commandprompt.com) wrote: The issue that I specifically ran into is that by using apt.postgresql.org in its default configuration, I can't add certain extensions (without jumping through hoops). Simple: Assume a running 9.2.9 from apt.postgresql.org apt-get

Re: [HACKERS] Proposal: Incremental Backup

2014-08-11 Thread Robert Haas
On Tue, Aug 5, 2014 at 8:04 PM, Simon Riggs si...@2ndquadrant.com wrote: To decide whether we need to re-copy the file, you read the file until we find a block with a later LSN. If we read the whole file without finding a later LSN then we don't need to re-copy. That means we read each file

Re: [HACKERS] Proposal to add a QNX 6.5 port to PostgreSQL

2014-08-11 Thread Andres Freund
On 2014-08-10 18:36:18 -0400, Noah Misch wrote: [Due for a new subject line?] On Sat, Aug 09, 2014 at 08:16:01PM +0200, Andres Freund wrote: On 2014-08-09 14:09:36 -0400, Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: On 2014-08-09 14:00:49 -0400, Tom Lane wrote: I

Re: [HACKERS] Proposal to add a QNX 6.5 port to PostgreSQL

2014-08-11 Thread Robert Haas
On Sat, Aug 9, 2014 at 2:00 PM, Tom Lane t...@sss.pgh.pa.us wrote: +1. I think the current behaviour is a seriously bad idea. I don't think it's anywhere near as black-and-white as you guys claim. What it comes down to is whether allowing existing transactions/sessions to finish is more

[HACKERS] failures on barnacle (CLOBBER_CACHE_RECURSIVELY) because of memory leaks

2014-08-11 Thread Tomas Vondra
Hi! So after 83 days, the regression tests on barnacle completed, and it smells like another memory leak in CacheMemoryContext, similar to those fixed in 078b2ed on May 18. Barnacle is one of those machines with -DCLOBBER_CACHE_RECURSIVELY, and the tests were running with a snapshot from May 19,

Re: [HACKERS] [RFC] Should smgrtruncate() avoid sending sinval message for temp relations

2014-08-11 Thread Robert Haas
On Fri, Aug 8, 2014 at 10:30 AM, MauMau maumau...@gmail.com wrote: I've tracked down the real root cause. The fix is very simple. Please check the attached one-liner patch. I confirmed that the fix is already in 9.3 and 9.5devel, so I just copied the code fragment from 9.5devel to 9.2.9.

Re: [HACKERS] Proposal: Incremental Backup

2014-08-11 Thread Claudio Freire
On Mon, Aug 11, 2014 at 12:27 PM, Robert Haas robertmh...@gmail.com wrote: As Marco says, that can be optimized using filesystem timestamps instead. The idea of using filesystem timestamps gives me the creeps. Those aren't always very granular, and I don't know that (for example) they are

Re: [HACKERS] replication commands and log_statements

2014-08-11 Thread Robert Haas
On Fri, Aug 8, 2014 at 1:04 PM, Fujii Masao masao.fu...@gmail.com wrote: On Sat, Aug 9, 2014 at 12:29 AM, Robert Haas robertmh...@gmail.com wrote: On Fri, Aug 8, 2014 at 11:00 AM, Bruce Momjian br...@momjian.us wrote: On Fri, Aug 8, 2014 at 08:51:13AM -0400, Robert Haas wrote: On Thu, Aug 7,

Re: [HACKERS] postgresql.auto.conf and reload

2014-08-11 Thread Fujii Masao
On Sun, Aug 10, 2014 at 3:54 PM, Amit Kapila amit.kapil...@gmail.com wrote: On Fri, Aug 8, 2014 at 11:41 AM, Fujii Masao masao.fu...@gmail.com wrote: Yep, right. ParseConfigFp() is not good place to pick up data_directory. What about the attached patch which makes ProcessConfigFile() instead

Re: [HACKERS] psql output change in 9.4

2014-08-11 Thread Robert Haas
On Fri, Aug 8, 2014 at 9:34 PM, Peter Eisentraut pete...@gmx.net wrote: This is 9.3: peter=# \a Output format is unaligned. peter=# \a Output format is aligned. peter=# \x Expanded display is on. peter=# \x Expanded display is off. This is new in 9.4: peter=# \a Output format

Re: [HACKERS] 9.4 pg_restore --help changes

2014-08-11 Thread Robert Haas
On Fri, Aug 8, 2014 at 9:44 PM, Peter Eisentraut pete...@gmx.net wrote: This is a valuable feature change, but I think the help output is unhelpful. The left side has a singular placeholder, but the right side talks about objects in plural. How do I actually specify multiple indexes? Is is

Re: [HACKERS] psql output change in 9.4

2014-08-11 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Fri, Aug 8, 2014 at 9:34 PM, Peter Eisentraut pete...@gmx.net wrote: What is the point of that change? I think the output could justly be criticized for making it insufficiently clear that the parenthesized text is, in fact, the name of the pset

Re: [HACKERS] Removing dependency to wsock32.lib when compiling code on WIndows

2014-08-11 Thread Jeff Janes
On Tue, Jul 15, 2014 at 5:14 AM, Michael Paquier michael.paqu...@gmail.com wrote: On Tue, Jul 15, 2014 at 8:46 PM, Magnus Hagander mag...@hagander.net wrote: On Thu, Jun 19, 2014 at 4:13 PM, MauMau maumau...@gmail.com wrote: From: Michael Paquier michael.paqu...@gmail.com You are right,

Re: [HACKERS] replication commands and log_statements

2014-08-11 Thread Stephen Frost
* Robert Haas (robertmh...@gmail.com) wrote: On Fri, Aug 8, 2014 at 1:04 PM, Fujii Masao masao.fu...@gmail.com wrote: You can do that by executing ALTER ROLE replication user SET log_statement TO 'all'. If you don't use the replication user to execute SQL statements, no SQL statements are

Re: [HACKERS] psql output change in 9.4

2014-08-11 Thread Pavel Stehule
2014-08-11 19:52 GMT+02:00 Tom Lane t...@sss.pgh.pa.us: Robert Haas robertmh...@gmail.com writes: On Fri, Aug 8, 2014 at 9:34 PM, Peter Eisentraut pete...@gmx.net wrote: What is the point of that change? I think the output could justly be criticized for making it insufficiently clear

Re: [HACKERS] bad estimation together with large work_mem generates terrible slow hash joins

2014-08-11 Thread Robert Haas
On Sat, Aug 9, 2014 at 9:13 AM, Tomas Vondra t...@fuzzy.cz wrote: Adding least-significant bit does not work, we need get back to adding the most-significant one. Not sure what's the least complex way to do that, though. I'm thinking about computing the nbuckets limit (how many buckets may

Re: [HACKERS] psql output change in 9.4

2014-08-11 Thread Robert Haas
On Mon, Aug 11, 2014 at 1:52 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: On Fri, Aug 8, 2014 at 9:34 PM, Peter Eisentraut pete...@gmx.net wrote: What is the point of that change? I think the output could justly be criticized for making it insufficiently

Re: [HACKERS] jsonb format is pessimal for toast compression

2014-08-11 Thread Robert Haas
On Sat, Aug 9, 2014 at 3:51 PM, Tom Lane t...@sss.pgh.pa.us wrote: Kevin Grittner kgri...@ymail.com writes: Stephen Frost sfr...@snowman.net writes: Trying to move the header to the end just for the sake of this doesn't strike me as a good solution as it'll make things quite a bit more

Re: [HACKERS] jsonb format is pessimal for toast compression

2014-08-11 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: ... I think it would be a better idea to arrange some method by which JSONB (and perhaps other data types) can provide compression hints to pglz. I agree with that as a long-term goal, but not sure if it's sane to push into 9.4. What we could

Re: [HACKERS] jsonb format is pessimal for toast compression

2014-08-11 Thread Peter Geoghegan
On Mon, Aug 11, 2014 at 12:07 PM, Robert Haas robertmh...@gmail.com wrote: I think that's a good point. I think that there may be something to be said for the current layout. Having adjacent keys and values could take better advantage of CPU cache characteristics. I've heard of approaches to

Re: [HACKERS] psql: show only failed queries

2014-08-11 Thread Pavel Stehule
2014-08-11 14:59 GMT+02:00 Fujii Masao masao.fu...@gmail.com: On Sat, Aug 9, 2014 at 4:16 AM, Pavel Stehule pavel.steh...@gmail.com wrote: Hi 2014-08-08 13:58 GMT+02:00 Fujii Masao masao.fu...@gmail.com: On Fri, Aug 8, 2014 at 4:31 AM, Pavel Stehule pavel.steh...@gmail.com wrote:

Re: [HACKERS] 9.4 pg_restore --help changes

2014-08-11 Thread Alvaro Herrera
Robert Haas wrote: On Fri, Aug 8, 2014 at 9:44 PM, Peter Eisentraut pete...@gmx.net wrote: or perhaps make a note at the bottom The options -I, -n, -P, -t, -T, --section can be combined and specified multiple times to select multiple objects. Other ideas? I like

Re: [HACKERS] jsonb format is pessimal for toast compression

2014-08-11 Thread Stephen Frost
* Tom Lane (t...@sss.pgh.pa.us) wrote: Robert Haas robertmh...@gmail.com writes: ... I think it would be a better idea to arrange some method by which JSONB (and perhaps other data types) can provide compression hints to pglz. I agree with that as a long-term goal, but not sure if it's

Re: [HACKERS] jsonb format is pessimal for toast compression

2014-08-11 Thread Tom Lane
Stephen Frost sfr...@snowman.net writes: * Tom Lane (t...@sss.pgh.pa.us) wrote: What we could conceivably do now is (a) add a datatype OID argument to toast_compress_datum, and (b) hard-wire the selection of a different compression-parameters struct if it's JSONBOID. The actual fix would

Re: [HACKERS] jsonb format is pessimal for toast compression

2014-08-11 Thread Stephen Frost
* Peter Geoghegan (p...@heroku.com) wrote: If there is to be any effort to make jsonb a more effective target for compression, I imagine that that would have to target redundancy between JSON documents. With idiomatic usage, we can expect plenty of it. While I certainly agree, that's a rather

Re: [HACKERS] jsonb format is pessimal for toast compression

2014-08-11 Thread Peter Geoghegan
On Mon, Aug 11, 2014 at 1:01 PM, Stephen Frost sfr...@snowman.net wrote: We've got a clear example of someone, quite reasonably, expecting their JSONB object to be compressed using the normal TOAST mechanism, and we're failing to do that in cases where it's actually a win to do so. That's the

Re: [HACKERS] 9.4 logical replication - walsender keepalive replies

2014-08-11 Thread Steve Singer
On 07/14/2014 01:19 PM, Steve Singer wrote: On 07/06/2014 10:11 AM, Andres Freund wrote: Hi Steve, Right. I thought about this for a while, and I think we should change two things. For one, don't request replies here. It's simply not needed, as this isn't dealing with timeouts. For another

Re: [HACKERS] 9.4 logical replication - walsender keepalive replies

2014-08-11 Thread Andres Freund
On 2014-08-11 17:22:27 -0400, Steve Singer wrote: On 07/14/2014 01:19 PM, Steve Singer wrote: On 07/06/2014 10:11 AM, Andres Freund wrote: Hi Steve, Right. I thought about this for a while, and I think we should change two things. For one, don't request replies here. It's simply not needed,

Re: [HACKERS] bad estimation together with large work_mem generates terrible slow hash joins

2014-08-11 Thread Tomas Vondra
On 11.8.2014 20:25, Robert Haas wrote: On Sat, Aug 9, 2014 at 9:13 AM, Tomas Vondra t...@fuzzy.cz wrote: Adding least-significant bit does not work, we need get back to adding the most-significant one. Not sure what's the least complex way to do that, though. I'm thinking about computing the

Re: [HACKERS] [RFC] Should smgrtruncate() avoid sending sinval message for temp relations

2014-08-11 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Fri, Aug 8, 2014 at 10:30 AM, MauMau maumau...@gmail.com wrote: I've tracked down the real root cause. The fix is very simple. Please check the attached one-liner patch. I'd support back-porting that commit to 9.1 and 9.2 as a fix for this

Re: [HACKERS] failures on barnacle (CLOBBER_CACHE_RECURSIVELY) because of memory leaks

2014-08-11 Thread Tom Lane
Tomas Vondra t...@fuzzy.cz writes: So after 83 days, the regression tests on barnacle completed, Hah, that's perseverance! and it smells like another memory leak in CacheMemoryContext, similar to those fixed in 078b2ed on May 18. Ugh, will look. See this:

Re: [HACKERS] failures on barnacle (CLOBBER_CACHE_RECURSIVELY) because of memory leaks

2014-08-11 Thread Tomas Vondra
On 12.8.2014 02:05, Tom Lane wrote: Evidently the OOM killer is at large on this machine. Yes. It's a machine with only 8GB of RAM, and there are 3 VMs (LXC containers), with 2GB of RAM each. That's not much, but while it's mostly out of necessity, it's apparently a good way to catch leaks.

Re: [HACKERS] Removing dependency to wsock32.lib when compiling code on WIndows

2014-08-11 Thread Noah Misch
On Mon, Aug 11, 2014 at 11:02:48AM -0700, Jeff Janes wrote: While trying to test more recent stuff against mingw, I kept running into a problem which bisected down to this (a16bac36eca8158cbf78987e953). This is the warning/error I get: auth.c: In function 'ClientAuthentication':

Re: [HACKERS] Improvement of versioning on Windows, take two

2014-08-11 Thread Michael Paquier
On Sun, Aug 10, 2014 at 9:31 PM, MauMau maumau...@gmail.com wrote: From: Michael Paquier michael.paqu...@gmail.com LINK : fatal error LNK1104: ファイル '.\release\postgres\src_timezone_win32ver.obj' を開くことができません。 Oh yes, right. I don't really know how I missed this error when testing v1. Adding an

Re: [HACKERS] psql: show only failed queries

2014-08-11 Thread Fujii Masao
On Tue, Aug 12, 2014 at 4:41 AM, Pavel Stehule pavel.steh...@gmail.com wrote: 2014-08-11 14:59 GMT+02:00 Fujii Masao masao.fu...@gmail.com: On Sat, Aug 9, 2014 at 4:16 AM, Pavel Stehule pavel.steh...@gmail.com wrote: Hi 2014-08-08 13:58 GMT+02:00 Fujii Masao masao.fu...@gmail.com:

Re: [HACKERS] psql: show only failed queries

2014-08-11 Thread Pavel Stehule
Oh, just revived that code. yes, It is looking well Ok, committed! super thank you very much Regards Pavel Regards, -- Fujii Masao

Re: [HACKERS] replication commands and log_statements

2014-08-11 Thread Fujii Masao
On Tue, Aug 12, 2014 at 2:34 AM, Robert Haas robertmh...@gmail.com wrote: On Fri, Aug 8, 2014 at 1:04 PM, Fujii Masao masao.fu...@gmail.com wrote: On Sat, Aug 9, 2014 at 12:29 AM, Robert Haas robertmh...@gmail.com wrote: On Fri, Aug 8, 2014 at 11:00 AM, Bruce Momjian br...@momjian.us wrote: On

Re: [HACKERS] postgresql.auto.conf and reload

2014-08-11 Thread Amit Kapila
On Mon, Aug 11, 2014 at 11:08 PM, Fujii Masao masao.fu...@gmail.com wrote: While updating the patch, I found that the ConfigVariable which is removed from list has the fields that the memory has been already allocated but we forgot to free them. So I included the code to free them in the

Re: [HACKERS] replication commands and log_statements

2014-08-11 Thread Amit Kapila
On Tue, Aug 12, 2014 at 9:29 AM, Fujii Masao masao.fu...@gmail.com wrote: On Tue, Aug 12, 2014 at 2:34 AM, Robert Haas robertmh...@gmail.com wrote: If you have a user devoted to it, I suppose that's true. I still think it shouldn't get munged together like that. Why do we need to treat

Re: [HACKERS] Removing dependency to wsock32.lib when compiling code on WIndows

2014-08-11 Thread Michael Paquier
On Tue, Aug 12, 2014 at 9:43 AM, Noah Misch n...@leadboat.com wrote: Somehow or other, we must bring these parts into agreement. It is interesting to see that with MinGW-32b getaddrinfo is still set to no at configure phase. What if we simply wrap undef gai_strerror like in the patch attached?

Re: [HACKERS] 9.5: Memory-bounded HashAgg

2014-08-11 Thread Jeff Davis
On Mon, 2014-08-11 at 01:29 +0200, Tomas Vondra wrote: On 10.8.2014 23:26, Jeff Davis wrote: This patch is requires the Memory Accounting patch, or something similar to track memory usage. I think the patch you sent actually includes the accounting patch. Is that on purpose, or by

Re: [HACKERS] Removing dependency to wsock32.lib when compiling code on WIndows

2014-08-11 Thread Noah Misch
On Tue, Aug 12, 2014 at 01:58:17PM +0900, Michael Paquier wrote: On Tue, Aug 12, 2014 at 9:43 AM, Noah Misch n...@leadboat.com wrote: Somehow or other, we must bring these parts into agreement. It is interesting to see that with MinGW-32b getaddrinfo is still set to no at configure