Re: [HACKERS] Listen / Notify - what to do when the queue is full

2010-01-20 Thread Joachim Wieland
On Wed, Jan 20, 2010 at 1:05 AM, Tom Lane wrote: > I guess Joachim is trying to provide a similar guarantee for the new > implementation, but I'm not clear on why it would require locking. > The new implementation is broadcast and ISTM it shouldn't require the > modifying transaction to know which

Re: [HACKERS] Streaming replication, and walsender during recovery

2010-01-20 Thread Fujii Masao
On Tue, Jan 19, 2010 at 4:41 PM, Simon Riggs wrote: > It would be useful to have the ps display differentiate between multiple > walsenders, and in this case have it indicate cascading also. Since a normal walsender and a "cascading" one will not be running at the same time, I don't think that it

Re: [HACKERS] Git out of sync vs. CVS

2010-01-20 Thread Magnus Hagander
On Tue, Jan 19, 2010 at 16:59, Robert Haas wrote: > On Tue, Jan 19, 2010 at 10:44 AM, Magnus Hagander wrote: >> On Mon, Jan 18, 2010 at 01:53, Kevin Grittner >> wrote: >>> Magnus Hagander  wrote: >>> >>> the Git repository is missing parts of two non-recent commits. >>> We've seen this

Re: [HACKERS] Git out of sync vs. CVS

2010-01-20 Thread Magnus Hagander
On Wed, Jan 20, 2010 at 09:52, Magnus Hagander wrote: > On Tue, Jan 19, 2010 at 16:59, Robert Haas wrote: >> On Tue, Jan 19, 2010 at 10:44 AM, Magnus Hagander >> wrote: >>> On Mon, Jan 18, 2010 at 01:53, Kevin Grittner >>> wrote: Magnus Hagander  wrote: the Git repository is

Re: [HACKERS] MySQL-ism help patch for psql

2010-01-20 Thread Greg Stark
this is mostly true. I don't think any Oracle DBA will expect ALL_TABLES our DBA_TABLES to be there. however DESCRIBE and HELP would be the two that come to mind. greg On 20 Jan 2010 02:56, "Greg Sabino Mullane" wrote: -BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 > Why would they want

Re: [HACKERS] Git out of sync vs. CVS

2010-01-20 Thread Heikki Linnakangas
Magnus Hagander wrote: > On Wed, Jan 20, 2010 at 09:52, Magnus Hagander wrote: >> On Tue, Jan 19, 2010 at 16:59, Robert Haas wrote: >>> On Tue, Jan 19, 2010 at 10:44 AM, Magnus Hagander >>> wrote: On Mon, Jan 18, 2010 at 01:53, Kevin Grittner wrote: > Magnus Hagander wrote:

Re: [HACKERS] lock_timeout GUC patch

2010-01-20 Thread Boszormenyi Zoltan
Tom Lane írta: > Boszormenyi Zoltan writes: > >> [ 5-pg85-locktimeout-14-ctxdiff.patch ] >> > > I took a quick look at this. I am not qualified to review the Win32 > implementation of PGSemaphoreTimedLock, but I am afraid that both of > the other ones are nonstarters on portability ground

Re: [HACKERS] An example of bugs for Hot Standby

2010-01-20 Thread Andres Freund
On Wednesday 20 January 2010 06:30:28 Tom Lane wrote: > Andres Freund writes: > > Is there any supported platform with sizeof(sig_atomic_t) <4 - I would > > doubt so? > > Er ... what? I believe there are live platforms with sig_atomic_t = char. > If we're assuming more that's a must-fix. So were

Re: [HACKERS] An example of bugs for Hot Standby

2010-01-20 Thread Simon Riggs
On Wed, 2010-01-20 at 06:14 +0100, Andres Freund wrote: > > > > Full resolution patch attached for Startup process waits on buffer pins. > > > > Startup process sets SIGALRM when waiting on a buffer pin. If woken by > > alarm we send SIGUSR1 to all backends requesting that they check to see > > i

Re: [HACKERS] An example of bugs for Hot Standby

2010-01-20 Thread Andres Freund
On Wednesday 20 January 2010 06:30:28 Tom Lane wrote: > Andres Freund writes: > > Is there any supported platform with sizeof(sig_atomic_t) <4 - I would > > doubt so? > > Er ... what? I believe there are live platforms with sig_atomic_t = char. > If we're assuming more that's a must-fix. The rea

Re: [HACKERS] An example of bugs for Hot Standby

2010-01-20 Thread Andres Freund
On Wednesday 20 January 2010 10:40:10 Simon Riggs wrote: > On Wed, 2010-01-20 at 06:14 +0100, Andres Freund wrote: > > > Full resolution patch attached for Startup process waits on buffer > > > pins. > > > > > > Startup process sets SIGALRM when waiting on a buffer pin. If woken by > > > alarm we

Re: [HACKERS] An example of bugs for Hot Standby

2010-01-20 Thread Simon Riggs
On Wed, 2010-01-20 at 10:45 +0100, Andres Freund wrote: > LWLockAcquire I'm using spinlocks, not lwlocks. -- Simon Riggs www.2ndQuadrant.com -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpre

Re: [HACKERS] Bug ? different behaviour between 8.3 and 8.4 won IS NULL with sub arrays of nulls

2010-01-20 Thread Jehan-Guillaume (ioguix) de Rorthais
On Tue, 19 Jan 2010, Tom Lane wrote: iog...@free.fr writes: I found a difference of behaviour between 8.3 and 8.4 on IS NULL with multi-level arrays with NULL values. 8.3's behavior is just a bug --- Ok, should I report through the -bugs ml for tracking purpose ? or is it useless cause it'

Re: [HACKERS] An example of bugs for Hot Standby

2010-01-20 Thread Andres Freund
On Wednesday 20 January 2010 10:52:24 Simon Riggs wrote: > On Wed, 2010-01-20 at 10:45 +0100, Andres Freund wrote: > > LWLockAcquire > > I'm using spinlocks, not lwlocks. CancelDBBackends which is used in SendRecoveryConflictWithBufferPin which in turn used by CheckStandbyTimeout triggered by SIG

Re: [HACKERS] review: More frame options in window functions

2010-01-20 Thread Pavel Stehule
2010/1/19 Hitoshi Harada : > 2010/1/19 Hitoshi Harada : >> Yeah, that's my point, too. The planner has to distinguish "four" from >> sort pathkeys and to teach the executor the simple information which >> column should be used to determine frame. I was bit wrong because some >> of current executor

Re: [HACKERS] lock_timeout GUC patch

2010-01-20 Thread Boszormenyi Zoltan
Tom Lane írta: > Greg Stark writes: > >> we already have statement timeout it seems the natural easy to implement >> this is with more hairy logic to calculate the timeout until the next of the >> three timeouts should fire and set sigalarm. I sympathize with whoever tries >> to work that throu

Re: [HACKERS] Review: Patch: Allow substring/replace() to get/set bit values

2010-01-20 Thread Leonardo F
New version of the patch, let me know if I can fix/change something else. Leonardo getsetbit.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] An example of bugs for Hot Standby

2010-01-20 Thread Simon Riggs
On Wed, 2010-01-20 at 11:04 +0100, Andres Freund wrote: > On Wednesday 20 January 2010 10:52:24 Simon Riggs wrote: > > On Wed, 2010-01-20 at 10:45 +0100, Andres Freund wrote: > > > LWLockAcquire > > > > I'm using spinlocks, not lwlocks. > CancelDBBackends which is used in SendRecoveryConflictWithB

Re: [HACKERS] An example of bugs for Hot Standby

2010-01-20 Thread Andres Freund
On Wednesday 20 January 2010 11:33:05 Simon Riggs wrote: > On Wed, 2010-01-20 at 11:04 +0100, Andres Freund wrote: > > On Wednesday 20 January 2010 10:52:24 Simon Riggs wrote: > > > On Wed, 2010-01-20 at 10:45 +0100, Andres Freund wrote: > > > > LWLockAcquire > > > > > > I'm using spinlocks, not l

Re: [HACKERS] Small locking bugs in hs

2010-01-20 Thread Simon Riggs
On Wed, 2010-01-20 at 04:47 +0100, Andres Freund wrote: > On Saturday 16 January 2010 12:32:35 Simon Riggs wrote: > > > > No. As mentioned upthread, this is not a bug. > Could you also mention in a little bit more detail why not? When a cleanup record arrives without a latestRemovedXid we are fo

Re: [HACKERS] Patch rev 2: MySQL-ism help patch for psql

2010-01-20 Thread Rob Wultsch
On Tue, Jan 19, 2010 at 5:01 PM, David Christensen wrote: > > On Jan 19, 2010, at 4:23 PM, Robert Haas wrote: > >> On Tue, Jan 19, 2010 at 5:14 PM, David E. Wheeler >> wrote: >>> >>> Why would they want more? It's not MySQL, and they know that. If we give >>> them some very minor helpful hints fo

Re: [HACKERS] lock_timeout GUC patch

2010-01-20 Thread Boszormenyi Zoltan
Boszormenyi Zoltan írta: > Tom Lane írta: > >> Greg Stark writes: >> >> >>> we already have statement timeout it seems the natural easy to implement >>> this is with more hairy logic to calculate the timeout until the next of the >>> three timeouts should fire and set sigalarm. I sympat

Re: [HACKERS] Review: Patch: Allow substring/replace() to get/set bit values

2010-01-20 Thread Kevin Grittner
Leonardo F wrote: > New version of the patch, let me know if I can fix/change something > else. All issues addressed, with one tiny nit-pick -- the get_bit and set_bit methods are not part of the SQL standard. I took the liberty of removing "SQL-standard" from the documentation of these functions

Re: [HACKERS] Review: Patch: Allow substring/replace() to get/set bit values

2010-01-20 Thread Leonardo F
> All issues addressed, with one tiny nit-pick -- the get_bit and > set_bit methods are not part of the SQL standard. Damn! I completely forgot to mention that I had no idea if what I wrote in the docs made any sense... Well thank you for your thorough review. -- Sent via pgsql-hackers mai

Re: [HACKERS] Small locking bugs in hs

2010-01-20 Thread Andres Freund
On Wednesday 20 January 2010 12:59:40 Simon Riggs wrote: > On Wed, 2010-01-20 at 04:47 +0100, Andres Freund wrote: > > On Saturday 16 January 2010 12:32:35 Simon Riggs wrote: > > > No. As mentioned upthread, this is not a bug. > > > > Could you also mention in a little bit more detail why not? >

Re: [HACKERS] MySQL-ism help patch for psql

2010-01-20 Thread Peter Eisentraut
On tis, 2010-01-19 at 11:43 -0800, Jeff Davis wrote: > I'll make an analogy to: > > $ git difff > git: 'difff' is not a git-command. See 'git --help'. > > Did you mean this? > diff This is presumably spelling-based, which might be an interesting feature (although probably useless

Re: [HACKERS] MySQL-ism help patch for psql

2010-01-20 Thread Peter Eisentraut
On tis, 2010-01-19 at 16:00 -0600, David Christensen wrote: > Currently, a session will look like the following: > >machack:machack:5485=# show tables; >See: > \d > or \? for general help with psql commands >machack:machack:5485=# I think if you make "show tables"

[HACKERS] Streaming Replication and archiving

2010-01-20 Thread Mark Kirkwood
I've been having a look at this, one master + one replica and also one master + 2 replicas. I gotta say this is a nice piece of functionality (particularly the multiple replicas). I've been using the wiki page (http://wiki.postgresql.org/wiki/Streaming_Replication) as a guide, and I notice th

Re: [HACKERS] MySQL-ism help patch for psql

2010-01-20 Thread Bruce Momjian
Peter Eisentraut wrote: > On tis, 2010-01-19 at 16:00 -0600, David Christensen wrote: > > Currently, a session will look like the following: > > > >machack:machack:5485=# show tables; > >See: > > \d > > or \? for general help with psql commands > >machack:machack:54

Re: [HACKERS] Small locking bugs in hs

2010-01-20 Thread Simon Riggs
On Wed, 2010-01-20 at 14:13 +0100, Andres Freund wrote: > I do understand it correctly that in CancelVirtualTransaction > LW_SHARED is > taken only so that another transaction can finish during that time? We're canceling one specific vxid, so no need to block other snapshots from being taken. Re

Re: [HACKERS] MySQL-ism help patch for psql

2010-01-20 Thread Peter Eisentraut
On ons, 2010-01-20 at 09:05 -0500, Bruce Momjian wrote: > I disagree. No one has complained that we are being a "smartass" by > reporting this for "help" in psql: > > You are using psql, the command-line interface to PostgreSQL. > Type: \copyright for distribution terms >

Re: [HACKERS] MySQL-ism help patch for psql

2010-01-20 Thread Robert Haas
On Wed, Jan 20, 2010 at 9:05 AM, Bruce Momjian wrote: > Peter Eisentraut wrote: >> On tis, 2010-01-19 at 16:00 -0600, David Christensen wrote: >> > Currently, a session will look like the following: >> > >> >    machack:machack:5485=# show tables; >> >    See: >> >           \d >> >           or \

Re: [HACKERS] Git out of sync vs. CVS

2010-01-20 Thread Robert Haas
On Wed, Jan 20, 2010 at 4:27 AM, Heikki Linnakangas wrote: > Magnus Hagander wrote: >> On Wed, Jan 20, 2010 at 09:52, Magnus Hagander wrote: >>> On Tue, Jan 19, 2010 at 16:59, Robert Haas wrote: On Tue, Jan 19, 2010 at 10:44 AM, Magnus Hagander wrote: > On Mon, Jan 18, 2010 at 01

Re: [HACKERS] MySQL-ism help patch for psql

2010-01-20 Thread Robert Haas
On Wed, Jan 20, 2010 at 9:26 AM, Peter Eisentraut wrote: > On ons, 2010-01-20 at 09:05 -0500, Bruce Momjian wrote: >> I disagree.   No one has complained that we are being a "smartass" by >> reporting this for "help" in psql: >> >>         You are using psql, the command-line interface to PostgreS

Re: [HACKERS] lock_timeout GUC patch

2010-01-20 Thread Jaime Casanova
If that's the case then others timeouts should be failing on os x, no? But i have never hear that 2010/1/20, Boszormenyi Zoltan : > Boszormenyi Zoltan írta: >> Tom Lane írta: >> >>> Greg Stark writes: >>> >>> we already have statement timeout it seems the natural easy to implement this

Re: [HACKERS] MySQL-ism help patch for psql

2010-01-20 Thread Andrew Dunstan
Robert Haas wrote: I'm actually no big advocate of the \d commands. They're basically magical queries that you can't easily see or edit - I've more than once wished for a WHERE clause (\df WHERE "Result data type" = 'internal' or what have you. You *can* easily see them, at least. Run "

Re: [HACKERS] lock_timeout GUC patch

2010-01-20 Thread Boszormenyi Zoltan
Hi, I wrote: > Okay, after reading google it seems you're right that OS X lacks > sem_timedwait(). Jaime Casanova írta: > If that's the case then others timeouts should be failing on os x, no? > But i have never hear that > among others, I found this reference on the missing sem_timedwait() f

Re: [HACKERS] Git out of sync vs. CVS

2010-01-20 Thread Heikki Linnakangas
Robert Haas wrote: > On Wed, Jan 20, 2010 at 4:27 AM, Heikki Linnakangas > wrote: >> Magnus Hagander wrote: >>> Actually, such a correction patch would be nice and short. Attached >>> for reference. Thoughts? >> That seems better than rewinding the history all the way back to August. > > It seems

Re: [HACKERS] MySQL-ism help patch for psql

2010-01-20 Thread Dimitri Fontaine
Robert Haas writes: > If what the user wanted was to be using MySQL, he is out of luck > anyway. That's not what we're talking about. We're talking about having a nice client tool for those people having to do both MySQL and PostgreSQL support, or new to PostgreSQL and comming from MySQL. I'll g

Re: [HACKERS] MySQL-ism help patch for psql

2010-01-20 Thread Bruce Momjian
Dimitri Fontaine wrote: > Robert Haas writes: > > If what the user wanted was to be using MySQL, he is out of luck > > anyway. > > That's not what we're talking about. We're talking about having a nice > client tool for those people having to do both MySQL and PostgreSQL > support, or new to Post

Re: [HACKERS] MySQL-ism help patch for psql

2010-01-20 Thread Kevin Grittner
Dimitri Fontaine wrote: > I'll give my vote to Peter's idea that show tables; should better > act as if you typed \d. I guess we don't need a "tables" GUC. Show all wouldn't include it? Would we require a semicolon? Do we support \d-style globs? Still seems kinda messy. +1 for help to sho

Re: [HACKERS] MySQL-ism help patch for psql

2010-01-20 Thread Gabriele Bartolini
I would personally emulate \d and take the chance for showing a funny warning, something like: "hey, it's not MySql!" or similar. I am sure we will Finder something appropriate. :) Inviato da iPhone Il giorno 20/gen/2010, alle ore 16.30, "Kevin Grittner" > ha scritto: Dimitri Fontaine wr

Re: [HACKERS] Bloom filters bloom filters bloom filters

2010-01-20 Thread pg
> Then your union operation is to just bitwise or the two bloomfilters. Keep in mind that when performing this sort of union between two comparably-sized sets, your false-positive rate will increase by about an order of magnitude. You need to size your bloom filters accordingly, or perform the

Re: [HACKERS] lock_timeout GUC patch

2010-01-20 Thread Robert Haas
2010/1/20 Boszormenyi Zoltan : > Attached with the proposed modification to lift the portability concerns. > Fixed the missing check for get_rel_name() and one typo ("transation") > Introduced checks for semtimedop() and sem_timedwait() in configure.in > and USE_LOCK_TIMEOUT in port.h depending on

Re: [HACKERS] lock_timeout GUC patch

2010-01-20 Thread Tom Lane
Robert Haas writes: > 2010/1/20 Boszormenyi Zoltan : >> Attached with the proposed modification to lift the portability concerns. > I think that it is a very bad idea to implement this feature in a way > that is not 100% portable. Agreed, this is not acceptable. If there were no possible way to

Re: [HACKERS] Listen / Notify - what to do when the queue is full

2010-01-20 Thread Tom Lane
Joachim Wieland writes: > On Wed, Jan 20, 2010 at 1:05 AM, Tom Lane wrote: >> I guess Joachim is trying to provide a similar guarantee for the new >> implementation, but I'm not clear on why it would require locking. > It is rather about a listening backend seeing a notification in the > global

Re: [HACKERS] Git out of sync vs. CVS

2010-01-20 Thread Tom Lane
Heikki Linnakangas writes: > Magnus Hagander wrote: >> Actually, such a correction patch would be nice and short. Attached >> for reference. Thoughts? > That seems better than rewinding the history all the way back to August. +1 ... I'm just an interested observer not a user of the git repositor

Re: [HACKERS] An example of bugs for Hot Standby

2010-01-20 Thread Tom Lane
Andres Freund writes: > On Wednesday 20 January 2010 06:30:28 Tom Lane wrote: >> Er ... what? I believe there are live platforms with sig_atomic_t = char. >> If we're assuming more that's a must-fix. > The reason I have asked is that the code is doing things like: > [ grabbing a spinlock to read

Re: [HACKERS] An example of bugs for Hot Standby

2010-01-20 Thread Andres Freund
On Wednesday 20 January 2010 17:30:04 Tom Lane wrote: > Andres Freund writes: > > On Wednesday 20 January 2010 06:30:28 Tom Lane wrote: > >> Er ... what? I believe there are live platforms with sig_atomic_t = > >> char. If we're assuming more that's a must-fix. > > > > The reason I have asked is

Re: [HACKERS] MySQL-ism help patch for psql

2010-01-20 Thread Tom Lane
Dimitri Fontaine writes: > I'll give my vote to Peter's idea that show tables; should better act as > if you typed \d. We have previously considered and rejected this type of approach, for example in the pgsql-bugs discussion I referenced upthread. > I don't see what the gain is to refuse being

Re: [HACKERS] An example of bugs for Hot Standby

2010-01-20 Thread Tom Lane
Andres Freund writes: > I realize its way too late in the cycle for that, but why dont we start using > some library for easy cross platform atomic ops? (1) there probably isn't one that does exactly what we want, works everywhere, and has the right license; (2) what actual gain would we get? We

Re: [HACKERS] MySQL-ism help patch for psql

2010-01-20 Thread Dimitri Fontaine
Tom Lane writes: > The proposed patch to just provide a helpful message > is only a dozen or two lines, which is about the right amount of effort > to expend in this direction IMHO. For the record, agreed on the commands for which we have no obvious equivalent :) Regards, -- Dimitri Fontaine

Re: [HACKERS] An example of bugs for Hot Standby

2010-01-20 Thread Andres Freund
Hi Tom, Hi Simon, On Wednesday 20 January 2010 17:59:36 Tom Lane wrote: > Andres Freund writes: > > I realize its way too late in the cycle for that, but why dont we start > > using some library for easy cross platform atomic ops? > > (1) there probably isn't one that does exactly what we want,

Re: [HACKERS] About "Our CLUSTER implementation is pessimal" patch

2010-01-20 Thread Leonardo F
> I read the thread "Our CLUSTER implementation is pessimal" > http://archives.postgresql.org/pgsql-hackers/2008-08/msg01371.php . > > I would like to try/integrate that patch as we use CLUSTER a lot on our > system. > > I was going to try to add the proper cost_index/cost_sort calls to decide

Re: [HACKERS] [NOVICE] Python verison for build in config.pl (Win32)

2010-01-20 Thread Tom Lane
Matt writes: > Attempting to build 8.5 alpha on Windows XP (MSVC 2005) with Python support. > Path to local interpreter added to config.pl (C:\Python), but message is > presented: > "Could not determine python version from path at build.pl line 38" > Do the build scripts attempt to determine t

Re: [HACKERS] MonetDB test says that PostgreSQL often has errors or missing results

2010-01-20 Thread Mark Wong
On Tue, Jan 19, 2010 at 10:04 PM, Greg Smith wrote: > Josh Berkus wrote: >> >> Actually, the report which MonetDB has published I believe is illegal. >> If they're not running it through the TPC, they can't claim it's a >> "TPCH" result. >> > > I just resisted getting into that but now you've set

Synchronization primitives (Was: Re: [HACKERS] An example of bugs for Hot Standby)

2010-01-20 Thread Heikki Linnakangas
Andres Freund wrote: > On Wednesday 20 January 2010 17:59:36 Tom Lane wrote: >> Andres Freund writes: >>> I realize its way too late in the cycle for that, but why dont we start >>> using some library for easy cross platform atomic ops? >> (1) there probably isn't one that does exactly what we wan

Re: Synchronization primitives (Was: Re: [HACKERS] An example of bugs for Hot Standby)

2010-01-20 Thread Tom Lane
Heikki Linnakangas writes: > Streaming Replication introduces a few places with a polling pattern > like this (in pseudocode): > while() > { > /* Check if variable in shared has advanced beoynd X */ > SpinLockAcquire() > localvar = sharedvar; > SpinLockRelease() > if (localvar > X) >

Re: Synchronization primitives (Was: Re: [HACKERS] An example of bugs for Hot Standby)

2010-01-20 Thread Simon Riggs
On Wed, 2010-01-20 at 20:00 +0200, Heikki Linnakangas wrote: > Hot standby also has a polling loop where it waits for a > transaction a transaction to die, though I'm not sure if that can be > fit into the same model I prefer that in the context of HS because the Startup process is waiting for th

Re: [HACKERS] An example of bugs for Hot Standby

2010-01-20 Thread Simon Riggs
On Wed, 2010-01-20 at 17:40 +0100, Andres Freund wrote: > > > or similar things with LWLockAcquire in a signal handler > > > > [ grows visibly pale ] *Please* tell me we are not trying to take > > locks in a signal handler. What happens if it interrupts code that > > is already holding that lock

Re: Synchronization primitives (Was: Re: [HACKERS] An example of bugs for Hot Standby)

2010-01-20 Thread Heikki Linnakangas
Tom Lane wrote: > Heikki Linnakangas writes: >> Streaming Replication introduces a few places with a polling pattern >> like this (in pseudocode): > >> while() >> { >> /* Check if variable in shared has advanced beoynd X */ >> SpinLockAcquire() >> localvar = sharedvar; >> SpinLockRelease(

Re: Synchronization primitives (Was: Re: [HACKERS] An example of bugs for Hot Standby)

2010-01-20 Thread Tom Lane
Heikki Linnakangas writes: > My point is that we should replace such polling loops with something > non-polling, using wait/signal or semaphores or something. That gets > quite a bit more complex. You'd probably still have the loop, but > instead of pg_usleep() you'd call some new primitive functi

Re: [HACKERS] [NOVICE] Python verison for build in config.pl (Win32)

2010-01-20 Thread Magnus Hagander
On Wed, Jan 20, 2010 at 18:59, Tom Lane wrote: > Matt writes: >> Attempting to build 8.5 alpha on Windows XP (MSVC 2005) with Python support. >> Path to local interpreter added to config.pl (C:\Python), but message is >> presented: > >>   "Could not determine python version from path at build.pl

Re: Synchronization primitives (Was: Re: [HACKERS] An example of bugs for Hot Standby)

2010-01-20 Thread Heikki Linnakangas
Tom Lane wrote: > Heikki Linnakangas writes: >> My point is that we should replace such polling loops with something >> non-polling, using wait/signal or semaphores or something. That gets >> quite a bit more complex. You'd probably still have the loop, but >> instead of pg_usleep() you'd call som

Re: [HACKERS] [NOVICE] Python verison for build in config.pl (Win32)

2010-01-20 Thread Tom Lane
Magnus Hagander writes: > Or we'd welcome a patch for a smarter way to detect the version ;) This particular code doesn't look like it really needs to know the *version*. What it wants is the full pathname of the python.lib file that goes with the python executable. Isn't there a way to ask Pyt

Re: [HACKERS] Streaming replication, retrying from archive

2010-01-20 Thread Heikki Linnakangas
Dimitri Fontaine wrote: > Heikki Linnakangas writes: >> 1. Initial archive recovery. Standby fetches WAL files from archive >> using restore_command. When a file is not found in archive, we start >> walreceiver and switch to state 2 >> >> 2. Retrying to restore from archive. When the connection to

Re: [HACKERS] [NOVICE] Python verison for build in config.pl (Win32)

2010-01-20 Thread Magnus Hagander
On Wed, Jan 20, 2010 at 20:24, Tom Lane wrote: > Magnus Hagander writes: >> Or we'd welcome a patch for a smarter way to detect the version ;) > > This particular code doesn't look like it really needs to know the > *version*.  What it wants is the full pathname of the python.lib file > that goes

Re: Synchronization primitives (Was: Re: [HACKERS] An example of bugs for Hot Standby)

2010-01-20 Thread David Fetter
On Wed, Jan 20, 2010 at 09:22:49PM +0200, Heikki Linnakangas wrote: > Tom Lane wrote: > > Heikki Linnakangas writes: > >> My point is that we should replace such polling loops with something > >> non-polling, using wait/signal or semaphores or something. That gets > >> quite a bit more complex. Yo

Re: Synchronization primitives (Was: Re: [HACKERS] An example of bugs for Hot Standby)

2010-01-20 Thread Tom Lane
David Fetter writes: > On Wed, Jan 20, 2010 at 09:22:49PM +0200, Heikki Linnakangas wrote: >>> My point is that we should replace such polling loops with something >>> non-polling, using wait/signal or semaphores or something. > Is this a TODO yet? It hardly seems concrete enough for a TODO item

Re: [HACKERS] Listen / Notify - what to do when the queue is full

2010-01-20 Thread Joachim Wieland
On Wed, Jan 20, 2010 at 5:14 PM, Tom Lane wrote: > In that case I think you've way overcomplicated matters.  Just deliver > the notification.  We don't really care if the listener gets additional > notifications; the only really bad case would be if it failed to get an > event that was generated a

Re: [HACKERS] Streaming Replication and archiving

2010-01-20 Thread Josh Berkus
> Thanks Dimitri, I'd missed that thread. Ok, slave will need a suitable > restore_comand in addition to primary_conninfo in recovery.conf, and > then extended communication failures (or shutting down the slave for a > while!) will not break the streaming setup (FWIW I tried this just now). Sure,

Re: [HACKERS] Listen / Notify - what to do when the queue is full

2010-01-20 Thread Tom Lane
Joachim Wieland writes: > Okay, what about unprocessed notifications in the queue and a backend > executing UNLISTEN: can we assume that it is not interested in > notifications anymore once it executes UNLISTEN and discard all of > them even though there might be notifications that have been sent

Re: [HACKERS] per-user pg_service.conf

2010-01-20 Thread Peter Eisentraut
committed On fre, 2010-01-15 at 13:37 +0100, Christoph Berg wrote: > There's not much I have to add, maybe the documentation could add a > pointer to what keywords are recognized: > > | The file uses an "INI file" format where the section name is the > | service name and the parameters are connec

Re: [HACKERS] Streaming Replication and archiving

2010-01-20 Thread Mark Kirkwood
Josh Berkus wrote: Thanks Dimitri, I'd missed that thread. Ok, slave will need a suitable restore_comand in addition to primary_conninfo in recovery.conf, and then extended communication failures (or shutting down the slave for a while!) will not break the streaming setup (FWIW I tried this just

Re: [HACKERS] [NOVICE] Python verison for build in config.pl (Win32)

2010-01-20 Thread James William Pye
On Jan 20, 2010, at 12:27 PM, Magnus Hagander wrote: > Well, it needs the version to match it to the DLL name. For python > 2.6, it needs python26.dll. But yes, there should probably be some way > to ask python itself about that - that would be the non-naive method. > But as long as python is insta

Re: [HACKERS] MonetDB test says that PostgreSQL often has errors or missing results

2010-01-20 Thread Greg Smith
Mark Wong wrote: What the TPC provides isn't really a usable kit. It could be entertaining to see how their kit works. The one for TPC-H seems to work for a lot of people; the best of the intros I found for how to make it go was http://bhairav.serc.iisc.ernet.in/doc/Installation/tpch.htm

[HACKERS] Custom GUCs still a bit broken

2010-01-20 Thread Andrew Dunstan
It seems like Custom GUCs are still in need of some work, as shown in my recent email. In particular, they are not transaction safe - if a transaction attempts to do DefineCustomFooVariable() and that transaction aborts, the placeholder setting that it used is already gone by the time it trie

Re: [HACKERS] Listen / Notify - what to do when the queue is full

2010-01-20 Thread Jeff Davis
On Wed, 2010-01-20 at 15:54 -0500, Tom Lane wrote: > Joachim Wieland writes: > > Okay, what about unprocessed notifications in the queue and a backend > > executing UNLISTEN: can we assume that it is not interested in > > notifications anymore once it executes UNLISTEN and discard all of > > them

[HACKERS] Serializable implementation milestone: table SIREAD locks without correct lifespan

2010-01-20 Thread Kevin Grittner
Attached is a patch for the next milestone on the Serializable wiki page: changing the table-level predicate locks to SIREAD locks without worrying about lifespan. (Implementing correct lifespan is next.) The result of not worrying about it is that they aren't cleaned up at all, even when the tr

Re: [HACKERS] Listen / Notify - what to do when the queue is full

2010-01-20 Thread Joachim Wieland
On Wed, Jan 20, 2010 at 11:08 PM, Jeff Davis wrote: >> Yes.  That is the case with the existing implementation as well, no? >> We don't consider sending notifies until transaction end, so anything >> that commits during the xact in which you UNLISTEN will get dropped. > > Only if the transaction c

Re: [HACKERS] Listen / Notify - what to do when the queue is full

2010-01-20 Thread Tom Lane
Jeff Davis writes: > On Wed, 2010-01-20 at 15:54 -0500, Tom Lane wrote: >> Yes. That is the case with the existing implementation as well, no? >> We don't consider sending notifies until transaction end, so anything >> that commits during the xact in which you UNLISTEN will get dropped. > Only i

[HACKERS] HS/SR and smart shutdown

2010-01-20 Thread Josh Berkus
I've been working on my demo, and I'm discovering that due to the connection from the walsender and walreceiver, "smart" shutdown from pg_ctl doesn't work if replication is active. This seems worth fixing; if we don't fix it, we should at least document it. Comments? --Josh -- Sent via pgsql-h

Re: [HACKERS] Streaming Replication and archiving

2010-01-20 Thread Tom Lane
Mark Kirkwood writes: > Josh Berkus wrote: >> Sure, but if the archived WAL segments are NOT needed, how are they >> supposed to get deleted? It doesn't take long to run out of disk space >> if they're not being rotated. > From what I am seeing at the moment (8.5 devel from 2 days ago), the >

[HACKERS] WARNING: pgstat wait timeout

2010-01-20 Thread Sergey E. Koposov
Hello hackers, I've recently hit the message "WARNING: pgstat wait timeout" with PG 8.4.2. I saw some reports about that message in the -bugs mailing list http://archives.postgresql.org/pgsql-bugs/2009-12/msg00175.php http://archives.postgresql.org/pgsql-bugs/2009-07/msg00081.php where the bac

Re: [HACKERS] Streaming replication, retrying from archive

2010-01-20 Thread Simon Riggs
On Wed, 2010-01-20 at 21:26 +0200, Heikki Linnakangas wrote: > So there's just two states: > > 1. Recovering from archive > 2. Streaming > > We start from 1, and switch state at error. > > This gives nice behavior from a user point of view. Standby tries to > make progress using either the arch

Re: [HACKERS] Streaming Replication and archiving

2010-01-20 Thread Mark Kirkwood
Tom Lane wrote: Mark Kirkwood writes: Josh Berkus wrote: Sure, but if the archived WAL segments are NOT needed, how are they supposed to get deleted? It doesn't take long to run out of disk space if they're not being rotated. From what I am seeing at the moment (8.5 devel

Re: [HACKERS] Streaming Replication and archiving

2010-01-20 Thread Mark Kirkwood
Mark Kirkwood wrote: The likely typical use case for streaming replication makes a good case and automated safe way of pruning these guys Sorry, stupid typo: should read '...makes a good case for an automated safe way of pruning these' -- Sent via pgsql-hackers mailing list (pgsql-ha

Re: [HACKERS] HS/SR and smart shutdown

2010-01-20 Thread Fujii Masao
On Thu, Jan 21, 2010 at 8:04 AM, Josh Berkus wrote: > I've been working on my demo, and I'm discovering that due to the > connection from the walsender and walreceiver, "smart" shutdown from > pg_ctl doesn't work if replication is active. > > This seems worth fixing; if we don't fix it, we should

Re: [HACKERS] HS/SR and smart shutdown

2010-01-20 Thread Josh Berkus
> If it's "standby", it's a previously-existing behavior that a "smart" > shutdown doesn't work immediately during recovery. After a recovery > has been completed, it would work. Of course, I agree that such a > behavior should be documented. Well, as long as streaming rep is running, you can't d

Re: [HACKERS] Streaming Replication and archiving

2010-01-20 Thread Josh Berkus
> Huh? *Archived* segments aren't supposed to get deleted, at least not > by any automatic Postgres action. It would be up to the DBA how long > he wants to keep them around. OK. The docs indicated that the segments needed to be kept around in case the slave fell behind. If that's not the cas

Re: [HACKERS] HS/SR and smart shutdown

2010-01-20 Thread Robert Haas
On Wed, Jan 20, 2010 at 8:44 PM, Josh Berkus wrote: >> If it's "standby", it's a previously-existing behavior that a "smart" >> shutdown doesn't work immediately during recovery. After a recovery >> has been completed, it would work. Of course, I agree that such a >> behavior should be documented.

Re: [HACKERS] HS/SR and smart shutdown

2010-01-20 Thread Tom Lane
Robert Haas writes: > On Wed, Jan 20, 2010 at 8:44 PM, Josh Berkus wrote: >> Well, as long as streaming rep is running, you can't do a smart shutdown >> ... smart shutdown seems to treat the walreciever as a client >> connection.  At the very least, this should be in the documentation. > How har

Re: [HACKERS] HS/SR and smart shutdown

2010-01-20 Thread Robert Haas
On Wed, Jan 20, 2010 at 8:56 PM, Tom Lane wrote: > Robert Haas writes: >> On Wed, Jan 20, 2010 at 8:44 PM, Josh Berkus wrote: >>> Well, as long as streaming rep is running, you can't do a smart shutdown >>> ... smart shutdown seems to treat the walreciever as a client >>> connection.  At the ver

Re: [HACKERS] HS/SR and smart shutdown

2010-01-20 Thread Mark Kirkwood
Tom Lane wrote: Robert Haas writes: On Wed, Jan 20, 2010 at 8:44 PM, Josh Berkus wrote: Well, as long as streaming rep is running, you can't do a smart shutdown ... smart shutdown seems to treat the walreciever as a client connection. At the very least, this should be in the document

Re: [HACKERS] Fix auto-prepare #2

2010-01-20 Thread Takahiro Itagaki
Boszormenyi Zoltan wrote: > I only wanted to call ECPGprepare() in case it wasn't already prepared. > ECPGprepare() also checks for the statement being already prepared > with ecpg_find_prepared_statement() but in case it exists it > DEALLOCATEs the statement and PREPAREs again so there's > woul

Re: [HACKERS] Listen / Notify - what to do when the queue is full

2010-01-20 Thread Jeff Davis
On Tue, 2010-01-19 at 19:24 -0500, Tom Lane wrote: > (I'm still > wondering if we couldn't do without the lock altogether though.) Here's the problem as I see it: If we insert the notifications into the queue before actually recording the commit, there's a window in between where another backend

Re: [HACKERS] WARNING: pgstat wait timeout

2010-01-20 Thread Jaime Casanova
On Wed, Jan 20, 2010 at 6:20 PM, Sergey E. Koposov wrote: > Hello hackers, > > I've recently hit the message "WARNING:  pgstat wait timeout" with PG 8.4.2. i see the same yesterday when initdb a freshly compiled 8.5dev + lock_timeout patch i thought maybe it was related to that patch and was thin

Re: [HACKERS] plpython3 perf

2010-01-20 Thread James William Pye
On Jan 14, 2010, at 2:03 PM, Joshua D. Drake wrote: > What I would (as a non hacker) would look for is: > > (1) Generalized benchmarks between plpython(core) and plpython3u > > I know a lot of these are subjective, but it is still good to see if > there are any curves or points that bring the per

Re: [HACKERS] WARNING: pgstat wait timeout

2010-01-20 Thread Jaime Casanova
On Wed, Jan 20, 2010 at 9:32 PM, Jaime Casanova wrote: > On Wed, Jan 20, 2010 at 6:20 PM, Sergey E. Koposov wrote: >> Hello hackers, >> >> I've recently hit the message "WARNING:  pgstat wait timeout" with PG 8.4.2. > > i see the same yesterday when initdb a freshly compiled 8.5dev + > lock_timeo

Re: [HACKERS] HS/SR and smart shutdown

2010-01-20 Thread Fujii Masao
On Thu, Jan 21, 2010 at 10:44 AM, Josh Berkus wrote: > >> If it's "standby", it's a previously-existing behavior that a "smart" >> shutdown doesn't work immediately during recovery. After a recovery >> has been completed, it would work. Of course, I agree that such a >> behavior should be document

  1   2   >