[HACKERS] windows consolidated cleanup

2011-04-23 Thread Andrew Dunstan
The attached patch is intended to clean up a bunch of compiler warnings seen on Windows due to mismatches of signedness or constness, unused variables, redefined macros and a missing prototype. It doesn't clean up all the warnings by any means, but it fixes quite a few. One thing I'm a bit c

Re: [HACKERS] Extension Packaging

2011-04-23 Thread David E. Wheeler
On Apr 23, 2011, at 1:03 PM, Dimitri Fontaine wrote: > Daniele Varrazzo writes: >> For my extension I'm less concerned by having the install sql named in >> different ways or by the upgrade sql as all these files are generated >> by scripts. You may find useful this one > > You can also generate

Re: [HACKERS] time-delayed standbys

2011-04-23 Thread Jaime Casanova
On Tue, Apr 19, 2011 at 9:47 PM, Robert Haas wrote: > > That is, a standby configured such that replay lags a prescribed > amount of time behind the master. > > This seemed easy to implement, so I did.  Patch (for 9.2, obviously) attached. > This crashes when stoping recovery to a target (i tried

[HACKERS] pg_upgrade copy_file not needed on Win32

2011-04-23 Thread Bruce Momjian
I have applied the attached patch which prevents copy_file() from being compiled on Win32, per report from Andrew Dunstan. copy_file() is not used on Win32 and generates a warning. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com

[HACKERS] pgwin32_send

2011-04-23 Thread Andrew Dunstan
The declaration of pgwin32_send in src/backend/port/win32/socket.c has: int pgwin32_send(SOCKET s, char *buf, int len, int flags) but the on my Linux machine, the prototype for send() is: ssize_t send(int sockfd, const void *buf, size_t len, int flags); Is there any reason not to

Re: [HACKERS] Extension Packaging

2011-04-23 Thread Daniele Varrazzo
On Thu, Apr 21, 2011 at 4:16 AM, Tom Lane wrote: > "David E. Wheeler" writes: >> * Another, minor point: If I release a new version with no changes to the >> code (as I've done today, just changing the make stuff and documentation), >> it's kind of annoying that I'd need to have a migration sc

[HACKERS] code cleanups

2011-04-23 Thread Andrew Dunstan
getopt.c is looking a bit ancient. In particular, getopt() has no prototype and old style arguments. Is there any reason not to bring this into the 1990s (or is that 1980s?) gcc also doesn't like the way perl does unused attributes on Windows, and it generates quite a few warnings about it.

Re: [HACKERS] Patch for pg_upgrade to turn off autovacuum

2011-04-23 Thread Bruce Momjian
Bruce Momjian wrote: > Bruce Momjian wrote: > > Tom Lane wrote: > > > Bruce Momjian writes: > > > > I thought some more about this and I don't want autovacuum to run on the > > > > old server. This is because pg_dumpall --binary-upgrade --schema-only > > > > grabs the datfrozenxid for all the dat

Re: [HACKERS] Extension Packaging

2011-04-23 Thread Dimitri Fontaine
Daniele Varrazzo writes: > For my extension I'm less concerned by having the install sql named in > different ways or by the upgrade sql as all these files are generated > by scripts. You may find useful this one You can also generate that reliably in SQL. You install your extension with CREATE

Re: [HACKERS] Fix for Perl 5.14

2011-04-23 Thread Reini Urban
2011/4/23 Andrew Dunstan : > On 04/23/2011 03:02 AM, Alex Hunsaker wrote: >> >> Perl 5.14.0-RC1 came out a few days ago... >> >> There is a minor compile time error due to the API changing a bit: >> plperl.c:929:3: error: lvalue required as left operand of assignment >> >> This is due to GvCV() no

Re: [HACKERS] smallserial / serial2

2011-04-23 Thread Mike Pultz
Hey Tom, I'm sure there are plenty of useful tables with <= 32k rows in them? I have a table for customers that uses a smallint (since the customer id is referenced all over the place)- due to the nature of our product, we're never going to have more than 32k customers, but I still want the ben

Re: [HACKERS] Proposed fix for NOTIFY performance degradation

2011-04-23 Thread Tom Lane
Gianni Ciolli writes: > [ proposes lobotomization of duplicate-elimination behavior in NOTIFY ] I think this change is likely to be penny-wise and pound-foolish. The reason the duplicate check is in there is that things like triggers may just do "NOTIFY my_table_changed". If the trigger is fired

[HACKERS] Some TODO items for collations

2011-04-23 Thread Tom Lane
I think the collations patch has now gone about as far as it's going to get for 9.1. There are a couple of areas that ought to be on the TODO list for future versions, though: * Integrating collations with text search configurations. There are several places in the tsearch code that currently ha

Re: [HACKERS] Fix for Perl 5.14

2011-04-23 Thread Alex Hunsaker
On Sat, Apr 23, 2011 at 07:00, Andrew Dunstan wrote: > > > On 04/23/2011 03:02 AM, Alex Hunsaker wrote: >> ... >> There is a minor compile time error due to the API changing a bit: >> plperl.c:929:3: error: lvalue required as left operand of assignment >> ... >> Unfortunately  that macro is not av

Re: [HACKERS] What Index Access Method Functions are really needed?

2011-04-23 Thread Kevin Grittner
Yves Weißig wrote: > I can not find "amcostestimate" in hash.h or anywhere, or am I > missing something? Search for hashcostestimate here: http://git.postgresql.org/gitweb?p=postgresql.git;a=blob;f=src/backend/utils/adt/selfuncs.c To find that, I ran this query: select * from pg_am; Tha

Re: [HACKERS] Collation patch's handling of wcstombs/mbstowcs is sheerest fantasy

2011-04-23 Thread Tom Lane
I wrote: > * Where they're not, install the locale_t with uselocale(), do > mbstowcs or wcstombs, and revert to the former locale_t setting. > This is ugly as sin, and not thread-safe, but of course lots of > the backend is not thread-safe. I've been corrected on that: uselocale() *is* thread safe

Re: [HACKERS] pgbench \for or similar loop

2011-04-23 Thread Dimitri Fontaine
Greg Smith writes: > Kevin Grittner wrote: >> I'm not clear on exactly what you're proposing there, but the thing >> I've considered doing is having threads to try to keep a FIFO queue >> populated with a configurable transaction mix, while a configurable >> number of worker threads pull those tra

Re: [HACKERS] fsync reliability

2011-04-23 Thread Matthew Woodcraft
On 2011-04-22 21:55, Greg Smith wrote: > On 04/22/2011 09:32 AM, Simon Riggs wrote: >> OK, that's good, but ISTM we still have a hole during >> RemoveOldXlogFiles() where we don't fsync or open/close the file, just >> rename it. > > This is also something that many applications rely upon working a

Re: [HACKERS] best way to test new index?

2011-04-23 Thread Yves Weißig
Thanks for the answer Kevin! I am developing an encoded bitmap index, as proposed in http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.44.7570&rank=1 Automated, in my words, would have meant... some SQL-Statements which create tables, do inserts, deletes, selects and so on and the results c

Re: [HACKERS] What Index Access Method Functions are really needed?

2011-04-23 Thread Yves Weißig
That is exactly the point, Kevin, I read the documentation and found out that "amgettuple" and "amgetbitmap" are optional. I just wondered if there is more information about this topic? Additionally, I can not find "amcostestimate" in hash.h or anywhere, or am I missing something? So "All of them"

[HACKERS] Proposed fix for NOTIFY performance degradation

2011-04-23 Thread Gianni Ciolli
Hi, while measuring NOTIFY execution time, I noticed a significant performance drop. Please find a patch attached, together with some tests; more details are shown below. Best regards, Dr. Gianni Ciolli - 2ndQuadrant Italia PostgreSQL Training, Services and Support gianni.cio...@2ndquadrant.it |

Re: [HACKERS] SSI non-serializalbe UPDATE performance (was: getting to beta)

2011-04-23 Thread Kevin Grittner
> Dan Ports wrote: > Even under these conditions I couldn't reliably see a slowdown. My > latest batch of results (16 backends, median of three 10 minute > runs) shows a difference well below 1%. In a couple of cases I saw > the code with the SSI checks running faster than with them removed, > s

Re: [HACKERS] Fix for Perl 5.14

2011-04-23 Thread Andrew Dunstan
On 04/23/2011 03:02 AM, Alex Hunsaker wrote: Perl 5.14.0-RC1 came out a few days ago... There is a minor compile time error due to the API changing a bit: plperl.c:929:3: error: lvalue required as left operand of assignment This is due to GvCV() no longer returning an lvalue, instead they wan

[HACKERS] Fix for Perl 5.14

2011-04-23 Thread Alex Hunsaker
Perl 5.14.0-RC1 came out a few days ago... There is a minor compile time error due to the API changing a bit: plperl.c:929:3: error: lvalue required as left operand of assignment This is due to GvCV() no longer returning an lvalue, instead they want us to use the new GvCV_set macro. (see http://s