Re: [HACKERS] inconsistent state after crash recovery

2013-07-25 Thread Andres Freund
Hi, On 2013-07-26 13:33:13 +0900, Satoshi Nagayasu wrote: > I received a question about inconsistent state after crash recovery. > > When a table file is broken (or just lost), PostgreSQL can not recover > a whole table, and does not show any notice while recoverying. > I think it means "inconsis

Re: [HACKERS] Condition to become the standby mode.

2013-07-25 Thread Andres Freund
Hi, On 2013-07-26 13:19:34 +0900, Sawada Masahiko wrote: > When the slave server starts, the slave server perform the following > steps in StartupXLOG(): > 1. Read latest CheckPoint record LSN from pg_control file. > 2. Try to fetch CheckPoint record from pg_xlog directory at first. > ( The serv

Re: [HACKERS] Design proposal: fsync absorb linear slider

2013-07-25 Thread didier
Hi, > Sure, that's what the WAL does. But you still have to checkpoint > eventually. > > Sure, when you run pg_ctl stop. Unlike the WAL it only needs two files, shared_buffers size. I did bogus tests by replacing mask |= BM_PERMANENT; with mask = -1 in BufferSync() and simulating checkpoint w

[HACKERS] Repeated array type info caching code

2013-07-25 Thread Craig Ringer
Hi all While reading the array functions in varlena.c, arrayfuncs.c and array_userfuncs.c, I noticed code to cache the array type info in fn_extra repeated three times, and in adding an "array_idx" function (generic version of intarray's 'idx') I'm expecting to need a fourth copy. The ArrayMetaSt

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-07-25 Thread Alvaro Herrera
Josh Berkus escribió: > On 07/25/2013 02:02 PM, Tom Lane wrote: > > Robert Haas writes: > > > >> My thought is that people might put postgresql.conf in a directory > >> that only contains configuration files and isn't writeable by the > >> postgres user. So I would expect to find postgresql.auto

[HACKERS] inconsistent state after crash recovery

2013-07-25 Thread Satoshi Nagayasu
Hi, I received a question about inconsistent state after crash recovery. When a table file is broken (or just lost), PostgreSQL can not recover a whole table, and does not show any notice while recoverying. I think it means "inconsistent" state. (1) create a table, and fill records. (2) process

[HACKERS] Condition to become the standby mode.

2013-07-25 Thread Sawada Masahiko
Hi All, When the slave server starts, the slave server perform the following steps in StartupXLOG(): 1. Read latest CheckPoint record LSN from pg_control file. 2. Try to fetch CheckPoint record from pg_xlog directory at first. ( The server try to read up to prior CheckPoint record from pg_contrl

Re: [HACKERS] Expression indexes and dependecies

2013-07-25 Thread Tom Lane
Pavan Deolasee writes: > On Thu, Jul 25, 2013 at 6:43 PM, Tom Lane wrote: >> More generally, I think the argument was that the behavior of a >> non-immutable CHECK would at least be easy to understand, assuming you >> know that the check will only be applied at row insertion or update. > But the

Re: [HACKERS] Expression indexes and dependecies

2013-07-25 Thread Pavan Deolasee
On Thu, Jul 25, 2013 at 6:43 PM, Tom Lane wrote: > > > Well, it's probably somewhat historical, but I doubt we'd want to > tighten it up now. Here's an example of a sensible CHECK that's > only stable: > > create ... last_update timestamptz check (last_update <= now()) ... > Agree. That

Re: [HACKERS] comment for "fast promote"

2013-07-25 Thread Tomonari Katsumata
Hi Fujii-san, Thank you for response. (2013/07/25 21:15), Fujii Masao wrote: > On Thu, Jul 25, 2013 at 5:33 PM, Tomonari Katsumata > wrote: >> Hi, >> >> Now I'm seeing xlog.c in 93_stable for studying "fast promote", >> and I have a question. >> >> I think it has an extra unlink command for "pr

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-07-25 Thread Josh Berkus
On 07/25/2013 02:02 PM, Tom Lane wrote: > Robert Haas writes: >> On Thu, Jul 18, 2013 at 6:03 PM, Alvaro Herrera >> wrote: >>> Josh Berkus escribi�: We are missing one feature, which is the ability to relocate the postgresql.auto.conf file if relocating it is desireable according to >>>

Re: [HACKERS] Design proposal: fsync absorb linear slider

2013-07-25 Thread Robert Haas
On Thu, Jul 25, 2013 at 6:02 PM, didier wrote: > It was surely already discussed but why isn't postresql writing > sequentially its cache in a temporary file? With storage random speed at > least five to ten time slower it could help a lot. > Thanks Sure, that's what the WAL does. But you still

Re: [HACKERS] getting rid of SnapshotNow

2013-07-25 Thread Robert Haas
On Tue, Jul 23, 2013 at 2:53 PM, Tom Lane wrote: > Works for me. OK. I've taken care of all remaining uses of SnapshotNow in the code base. I think we can go ahead and remove it, now. Patch attached. (And there was, hopefully, much rejoicing.) -- Robert Haas EnterpriseDB: http://www.enterpr

Re: [HACKERS] install libpq.dll in bin directory on Windows / Cygwin

2013-07-25 Thread MauMau
From: "Andrew Dunstan" on Windows it's necessary to have libpq.dll/cygpq.dll either in the PATH or in the same directory as client .exe files. The buildfarm client has for many years simply copied this dll from the installation lib to the installation bin directory after running "make install".

Re: [HACKERS] Design proposal: fsync absorb linear slider

2013-07-25 Thread didier
Hi On Tue, Jul 23, 2013 at 5:48 AM, Greg Smith wrote: > Recently I've been dismissing a lot of suggested changes to checkpoint > fsync timing without suggesting an alternative. I have a simple one in > mind that captures the biggest problem I see: that the number of backend > and checkpoint w

Re: [HACKERS] Adding Zigzag Merge Join to Index Nested Loops Join

2013-07-25 Thread Jeff Janes
On Tue, Jul 23, 2013 at 12:40 PM, tubadzin wrote: > Hi. > I want add Zigzag Merge join to Index Nested Loops Join alghoritm. > http://www.cs.berkeley.edu/~fox/summaries/database/query_eval_5-8.html > Which files are responsible for Index nested loops join ? (not simple nested > loops join which ha

Re: [HACKERS] install libpq.dll in bin directory on Windows / Cygwin

2013-07-25 Thread Alvaro Herrera
Andrew Dunstan wrote: > > On 07/25/2013 05:02 PM, Alvaro Herrera wrote: > >Andrew Dunstan wrote: > >>Usually on Windows it's necessary to have libpq.dll/cygpq.dll either > >>in the PATH or in the same directory as client .exe files. > > > >Seems a reasonable workaround for a silly platform bug.

Re: [HACKERS] install libpq.dll in bin directory on Windows / Cygwin

2013-07-25 Thread Andrew Dunstan
On 07/25/2013 05:02 PM, Alvaro Herrera wrote: Andrew Dunstan wrote: Jeff Janes asked me about this, and Bruce just tripped up on it. Usually on Windows it's necessary to have libpq.dll/cygpq.dll either in the PATH or in the same directory as client .exe files. The buildfarm client has for many

Re: [HACKERS] install libpq.dll in bin directory on Windows / Cygwin

2013-07-25 Thread Alvaro Herrera
Andrew Dunstan wrote: > Jeff Janes asked me about this, and Bruce just tripped up on it. > Usually on Windows it's necessary to have libpq.dll/cygpq.dll either > in the PATH or in the same directory as client .exe files. The > buildfarm client has for many years simply copied this dll from the > in

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-07-25 Thread Tom Lane
Robert Haas writes: > On Thu, Jul 18, 2013 at 6:03 PM, Alvaro Herrera > wrote: >> Josh Berkus escribió: >>> We are missing one feature, which is the ability to relocate the >>> postgresql.auto.conf file if relocating it is desireable according to >>> some sysadmin spec. > My thought is that peop

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-07-25 Thread Tom Lane
Alvaro Herrera writes: > Robert Haas escribió: >> On Mon, Jul 22, 2013 at 7:56 PM, Tom Lane wrote: >>> I'd be inclined to think that ALTER SYSTEM SET should not be allowed to >>> modify any PGC_POSTMASTER parameters. >> That significantly decreases the usefulness of ALTER SYSTEM without >> actua

[HACKERS] install libpq.dll in bin directory on Windows / Cygwin

2013-07-25 Thread Andrew Dunstan
Jeff Janes asked me about this, and Bruce just tripped up on it. Usually on Windows it's necessary to have libpq.dll/cygpq.dll either in the PATH or in the same directory as client .exe files. The buildfarm client has for many years simply copied this dll from the installation lib to the instal

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-07-25 Thread Alvaro Herrera
Robert Haas escribió: > On Mon, Jul 22, 2013 at 7:56 PM, Tom Lane wrote: > > I'd be inclined to think that ALTER SYSTEM SET should not be allowed to > > modify any PGC_POSTMASTER parameters. > > That significantly decreases the usefulness of ALTER SYSTEM without > actually preventing the underly

Re: [HACKERS] Preventing tuple-table leakage in plpgsql

2013-07-25 Thread Tom Lane
I wrote: > Another point worth making is that this version of the patch deletes the > tuple tables during AtEOSubXact_SPI(), earlier in cleanup than would > happen with the prior version. That increases the risk that external > code might try to delete an already-deleted tuple table, if it tries >

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-07-25 Thread Robert Haas
On Mon, Jul 22, 2013 at 7:56 PM, Tom Lane wrote: > Josh Berkus writes: >> Christophe just discovered something with include files which is going >> to cause issues with ALTER SYSTEM SET. > >> So, take as a hypothetical that you use the default postgresql.conf >> file, which sets shared_buffers =

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-07-25 Thread Robert Haas
On Thu, Jul 18, 2013 at 6:03 PM, Alvaro Herrera wrote: > Josh Berkus escribió: > >> We are missing one feature, which is the ability to relocate the >> postgresql.auto.conf file if relocating it is desireable according to >> some sysadmin spec. This kind of ties into another patch which was >> di

Re: [HACKERS] Review: UNNEST (and other functions) WITH ORDINALITY

2013-07-25 Thread Robert Haas
On Wed, Jul 24, 2013 at 1:50 PM, Greg Stark wrote: > On Wed, Jul 24, 2013 at 6:39 PM, Robert Haas wrote: >> This patch will introduce, without documentation, a fifth class of >> keyword. ORDINALITY will need to be quoted when, and only when, it >> immediately follows WITH. Without some change t

Re: [HACKERS] dynamic background workers, round two

2013-07-25 Thread Robert Haas
On Wed, Jul 24, 2013 at 5:34 PM, Andres Freund wrote: > This seems like a sensible idea to me. But, in the context of dynamic > query, don't we also need the reverse infrastructure of notifying a > bgworker that the client, that requested it to be started, has died? > Ending up with a dozen bgwork

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

2013-07-25 Thread suresh.balasubra
Disclaimer: I am no hacker, just a PostGreSQL user, trying to provide a user scenario where DISCARD SEQUENCES functionality is required. We have designed a developed a small Application Development platform for which the backend is PostGreSQL. There is a DBLayer which is responsible in generatin

[HACKERS] pg_upgrade -j broken on Windows

2013-07-25 Thread Bruce Momjian
Everyone should be aware that the 9.3 pg_upgrade -j/--jobs option on Windows is currently broken, and hopefully will be fixed by the next beta. Someone at PGDay UK told me they were getting pg_upgrade -j crashes on Windows. Andrew Dunstan was able to reproduce the crash, and that has been fixed,

Re: [HACKERS] Extensions makefiles - coverage

2013-07-25 Thread Ronan Dunklau
Please ignore this comment: > I noticed that make clean leaves gcda and gcov files on the current > HEAD, and this is no different with the given patch. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref

[HACKERS] Extensions makefiles - coverage

2013-07-25 Thread Ronan Dunklau
Hello. I was having trouble figuring how to use the coverage targets when using an extension. I am using approximatively the layout that was proposed here: http://www.postgresql.org/message-id/51bb1b6e.2070...@dunslane.net It looks like everything is hard-coded to take the source and the gcda, gcn

Re: [HACKERS] Expression indexes and dependecies

2013-07-25 Thread Tom Lane
Pavan Deolasee writes: > Ok. I will write up something and submit a patch. Constraints probably also > suffer from the same issue. Whats surprising is we don't mandate that the > functions used in CHECK constraint are immutable (like we do for indexes). > What that means is, even if a row was sati

Re: [HACKERS] comment for "fast promote"

2013-07-25 Thread Fujii Masao
On Thu, Jul 25, 2013 at 5:33 PM, Tomonari Katsumata wrote: > Hi, > > Now I'm seeing xlog.c in 93_stable for studying "fast promote", > and I have a question. > > I think it has an extra unlink command for "promote" file. > (on 9937 line) > --- > 9934 if (stat(FAST_PROMOTE_SIGNAL_FILE, &stat_bu

Re: [HACKERS] Improvement of checkpoint IO scheduler for stable transaction responses

2013-07-25 Thread KONDO Mitsumasa
Hi, I understand why my patch is faster than original, by executing Heikki's patch. His patch execute write() and fsync() in each relation files in write-phase in checkpoint. Therefore, I expected that write-phase would be slow, and fsync-phase would be fast. Because disk-write had executed in

Re: [HACKERS] Expression indexes and dependecies

2013-07-25 Thread Pavan Deolasee
On Tue, Jul 23, 2013 at 4:51 AM, Tom Lane wrote: > Andres Freund writes: > > On 2013-07-22 17:04:06 -0400, Alvaro Herrera wrote: > >> One way to attack this would be registering dependencies of a new kind > >> on functions used by index expressions. Then CREATE OR REPLACE function > >> could re

[HACKERS] comment for "fast promote"

2013-07-25 Thread Tomonari Katsumata
Hi, Now I'm seeing xlog.c in 93_stable for studying "fast promote", and I have a question. I think it has an extra unlink command for "promote" file. (on 9937 line) --- 9934 if (stat(FAST_PROMOTE_SIGNAL_FILE, &stat_buf) == 0) 9935 { 9936 unlink(FAST_PROMOTE_SIGNAL_FILE); 9937 unlink(PROMOTE_S