Re: [HACKERS] Patch for CREATE RULE sgml -- Was in: [DOCS]

2014-03-21 Thread Michael Paquier
On Sat, Mar 22, 2014 at 11:18 AM, Jaime Casanova wrote: > On Fri, Mar 21, 2014 at 8:15 PM, Michael Paquier > wrote: >> >> On Sat, Mar 22, 2014 at 12:56 AM, Emanuel Calvo >> wrote: >> > I realized that the output of the CREATE RULE has not a detailed >> > output for the "events" parameter. >> > >

Re: [HACKERS] Partial index locks

2014-03-21 Thread Tom Lane
Thom Brown writes: > Is it necessary for a partial index that doesn't include the row to be > involved in locking? Yes. You can't determine whether the index needs to get a new entry without examining its metadata, and that's what the lock is mainly about. The only possible alternative would be

Re: [HACKERS] Patch for CREATE RULE sgml -- Was in: [DOCS]

2014-03-21 Thread Jaime Casanova
On Fri, Mar 21, 2014 at 8:15 PM, Michael Paquier wrote: > > On Sat, Mar 22, 2014 at 12:56 AM, Emanuel Calvo > wrote: > > I realized that the output of the CREATE RULE has not a detailed > > output for the "events" parameter. > > > The list of events possible is already listed in the section > "Pa

Re: [HACKERS] Partial index locks

2014-03-21 Thread Thom Brown
On 22 March 2014 00:59, Vik Fearing wrote: > On 03/22/2014 01:43 AM, Thom Brown wrote: >> Hi, >> >> I've created a table with 1000 partial indexes. Each one matches >> exactly one row based on the predicate WHERE id = . >> >> However, when I perform an UPDATE of a single row in a transaction, >>

Re: [HACKERS] Patch for CREATE RULE sgml -- Was in: [DOCS]

2014-03-21 Thread Michael Paquier
On Sat, Mar 22, 2014 at 12:56 AM, Emanuel Calvo wrote: > I realized that the output of the CREATE RULE has not a detailed > output for the "events" parameter. > > But the question here is that I'm not sure which format follow: > > { INSERT | UPDATE | DELETE | SELECT} > > or > > INSERT > UP

Re: [HACKERS] psql blows up on BOM character sequence

2014-03-21 Thread David E. Wheeler
On Mar 21, 2014, at 2:16 PM, Andrew Dunstan wrote: > Surely if it were really a major annoyance, someone would have sent code to > fix it during the last 4 years and more since the above. > > I suspect it's a minor annoyance :-) > > But by all means add it to the TODO list if it's not there al

Re: [HACKERS] Partial index locks

2014-03-21 Thread Vik Fearing
On 03/22/2014 01:43 AM, Thom Brown wrote: > Hi, > > I've created a table with 1000 partial indexes. Each one matches > exactly one row based on the predicate WHERE id = . > > However, when I perform an UPDATE of a single row in a transaction, > I've noticed that all those partial indexes show up i

[HACKERS] Partial index locks

2014-03-21 Thread Thom Brown
Hi, I've created a table with 1000 partial indexes. Each one matches exactly one row based on the predicate WHERE id = . However, when I perform an UPDATE of a single row in a transaction, I've noticed that all those partial indexes show up in pg_locks with RowExclusiveLock. Only 2 of those ind

Re: [HACKERS] Standby server won't start

2014-03-21 Thread Tatsuo Ishii
> That's because the parameter is checked at the beginning of recovery > (i.e. at standby start) before XLOG_PARAMETER_CHANGE is received and > applied on the standby. Please see CheckRequiredParameterValues() in > StartupXLOG(). > > To persist the max_connections change: > > 1) stop primary > 2

Re: [HACKERS] ALTER TABLE lock strength reduction patch is unsafe Reply-To:

2014-03-21 Thread Tom Lane
Simon Riggs writes: > On 21 March 2014 20:58, Noah Misch wrote: >> It's not the behavior I would choose for a new product, but I can't see >> benefits sufficient to overturn previous decisions to keep it. > Speechless The key argument for not "fixing" this is that it would break existing pg_dum

Re: [HACKERS] equalTupleDescs() ignores ccvalid/ccnoinherit

2014-03-21 Thread Tom Lane
Robert Haas writes: > On Fri, Mar 21, 2014 at 12:12 AM, Noah Misch wrote: >> Given the minor symptoms in released versions, I lean against a back-patch. > FWIW, I'd lean toward a back-patch. It's probably not a big deal > either way, but I have a hard time seeing what risk we're avoiding by > n

[HACKERS] Best way to know frequency of column reference?

2014-03-21 Thread Kohei KaiGai
Hello, As people may know, I've implemented a relation cache mechanism on top of custom-plan interface, that holds contents of a particular columns only, thus it does not need to take storage access as long as user's query refers the columns on in-memory cache. The key factor of how this mechanism

Re: [HACKERS] [RFC] What should we do for reliable WAL archiving?

2014-03-21 Thread Bruce Momjian
On Fri, Mar 21, 2014 at 01:16:08PM -0700, Jeff Janes wrote: > On Sun, Mar 16, 2014 at 3:23 AM, MauMau wrote: > > Hello, > > The PostgreSQL documentation describes cp (on UNIX/Linux) or copy (on > Windows) as an example for archive_command. However, cp/copy does not > sync > the

Re: [HACKERS] Why is autovacuum_freeze_max_age a postmaster setting?

2014-03-21 Thread Jim Nasby
On 3/21/14, 4:55 PM, Andres Freund wrote: Hi, On 2014-03-21 16:49:53 -0500, Jim Nasby wrote: Why do we require a restart to change autovacuum_freeze_max_age? Can’t we respawn the autovac workers to pick up the setting? (Or just pass the HUP down to them?) It's more complex than notifying the

Re: [HACKERS] Memory ordering issue in LWLockRelease, WakeupWaiters, WALInsertSlotRelease

2014-03-21 Thread Andres Freund
On 2014-03-21 22:52:33 +0100, Andres Freund wrote: > The committed version doesn't compile with LWLOCK_STATS... Just noticed that it seems to also break the dtrace stuff: http://pgbuildfarm.org/cgi-bin/show_log.pl?nm=rover_firefly&dt=2014-03-21%2018%3A04%3A00 Greetings, Andres Freund -- Andre

Re: [HACKERS] Why is autovacuum_freeze_max_age a postmaster setting?

2014-03-21 Thread Andres Freund
Hi, On 2014-03-21 16:49:53 -0500, Jim Nasby wrote: > Why do we require a restart to change autovacuum_freeze_max_age? Can’t > we respawn the autovac workers to pick up the setting? (Or just pass > the HUP down to them?) It's more complex than notifying the workers. There's limits in shared memory

Re: [HACKERS] psql blows up on BOM character sequence

2014-03-21 Thread Tom Lane
Merlin Moncure writes: > There is no way for psql to handle that case though unless you'd strip > *all* BOMs encountered. Compounding this problem is that there's no > practical way AFAIK to send multiple file to psql via single command > line invocation. If you pass multiple -f arguments all bu

Re: [HACKERS] Memory ordering issue in LWLockRelease, WakeupWaiters, WALInsertSlotRelease

2014-03-21 Thread Andres Freund
Hi, I see you've committed this, cool. Sorry for not getting back to the topic earlier.. On 2014-03-13 22:44:03 +0200, Heikki Linnakangas wrote: > On 03/12/2014 09:29 PM, Andres Freund wrote: > >On 2014-03-07 17:54:32 +0200, Heikki Linnakangas wrote: > >>So there are some unexplained differences

[HACKERS] Why is autovacuum_freeze_max_age a postmaster setting?

2014-03-21 Thread Jim Nasby
Why do we require a restart to change autovacuum_freeze_max_age? Can’t we respawn the autovac workers to pick up the setting? (Or just pass the HUP down to them?) -- Jim C. Nasby, Data Architect j...@nasby.net 512.569.9461 (cell) http://jim.nasby.net

Re: [HACKERS] psql blows up on BOM character sequence

2014-03-21 Thread Merlin Moncure
On Fri, Mar 21, 2014 at 4:28 PM, Tom Lane wrote: > I'd be okay with swallowing a leading BOM if and only if client encoding > is UTF8. This should apply to any file psql reads, whether script or > data. Yeah. The one case that doesn't solve is: cat f1.sql f2.sql | psql ... Which is common usa

Re: [HACKERS] psql blows up on BOM character sequence

2014-03-21 Thread Tom Lane
Andrew Dunstan writes: > Surely if it were really a major annoyance, someone would have sent code > to fix it during the last 4 years and more since the above. The code would probably be pretty trivial, *if* we had consensus on what the behavior ought to be. I'm not sure if we do. People who o

Re: [HACKERS] [RFC] What should we do for reliable WAL archiving?

2014-03-21 Thread MauMau
From: "Jeff Janes" Do people really just copy the files from one directory of local storage to another directory of local storage? I don't see the point of that. It makes sense to archive WAL to a directory of local storage for media recovery. Here, the local storage is a different disk dr

Re: [HACKERS] ALTER TABLE lock strength reduction patch is unsafe Reply-To:

2014-03-21 Thread Simon Riggs
On 21 March 2014 20:58, Noah Misch wrote: > On Fri, Mar 21, 2014 at 06:53:27PM +, Simon Riggs wrote: >> On 21 March 2014 17:49, Noah Misch wrote: >> >> >> > alter table information_schema.triggers set (security_barrier = true); >> >> >> >> I find it hard to justify why we accept such a stat

Re: [HACKERS] psql blows up on BOM character sequence

2014-03-21 Thread Andrew Dunstan
On 03/21/2014 05:06 PM, Merlin Moncure wrote: On Fri, Mar 21, 2014 at 4:02 PM, Jim Nasby wrote: See http://www.postgresql.org/message-id/4afeab39.3000...@dunslane.net This is still broken as of fairly recent HEAD; any objections to adding it to TODO? Agreed: this is a major annoyance.

Re: [HACKERS] psql blows up on BOM character sequence

2014-03-21 Thread Merlin Moncure
On Fri, Mar 21, 2014 at 4:02 PM, Jim Nasby wrote: > See http://www.postgresql.org/message-id/4afeab39.3000...@dunslane.net > > This is still broken as of fairly recent HEAD; any objections to adding it to > TODO? Agreed: this is a major annoyance. merlin -- Sent via pgsql-hackers mailing lis

[HACKERS] psql blows up on BOM character sequence

2014-03-21 Thread Jim Nasby
See http://www.postgresql.org/message-id/4afeab39.3000...@dunslane.net This is still broken as of fairly recent HEAD; any objections to adding it to TODO? -- Jim C. Nasby, Data Architect j...@nasby.net 512.569.9461 (cell) http://jim.nasby.net --

Re: [HACKERS] ALTER TABLE lock strength reduction patch is unsafe Reply-To:

2014-03-21 Thread Noah Misch
On Fri, Mar 21, 2014 at 06:53:27PM +, Simon Riggs wrote: > On 21 March 2014 17:49, Noah Misch wrote: > > >> > alter table information_schema.triggers set (security_barrier = true); > >> > >> I find it hard to justify why we accept such a statement. Surely its a > >> bug when the named table

Re: [HACKERS] [RFC] What should we do for reliable WAL archiving?

2014-03-21 Thread Jeff Janes
On Sun, Mar 16, 2014 at 3:23 AM, MauMau wrote: > Hello, > > The PostgreSQL documentation describes cp (on UNIX/Linux) or copy (on > Windows) as an example for archive_command. However, cp/copy does not sync > the copied data to disk. As a result, the completed WAL segments would be > lost in th

Re: [HACKERS] ALTER TABLE lock strength reduction patch is unsafe Reply-To:

2014-03-21 Thread Simon Riggs
On 21 March 2014 03:45, Noah Misch wrote: >> + * Note that Hot Standby only knows about AccessExclusiveLocks on the master >> + * so any changes that might affect SELECTs running on standbys need to use >> + * AccessExclusiveLocks even if you think a lesser lock would do, unless you >> + * have a

Re: [HACKERS] equalTupleDescs() ignores ccvalid/ccnoinherit

2014-03-21 Thread Simon Riggs
On 21 March 2014 18:26, Robert Haas wrote: >> Given the minor symptoms in released versions, I lean against a back-patch. > > FWIW, I'd lean toward a back-patch. It's probably not a big deal > either way, but I have a hard time seeing what risk we're avoiding by > not back-patching, and it seems

Re: [HACKERS] ALTER TABLE lock strength reduction patch is unsafe Reply-To:

2014-03-21 Thread Simon Riggs
On 21 March 2014 17:49, Noah Misch wrote: >> >> + * Be careful to ensure this function is called for Tables and Indexes >> >> only. >> >> + * It is not currently safe to be called for Views because >> >> security_barrier >> >> + * is listed as an option and so would be allowed to be set at a le

Re: [HACKERS] equalTupleDescs() ignores ccvalid/ccnoinherit

2014-03-21 Thread Robert Haas
On Fri, Mar 21, 2014 at 12:12 AM, Noah Misch wrote: > We added these ConstrCheck fields for 9.2, but equalTupleDescs() did not get > the memo. I looked for resulting behavior problems, and I found one in > RelationClearRelation() only. Test case: > > set constraint_exclusion = on; > drop table i

[HACKERS] [RFC, POC] Don't require a NBuffer sized PrivateRefCount array of local buffer pins

2014-03-21 Thread Andres Freund
Hi, I've been annoyed at the amount of memory used by the backend local PrivateRefCount array for a couple of reasons: a) The performance impact of AtEOXact_Buffers() on Assert() enabled builds is really, really annoying. b) On larger nodes, the L1/2/3 cache impact of randomly accessing sev

Re: [HACKERS] ALTER TABLE lock strength reduction patch is unsafe Reply-To:

2014-03-21 Thread Noah Misch
On Fri, Mar 21, 2014 at 04:11:12PM +, Simon Riggs wrote: > On 21 March 2014 03:45, Noah Misch wrote: > > On Sat, Mar 08, 2014 at 11:14:30AM +, Simon Riggs wrote: > Thanks for the review. I'll respond to each point on a later email but > looks nothing much major, apart from the point raise

Re: [HACKERS] pg_archivecleanup bug

2014-03-21 Thread Bruce Momjian
On Wed, Mar 19, 2014 at 02:02:50PM -0400, Bruce Momjian wrote: > The attached patch is slightly updated. I will apply it to head and all > the back branches, including the stylistic change to pg_resetxlog (for > consistency) and remove the MinGW block in head. Patch applied back through 8.4. I h

Re: [HACKERS] [bug fix] pg_ctl always uses the same event source

2014-03-21 Thread MauMau
From: "Alvaro Herrera" MauMau escribió: The "raw" link only gave the mail in text format. I hoped to import the mail into Windows Mail on Windows Vista, but I couldn't. You might need to run a conversion process by which you transform the raw file (in mbox format) into EML format or whateve

Re: [HACKERS] QSoC proposal: Rewrite pg_dump and pg_restore

2014-03-21 Thread Alvaro Herrera
Andrew Dunstan escribió: > What would be useful for many purposes, and is a long-standing > project of mine that I still haven't found time to make progress on, > is that the server should contain functions to produce the creation > SQL for all its own objects, free of the locks that pg_dump requi

Re: [HACKERS] ALTER TABLE lock strength reduction patch is unsafe Reply-To:

2014-03-21 Thread Simon Riggs
On 21 March 2014 03:45, Noah Misch wrote: > On Sat, Mar 08, 2014 at 11:14:30AM +, Simon Riggs wrote: >> On 7 March 2014 09:04, Simon Riggs wrote: >> > The right thing to do here is to not push to the extremes. If we mess >> > too much with the ruleutil stuff it will just be buggy. A more >> >

[HACKERS] Patch for CREATE RULE sgml -- Was in: [DOCS]

2014-03-21 Thread Emanuel Calvo
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Hi guys, I realized that the output of the CREATE RULE has not a detailed output for the "events" parameter. But the question here is that I'm not sure which format follow: { INSERT | UPDATE | DELETE | SELECT} or INSERT UPDATE DELE

Re: [HACKERS] [RFC] What should we do for reliable WAL archiving?

2014-03-21 Thread MauMau
From: "Michael Paquier" On Fri, Mar 21, 2014 at 8:54 PM, MauMau wrote: * Create pg_copy in C so that it can be used on Windows as well as on UNIX/Linux. It just copies one file. Its source code is located in src/bin/pg_copy/. Please recommend a better name if you have one in mind. I'd rat

Re: [HACKERS] [RFC] What should we do for reliable WAL archiving?

2014-03-21 Thread MauMau
From: "Michael Paquier" On Fri, Mar 21, 2014 at 8:54 PM, MauMau wrote: * Create pg_copy in C so that it can be used on Windows as well as on UNIX/Linux. It just copies one file. Its source code is located in src/bin/pg_copy/. Please recommend a better name if you have one in mind. I'd rat

Re: [HACKERS] QSoC proposal: Rewrite pg_dump and pg_restore

2014-03-21 Thread Andrew Dunstan
On 03/21/2014 09:38 AM, Robert Haas wrote: On Thu, Mar 20, 2014 at 11:09 PM, Tom Lane wrote: Craig Ringer writes: Here's how I think it needs to look: [ move all the functionality to the backend ] Of course, after you've done all that work, you've got something that is of exactly zero use t

Re: [HACKERS] Inheritance of foregn key constraints.

2014-03-21 Thread Tom Lane
Andrzej Mazurkiewicz writes: > My patch need one change that might be of significance. > A type of the depencencies (pg_depend) among the FK constraint > (pg_constraint) > and the corresponding "RI_ConstraintTrigger" triggers has to be changed from > DEPENDENCY_INTERNAL to DEPENDENCY_AUTO. So

Re: [HACKERS] Creating tables for columns

2014-03-21 Thread Kohei KaiGai
I had implemented similar code on top of FDW API. https://github.com/kaigai/pg_strom/blob/old_cuda/utilcmds.c#L244 Probably, heap_create_with_catalog() is what you are finding out. 2014-03-21 22:57 GMT+09:00 Rajashree Mandaogane : > We are working on a project in which we need to create tables

Re: [HACKERS] Array of composite types returned from python

2014-03-21 Thread Merlin Moncure
On Thu, Mar 20, 2014 at 4:54 PM, Behn, Edward (EBEHN) wrote: > > I've endeavored to enable the return of arrays of composite types from code > written in PL/Python. It seems that this can be accomplished though a very > minor change to the code: > > On line 401 in the file src/pl/plpython/plpy_

[HACKERS] Creating tables for columns

2014-03-21 Thread Rajashree Mandaogane
We are working on a project in which we need to create tables for each column. So which function should we call in recursion to create the tables?

Re: [HACKERS] QSoC proposal: Rewrite pg_dump and pg_restore

2014-03-21 Thread Robert Haas
On Thu, Mar 20, 2014 at 11:09 PM, Tom Lane wrote: > Craig Ringer writes: >> Here's how I think it needs to look: >> [ move all the functionality to the backend ] > > Of course, after you've done all that work, you've got something that is > of exactly zero use to its supposed principal use-case,

Re: [HACKERS] jsonb and nested hstore

2014-03-21 Thread Greg Stark
On Fri, Mar 21, 2014 at 7:23 AM, Peter Geoghegan wrote: > I must admit that I'm coming around to the view that jsonb_hash_ops > would make a better default. Its performance is superb, and I think > there's a strong case to be made for that more than making up for it > not supporting all indexable

Re: [HACKERS] [RFC] What should we do for reliable WAL archiving?

2014-03-21 Thread Michael Paquier
On Fri, Mar 21, 2014 at 8:54 PM, MauMau wrote: > * Create pg_copy in C so that it can be used on Windows as well as on > UNIX/Linux. It just copies one file. Its source code is located in > src/bin/pg_copy/. Please recommend a better name if you have one in mind. I'd rather see that as a part o

Re: [HACKERS] Standby server won't start

2014-03-21 Thread MauMau
From: "Tatsuo Ishii" Last time I tested in following way, max_connections in pg_control of standby did not reflect the change in primary. 1) stop primary 2) stop standby 3) change max_connections to 4 in primary 4) change max_connections to 4 in standby 5) start primary 6) start standby but it

Re: [HACKERS] QSoC proposal: Rewrite pg_dump and pg_restore

2014-03-21 Thread Marcin Mańk
On Fri, Mar 21, 2014 at 4:09 AM, Tom Lane wrote: > Craig Ringer writes: > > Here's how I think it needs to look: > > [ move all the functionality to the backend ] > > Of course, after you've done all that work, you've got something that is > of exactly zero use to its supposed principal use-case

Re: [HACKERS] Standby server won't start

2014-03-21 Thread Tatsuo Ishii
> The primary log the new value as an XLOG_PARAMETER_CHANGE WAL record > at startup when the parameter value in postgresql.conf does not match > the one in pg_control. Then, the WAL record is sent to the standby > and applied, which changes the value in pg_control on the standby. Last time I test

Re: [HACKERS] Standby server won't start

2014-03-21 Thread MauMau
From: "Rajeev rastogi" If you changed max_connection to 4 only in primary, then I am not able to understand, how it got changed in standby also (if you have not taken back again)? Let me know If I have missed something. The primary log the new value as an XLOG_PARAMETER_CHANGE WAL record at

Re: [HACKERS] [RFC] What should we do for reliable WAL archiving?

2014-03-21 Thread MauMau
From: "Mitsumasa KONDO" 2014-03-17 21:12 GMT+09:00 Fujii Masao : On Mon, Mar 17, 2014 at 10:20 AM, Robert Haas wrote: > On Sun, Mar 16, 2014 at 6:23 AM, MauMau wrote: >> * Improve the example in the documentation. >> But what command can we use to reliably sync just one file? >> >> * Provide

Re: [HACKERS] Standby server won't start

2014-03-21 Thread Rajeev rastogi
On 21 March 2014 16:17, Tatsuo Wrote: > In my case I had already changed primary's max_connections to 4 and > restarted it. So at that point both postgresql.conf of primary and > standby were 4. If you changed max_connection to 4 only in primary, then I am not able to understand, how it got cha

Re: [HACKERS] Standby server won't start

2014-03-21 Thread Tatsuo Ishii
>> I changed primary servers max_connections from 100 to 4 for just a >> testing purpose. Now standby server won't start and complains: >> >> hot standby is not possible because max_connections = 4 is a lower >> setting than on the master server (its value was 100) >> >> My guess is this is becau

[HACKERS] Inheritance of foregn key constraints.

2014-03-21 Thread Andrzej Mazurkiewicz
http://wiki.postgresql.org/wiki/Todo Section "Inheritance" "Allow inherited tables to inherit indexes, UNIQUE constraints, and primary/FOREIGN KEYS" Good Morning. I started to program a patch for inheritance of the foreign key constraints. I. e. after applying the patch FKs are maintained bet

Re: [HACKERS] Standby server won't start

2014-03-21 Thread Rajeev rastogi
On 21 March 2014 13:41, Tatsuo Wrote: > I changed primary servers max_connections from 100 to 4 for just a > testing purpose. Now standby server won't start and complains: > > hot standby is not possible because max_connections = 4 is a lower > setting than on the master server (its value was 10

Re: [HACKERS] [bug fix] PostgreSQL fails to start on Windows if it crashes after tablespace creation

2014-03-21 Thread MauMau
From: "Amit Kapila" The comments in your first version needs to be improved, as there you just mentioned a Windows specific comment: + /* On Windows, lstat() I think you can change comments (make it somewhat similar to destroy_tablespace_directories) and then submit it as a new version. OK, d

[HACKERS] Standby server won't start

2014-03-21 Thread Tatsuo Ishii
I changed primary servers max_connections from 100 to 4 for just a testing purpose. Now standby server won't start and complains: hot standby is not possible because max_connections = 4 is a lower setting than on the master server (its value was 100) My guess is this is because standby's pg_cont

Re: [HACKERS] [bug fix] PostgreSQL fails to start on Windows if it crashes after tablespace creation

2014-03-21 Thread Amit Kapila
On Fri, Mar 21, 2014 at 12:24 PM, MauMau wrote: > From: "Amit Kapila" >> If create_tablespace_directories() needs to handle with directory both on >> Windows/Linux, then shouldn't it be a runtime check as in your first >> version rather than compile time check? >> Also isn't that the reason why d

Re: [HACKERS] jsonb and nested hstore

2014-03-21 Thread Peter Geoghegan
On Thu, Mar 13, 2014 at 3:39 PM, Peter Geoghegan wrote: > On Thu, Mar 13, 2014 at 2:21 AM, Greg Stark wrote: >> It does sound like the main question here is which opclass should be >> the default. From the discussion there's a jsonb_hash_ops which works >> on all input values but supports fewer o