Re: [HACKERS] Formatting Curmudgeons WAS: MMAP Buffers

2011-04-19 Thread Tom Lane
Josh Berkus j...@agliodbs.com writes: I received a private offlist email from someone who didn't feel comfortable bringing up their issues with this list publicly. Let me quote from it, because I think it pins part of the issue: I believe this is due to the current postgresql commitfest

Re: [HACKERS] Windows 64 bit warnings

2011-04-19 Thread Magnus Hagander
On Mon, Apr 18, 2011 at 19:00, Tom Lane t...@sss.pgh.pa.us wrote: Alvaro Herrera alvhe...@commandprompt.com writes: Excerpts from Andrew Dunstan's message of sáb abr 16 21:46:44 -0300 2011: The other, slightly more serious case, is at src/test/regress/pg_regress.c:2280, which is this code:

[HACKERS] Warning during PostgreSQL 9.0.4 libpq.dll build on WinXP+MinGW

2011-04-19 Thread Pavel Golub
Hello, Pgsql-hackers. Today I built libpq.dll library on Windows XP using MinGW and got one warning message: Pablo@computer /z/pasha/postgresql-9.0.4/src/interfaces/libpq $ make ... gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels

Re: [HACKERS] Windows 64 bit warnings

2011-04-19 Thread Andrew Dunstan
On 04/19/2011 04:08 AM, Magnus Hagander wrote: IIRC, even while HANDLE is a 64-bit value on Win64, only the lower 32-bits are actually used. Took me a while to find a ref, but this is one I found: http://msdn.microsoft.com/en-us/library/aa384203(v=vs.85).aspx Good. I think all we need here

Re: [HACKERS] Warning during PostgreSQL 9.0.4 libpq.dll build on WinXP+MinGW

2011-04-19 Thread Heikki Linnakangas
On 19.04.2011 14:09, Pavel Golub wrote: Today I built libpq.dll library on Windows XP using MinGW and got one warning message: Pablo@computer /z/pasha/postgresql-9.0.4/src/interfaces/libpq $ make ... gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement

Re: [HACKERS] Windows 64 bit warnings

2011-04-19 Thread Michael Meskes
On Sat, Apr 16, 2011 at 08:46:44PM -0400, Andrew Dunstan wrote: One is at src/interfaces/ecpg/ecpglib/sqlda.c:231, which is this line: sqlda-sqlvar[i].sqlformat = (char *) (long) PQfformat(res, i); I'm not clear about the purpose of this anyway. It doesn't seem to be used anywhere, and

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread David Fetter
On Mon, Apr 18, 2011 at 06:02:53PM -0300, Alvaro Herrera wrote: Hi, Today (and previously) I wished that pgbench had a mechanism to help create simple random databases. For example, I could create a table tenk and fill it with random stuff like \setrandom foo 1 1 insert into foo

Re: [HACKERS] Windows 64 bit warnings

2011-04-19 Thread Tom Lane
Andrew Dunstan and...@dunslane.net writes: If we cast the HANDLE to a long long first and then truncate it the compiler is silent, it only complains if that's done in one operation. So maybe something like: #ifdef WIN64 #define ULONGPID(x) (unsigned long) (unsigned long long) (x)

[HACKERS] Build farm coverage for isolation tests

2011-04-19 Thread Kevin Grittner
I'm not sure what the right thing is to do here. Heikki added a new testing methodology under src/test/isolation which allows intermingling a series of statements on multiple connections in desired permutations. (By default each test defined for it runs all permutations of how the statement

Re: [JDBC] [HACKERS] JDBC connections to 9.1

2011-04-19 Thread Kris Jurka
On Tue, 19 Apr 2011, Tom Lane wrote: Kris Jurka bo...@ejurka.com writes: On Mon, 18 Apr 2011, Mike Fowler wrote: As there seems to be a consensus forming for fixing the JDBC driver, I've taken the liberty do so at the risk of being shot down. The patch is fairly straightforward, just

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Robert Haas
On Mon, Apr 18, 2011 at 5:37 PM, Alvaro Herrera alvhe...@commandprompt.com wrote: Excerpts from Merlin Moncure's message of lun abr 18 18:26:54 -0300 2011: On Mon, Apr 18, 2011 at 4:02 PM, Alvaro Herrera alvhe...@alvh.no-ip.org wrote: begin; \for iterator 1 1  \setrandom foo 1

[HACKERS] REINDEX vs broken HOT chains, redux

2011-04-19 Thread Tom Lane
Last week we fixed a problem in which REINDEX could corrupt pg_index's own indexes by forbidding it from setting indcheckxmin on a system catalog's index. While thinking about bug #5985 I realized that there's a better, more general solution. Namely, that when reindexing an existing index, there

Re: [HACKERS] Build farm coverage for isolation tests

2011-04-19 Thread Andrew Dunstan
On 04/19/2011 11:16 AM, Kevin Grittner wrote: I'm not sure what the right thing is to do here. Heikki added a new testing methodology under src/test/isolation which allows intermingling a series of statements on multiple connections in desired permutations. (By default each test defined for

Re: [HACKERS] Build farm coverage for isolation tests

2011-04-19 Thread Kevin Grittner
Andrew Dunstan and...@dunslane.net wrote: I think the best thing might be to add a new step which runs the isolation check or installcheck. It would only need a small amount of perl code adde3d to the client to accomplish, and nothing on the server side. Since I'm unskilled at perl and

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Merlin Moncure
On Tue, Apr 19, 2011 at 10:22 AM, Robert Haas robertmh...@gmail.com wrote: On Mon, Apr 18, 2011 at 5:37 PM, Alvaro Herrera alvhe...@commandprompt.com wrote: Excerpts from Merlin Moncure's message of lun abr 18 18:26:54 -0300 2011: On Mon, Apr 18, 2011 at 4:02 PM, Alvaro Herrera

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Robert Haas
On Tue, Apr 19, 2011 at 11:56 AM, Merlin Moncure mmonc...@gmail.com wrote: I do think that DO covers a lot of the same territory that could usefully be addressed by a more powerful backslash-command language in psql.  It's in some ways quite a bit more powerful, because it's available from any

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Christopher Browne
On Tue, Apr 19, 2011 at 12:22 PM, Robert Haas robertmh...@gmail.com wrote: Yeah.  I was wondering if anyone was gung-ho enough about this to implement some kind of library that both programs could draw on. It probably wouldn't be super-hard, if we could agree on a rough design. It seems to me

Re: [JDBC] [HACKERS] JDBC connections to 9.1

2011-04-19 Thread Tom Lane
Kris Jurka bo...@ejurka.com writes: On Tue, 19 Apr 2011, Tom Lane wrote: For purposes of the notes in the server-side fix, could you state which JDBC driver versions these changes will first appear in? This is in 9.1dev-900 and won't be backpatched. OK, thanks. I've committed a patch to

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Robert Haas
On Tue, Apr 19, 2011 at 12:27 PM, Christopher Browne cbbro...@gmail.com wrote: On Tue, Apr 19, 2011 at 12:22 PM, Robert Haas robertmh...@gmail.com wrote: Yeah.  I was wondering if anyone was gung-ho enough about this to implement some kind of library that both programs could draw on. It

Re: [HACKERS] Build farm coverage for isolation tests

2011-04-19 Thread Alvaro Herrera
Excerpts from Kevin Grittner's message of mar abr 19 12:53:07 -0300 2011: Since I'm unskilled at perl and have never looked at the buildfarm scripts, could someone with the appropriate skills and knowledge add this for me? In bash, when I'm in the normal base directory for a build from

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Alvaro Herrera
Excerpts from Robert Haas's message of mar abr 19 13:33:27 -0300 2011: On Tue, Apr 19, 2011 at 12:27 PM, Christopher Browne cbbro...@gmail.com wrote: On Tue, Apr 19, 2011 at 12:22 PM, Robert Haas robertmh...@gmail.com wrote: Yeah.  I was wondering if anyone was gung-ho enough about this to

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Merlin Moncure
On Tue, Apr 19, 2011 at 11:49 AM, Alvaro Herrera alvhe...@commandprompt.com wrote: Excerpts from Robert Haas's message of mar abr 19 13:33:27 -0300 2011: On Tue, Apr 19, 2011 at 12:27 PM, Christopher Browne cbbro...@gmail.com wrote: On Tue, Apr 19, 2011 at 12:22 PM, Robert Haas

Re: [HACKERS] REINDEX vs broken HOT chains, redux

2011-04-19 Thread Alvaro Herrera
Excerpts from Tom Lane's message of mar abr 19 12:29:04 -0300 2011: Last week we fixed a problem in which REINDEX could corrupt pg_index's own indexes by forbidding it from setting indcheckxmin on a system catalog's index. While thinking about bug #5985 I realized that there's a better, more

Re: [HACKERS] REINDEX vs broken HOT chains, redux

2011-04-19 Thread Tom Lane
Alvaro Herrera alvhe...@commandprompt.com writes: Excerpts from Tom Lane's message of mar abr 19 12:29:04 -0300 2011: I'm intending to revert last week's patch in favor of this approach, at least in HEAD. It'll be slightly more invasive than the previous patch because of the API change for

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Tom Lane
Alvaro Herrera alvhe...@commandprompt.com writes: Excerpts from Robert Haas's message of mar abr 19 13:33:27 -0300 2011: Well, I'm all good with that, too, but am not fired up about either one to implement it myself. So I think it's going to come down to what the person doing the work feels

Re: [HACKERS] REINDEX vs broken HOT chains, redux

2011-04-19 Thread Alvaro Herrera
Excerpts from Tom Lane's message of mar abr 19 14:12:46 -0300 2011: Alvaro Herrera alvhe...@commandprompt.com writes: Excerpts from Tom Lane's message of mar abr 19 12:29:04 -0300 2011: I'm intending to revert last week's patch in favor of this approach, at least in HEAD. It'll be slightly

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Andres Freund
On Tuesday, April 19, 2011 07:22:54 PM Tom Lane wrote: I generally feel that such a feature would be better off done server-side --- after all, there's more clients in the world than psql and pgbench, and not all of them could use a C library even if we had one. But in either case the coding

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Aidan Van Dyk
On Tue, Apr 19, 2011 at 1:22 PM, Tom Lane t...@sss.pgh.pa.us wrote: I think what that really translates to is I don't want to bother doing the careful design work that Robert talked about. -1 for that approach. As someone not doing any of that work, agreed ;-) I generally feel that such a

[HACKERS] CLUSTER versus broken HOT chains

2011-04-19 Thread Tom Lane
I believe I've worked out what's going on in bug #5985. The example script contains an UPDATE on a table, then a creation of an index, then a CLUSTER on that index, all within one transaction. If the UPDATE does any HOT updates, then the index is going to be marked with indcheckxmin horizon

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread David Fetter
On Tue, Apr 19, 2011 at 12:27:45PM -0400, Christopher Browne wrote: On Tue, Apr 19, 2011 at 12:22 PM, Robert Haas robertmh...@gmail.com wrote: Yeah.  I was wondering if anyone was gung-ho enough about this to implement some kind of library that both programs could draw on. It probably

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Kevin Grittner
Aidan Van Dyk ai...@highrise.ca wrote: And for the first-hack-that-comes-to-mind, I find my self pulling out the named fifo trick all the time, and just leaving my for/loop/if logic in bash writing SQL commands to the fifo, occasionally getting psql to write an answer to a file that I then

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Aidan Van Dyk
On Tue, Apr 19, 2011 at 1:57 PM, Kevin Grittner kevin.gritt...@wicourts.gov wrote: Aidan Van Dyk ai...@highrise.ca wrote: And for the first-hack-that-comes-to-mind, I find my self pulling out the named fifo trick all the time, and just leaving my for/loop/if logic  in bash writing SQL

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Alvaro Herrera
Excerpts from Tom Lane's message of mar abr 19 14:22:54 -0300 2011: Alvaro Herrera alvhe...@commandprompt.com writes: Excerpts from Robert Haas's message of mar abr 19 13:33:27 -0300 2011: Well, I'm all good with that, too, but am not fired up about either one to implement it myself. So I

Re: [HACKERS] Transforming IN (...) to ORs, volatility

2011-04-19 Thread Heikki Linnakangas
On 11.04.2011 19:33, Heikki Linnakangas wrote: On 11.04.2011 19:06, Kevin Grittner wrote: Heikki Linnakangasheikki.linnakan...@enterprisedb.com wrote: Hmm, the SQL specification explicitly says that X BETWEEN Y AND Z is equal to X= Y AND X= Z It doesn't say anything about side-effects of

Re: [HACKERS] Transforming IN (...) to ORs, volatility

2011-04-19 Thread Tom Lane
Heikki Linnakangas heikki.linnakan...@enterprisedb.com writes: I'd like us to still fix this so that there's no multiple evaluation - that would actually make BETWEEN more useful than it is today. I'm working on a patch to handle both BETWEEN and IN. One other issue here is that the parser

Re: [HACKERS] [COMMITTERS] pgsql: Rename pg_regress option --multibyte to --encoding

2011-04-19 Thread Peter Eisentraut
On Sat, 2011-04-16 at 15:07 -0400, Andrew Dunstan wrote: On 04/15/2011 04:36 PM, Peter Eisentraut wrote: On Fri, 2011-04-15 at 12:28 -0400, Andrew Dunstan wrote: Yeah, what is the point of this?: -# Adjust REGRESS_OPTS because we need a UTF8 database -REGRESS_OPTS =

Re: [HACKERS] Typed table DDL loose ends

2011-04-19 Thread Peter Eisentraut
On Mon, 2011-04-18 at 19:34 -0400, Noah Misch wrote: On Mon, Apr 18, 2011 at 10:44:53PM +0300, Peter Eisentraut wrote: On Sat, 2011-04-09 at 21:57 -0400, Noah Misch wrote: * Users can CREATE TABLE OF on a type they don't own This in turns blocks the owner's ability to alter the

Re: [HACKERS] getting to beta

2011-04-19 Thread Robert Haas
On Wed, Apr 6, 2011 at 9:21 AM, Robert Haas robertmh...@gmail.com wrote: A quick review of the open items list suggests that we have three main areas that need attention before we can declare ourselves ready for beta. In no particular order: 1. There are a bunch of small, outstanding SSI

[HACKERS] Needs Suggestion

2011-04-19 Thread SUBHAM ROY
Suppose Postgres is installed in two computers C1 C2. C1 have some database tables. How can I copy these database tables from C1 to C2. I mean to say that can I copy tables from postgres installed in one m/c to another m/c. Is there any command in postgres to do so or any other short cut

Re: [HACKERS] Needs Suggestion

2011-04-19 Thread Vibhor Kumar
On Apr 20, 2011, at 4:08 AM, SUBHAM ROY wrote: Suppose Postgres is installed in two computers C1 C2. C1 have some database tables. How can I copy these database tables from C1 to C2. I mean to say that can I copy tables from postgres installed in one m/c to another m/c. Is there any

Re: [HACKERS] getting to beta

2011-04-19 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: Since we're targeting code freeze for beta1 for approximately now + 1 week, it's probably about time to take stock of where we are. 3. The collation issues that have been discussed on-list have, I *think*, mostly been dealt with. But maybe there are

[HACKERS] Insufficient description in collation mismatch error

2011-04-19 Thread Thom Brown
Hi, I tried applying a collation to a GROUP BY clause without applying the collation to the corresponding column in the SELECT clause. postgres=# SELECT things, count(*) FROM stuff GROUP BY things COLLATE C; ERROR: column stuff.things must appear in the GROUP BY clause or be used in an

Re: [HACKERS] pgbench \for or similar loop

2011-04-19 Thread Jeff Janes
On Tue, Apr 19, 2011 at 11:22 AM, Alvaro Herrera alvhe...@commandprompt.com wrote: Excerpts from Tom Lane's message of mar abr 19 14:22:54 -0300 2011: Alvaro Herrera alvhe...@commandprompt.com writes: Excerpts from Robert Haas's message of mar abr 19 13:33:27 -0300 2011: Well, I'm all good

[HACKERS] Re: [COMMITTERS] pgsql: setlocale() on Windows doesn't work correctly if the locale name

2011-04-19 Thread Hiroshi Inoue
(2011/04/16 2:56), Heikki Linnakangas wrote: setlocale() on Windows doesn't work correctly if the locale name contains apostrophes or dots. As for apostrophes, isn't the cause that initdb loses the single quote of locale? ([BUGS] BUG #5818: initdb lose the single quote of locale) As the bug

Re: [HACKERS] getting to beta

2011-04-19 Thread Robert Haas
On Tue, Apr 19, 2011 at 7:03 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: Since we're targeting code freeze for beta1 for approximately now + 1 week, it's probably about time to take stock of where we are. 3. The collation issues that have been discussed

Re: [HACKERS] Re: [COMMITTERS] pgsql: setlocale() on Windows doesn't work correctly if the locale name

2011-04-19 Thread Tom Lane
Hiroshi Inoue in...@tpf.co.jp writes: (2011/04/16 2:56), Heikki Linnakangas wrote: setlocale() on Windows doesn't work correctly if the locale name contains apostrophes or dots. As for apostrophes, isn't the cause that initdb loses the single quote of locale? ([BUGS] BUG #5818: initdb lose

Re: [HACKERS] Insufficient description in collation mismatch error

2011-04-19 Thread Tom Lane
Thom Brown t...@linux.com writes: I tried applying a collation to a GROUP BY clause without applying the collation to the corresponding column in the SELECT clause. postgres=# SELECT things, count(*) FROM stuff GROUP BY things COLLATE C; ERROR: column stuff.things must appear in the GROUP BY

[HACKERS] Fix for pg_upgrade with extra new cluster databases

2011-04-19 Thread Bruce Momjian
The attached, applied patch adds a check to throw a pg_upgrade error during the check phase, rather than during the post-check upgrade phase. Specifically, if someone removes the 'postgres' database from the old cluster and the new cluster has a 'postgres' database, the number of databases will

Re: [HACKERS] Re: [COMMITTERS] pgsql: setlocale() on Windows doesn't work correctly if the locale name

2011-04-19 Thread Hiroshi Inoue
(2011/04/20 9:22), Tom Lane wrote: Hiroshi Inouein...@tpf.co.jp writes: (2011/04/16 2:56), Heikki Linnakangas wrote: setlocale() on Windows doesn't work correctly if the locale name contains apostrophes or dots. As for apostrophes, isn't the cause that initdb loses the single quote of

Re: [HACKERS] pg_dump --binary-upgrade vs. ALTER TYPE ... DROP ATTRIBUTE

2011-04-19 Thread Robert Haas
On Mon, Apr 18, 2011 at 7:50 PM, Noah Misch n...@leadboat.com wrote: On Fri, Apr 15, 2011 at 11:58:30AM -0400, Noah Misch wrote: When we're done with the relkind-restriction patch, I'll post a new version of this one.  It will remove the circularity check and add a relkind check. Here it

[HACKERS] time-delayed standbys

2011-04-19 Thread Robert Haas
While I was out at the MySQL conference last week, I heard that one of the forthcoming MySQL features is time-delayed replication: http://forge.mysql.com/worklog/task.php?id=344 That is, a standby configured such that replay lags a prescribed amount of time behind the master. This seemed easy

Re: [HACKERS] Re: [COMMITTERS] pgsql: setlocale() on Windows doesn't work correctly if the locale name

2011-04-19 Thread Andrew Dunstan
On 04/19/2011 09:42 PM, Hiroshi Inoue wrote: bootstrap_template1() in initdb runs the BKI script in bootstrap mode to create template1. Some symbols (LC_COLLATE, LC_CTYPE in pg_database etc) in the BKI script are substituted by actual values using replace_token(). Isn't it correct? ISTM

Re: [HACKERS] Re: [COMMITTERS] pgsql: setlocale() on Windows doesn't work correctly if the locale name

2011-04-19 Thread Hiroshi Inoue
(2011/04/20 12:25), Andrew Dunstan wrote: On 04/19/2011 09:42 PM, Hiroshi Inoue wrote: bootstrap_template1() in initdb runs the BKI script in bootstrap mode to create template1. Some symbols (LC_COLLATE, LC_CTYPE in pg_database etc) in the BKI script are substituted by actual values using

[HACKERS] pgindent weirdness

2011-04-19 Thread Robert Haas
pgindent seems to have muffed it when it comes to BulkInsertStateData: diff --git a/src/backend/access/heap/hio.c b/src/backend/access/heap/hio.c index 2849992..72a69e5 100644 --- a/src/backend/access/heap/hio.c +++ b/src/backend/access/heap/hio.c @@ -150,7 +150,7 @@ ReadBufferBI(Relation

Re: [HACKERS] REINDEX vs broken HOT chains, redux

2011-04-19 Thread Greg Stark
On Tue, Apr 19, 2011 at 4:29 PM, Tom Lane t...@sss.pgh.pa.us wrote:  Namely, that when reindexing an existing index, there cannot be any need to advance the index's indcheckxmin horizon. Note that if isvalid is not set then we don't know anything about the hot chains since the concurrent index