Re: [HACKERS] would hw acceleration help postgres (databases in general) ?

2011-03-27 Thread 3dmashup
Yes! Probably very much so. There is good evidence that using multiple CPU's and GPU's will speed sorting and many other database operations too. See http://www.cs.cmu.edu/afs/cs.cmu.edu/Web/People/ngm/15-823/project/Final.pdf The question become how practical is it? There are numerous

Re: [HACKERS] Libpq PGRES_COPY_BOTH - version compatibility

2011-03-27 Thread Simon Riggs
On Sun, Mar 27, 2011 at 4:09 AM, Robert Haas robertmh...@gmail.com wrote: On Mon, Jan 3, 2011 at 6:55 AM, Magnus Hagander mag...@hagander.net wrote: ISTM that the correct fix is to increment to protocol version number to 3.1 and send PGRES_COPY_OUT if the client requests version 3.0.  That's

Re: [HACKERS] WIP: Allow SQL-language functions to reference parameters by parameter name

2011-03-27 Thread Dimitri Fontaine
Robert Haas robertmh...@gmail.com writes: On Sat, Mar 26, 2011 at 5:19 PM, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: I think the best choice is to only accept qualified parameter names in SQL functions (function_name.parameter_name).  If a referenced table share the function's name,

[HACKERS] [DOCS] patch for createdb section in tutorial

2011-03-27 Thread Susanne Ebrecht
Hello, During translating the docs I found the following sentence in the tutorial section about createdb: Database names must have an alphabetic first character and are limited to 63 characters I wondered - really characters? shouldn't it be bytes? I just tested - creating a database by using

Re: [HACKERS] WIP: Allow SQL-language functions to reference parameters by parameter name

2011-03-27 Thread Robert Haas
On Mar 27, 2011, at 6:11 AM, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Robert Haas robertmh...@gmail.com writes: That syntax is sufficiently unwieldly that few people will want to use it in real life, but certainly the backward compatibility problem is much less than with what Tom

Re: [HACKERS] DO hint update?

2011-03-27 Thread Robert Haas
On Mar 27, 2011, at 12:10 AM, Tom Lane t...@sss.pgh.pa.us wrote: Hm ... the core languages would now prefer CREATE EXTENSION, but it's not clear how fast non-core PLs will follow suit. Perhaps Use CREATE EXTENSION or CREATE LANGUAGE to load ... ? Dear me. If we don't know what's right, how

Re: [HACKERS] race condition in sync rep

2011-03-27 Thread Simon Riggs
On Sat, Mar 26, 2011 at 5:51 PM, Robert Haas robertmh...@gmail.com wrote: On Sat, Mar 26, 2011 at 12:41 PM, Simon Riggs si...@2ndquadrant.com wrote: Is it? Sync rep requires fsync on the standby. If you then explicitly turn off fsync on the standby then it has a performance impact, as

Re: [HACKERS] Lock problem with autovacuum truncating heap

2011-03-27 Thread Simon Riggs
On Sat, Mar 26, 2011 at 8:05 PM, Jan Wieck janwi...@yahoo.com wrote: On 3/26/2011 12:12 PM, Simon Riggs wrote: On Sat, Mar 26, 2011 at 2:30 PM, Jan Wieckjanwi...@yahoo.com  wrote:  My current idea for a fix is to modify lazy_truncate_heap(). It does acquire  and release the exclusive lock,

Re: [HACKERS] Lock problem with autovacuum truncating heap

2011-03-27 Thread Robert Haas
On Mar 26, 2011, at 4:16 PM, Jan Wieck janwi...@yahoo.com wrote: That was what I meant. Go in steps of 16-64MB backwards and scan from there to the current end in forward direction to find a nondeletable block. In between these steps, release and reacquire the exclusive lock so that client

[HACKERS] Can I check if somebody is superuser in stored procedure?

2011-03-27 Thread Pavel Stehule
Hello Is there some simple possibility to check a rights from stored procedure? Regards Pavel Stehule -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers

[HACKERS] Needs Suggestion

2011-03-27 Thread SUBHAM ROY
Hi, I am currently a student of IIT Bombay. I am doing a project on Benchmark design. For that I need to measure the performance of various queries in databases. I want to know how can we measure the execution time of a query in Postgres (Explain analyze will not do). Also is there any tools

Re: [HACKERS] WIP: Allow SQL-language functions to reference parameters by parameter name

2011-03-27 Thread David Fetter
On Fri, Mar 25, 2011 at 09:12:33PM -0400, Robert Haas wrote: On Fri, Mar 25, 2011 at 8:58 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: On Mar 25, 2011, at 7:45 PM, Tom Lane t...@sss.pgh.pa.us wrote: Well, maybe, but it's not like it's subtle or hard to

Re: [HACKERS] WIP: Allow SQL-language functions to reference parameters by parameter name

2011-03-27 Thread Andrew Dunstan
On 03/27/2011 09:42 AM, David Fetter wrote: On Fri, Mar 25, 2011 at 09:12:33PM -0400, Robert Haas wrote: As I've said before, I believe that the root cause of this problem is that using the same syntax for variables and column names is a bad idea in the first place. If we used $foo or ?foo

Re: [HACKERS] Needs Suggestion

2011-03-27 Thread 3dmashup
Subham, I would start with reviewing Prof Mike Stonebrakers and Dr Paula Hawthorns paper http://portal.acm.org/citation.cfm?doid=582095.582097 you can also look at Perftrack http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.101.7063rep=rep1type=pdf regards 3dmashUp On

Re: [HACKERS] Performance bug in DO blocks

2011-03-27 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Tue, Jan 18, 2011 at 1:46 PM, Tom Lane t...@sss.pgh.pa.us wrote: I just noticed that if you execute the same DO command over and over within a session, it gets slower and slower.  And if you keep it up you'll notice the backend's RAM consumption

Re: [HACKERS] Needs Suggestion

2011-03-27 Thread Gurjeet Singh
On Sun, Mar 27, 2011 at 9:22 AM, SUBHAM ROY subham@gmail.com wrote: Hi, I am currently a student of IIT Bombay. I am doing a project on Benchmark design. For that I need to measure the performance of various queries in databases. I want to know how can we measure the execution time of a

Re: [HACKERS] WIP: Allow SQL-language functions to reference parameters by parameter name

2011-03-27 Thread Pavel Stehule
2011/3/27 Andrew Dunstan and...@dunslane.net: On 03/27/2011 09:42 AM, David Fetter wrote: On Fri, Mar 25, 2011 at 09:12:33PM -0400, Robert Haas wrote: As I've said before, I believe that the root cause of this problem is that using the same syntax for variables and column names is a bad

Re: [HACKERS] Needs Suggestion

2011-03-27 Thread SUBHAM ROY
Actually, I want to run some set of queries in postgres on a HUGE data set. I have to compute the actual execution time for each of those queries. So how can I do that in Postgres ? Suppose in Oracle following thing can be done : * set timing on; select stuff from mytab; Elapsed: 00:00:02.82

Re: [HACKERS] race condition in sync rep

2011-03-27 Thread Kevin Grittner
Simon Riggs wrote: I'm surprised that a network roundtrip takes less time than the backend takes to mark clog and then queue for the SyncRepLock. I'm not surprised by that at all. Some of our replication involves Gb or faster connections on the same LAN segment (sometimes on the same

Re: [HACKERS] WIP: Allow SQL-language functions to reference parameters by parameter name

2011-03-27 Thread Martijn van Oosterhout
On Sun, Mar 27, 2011 at 06:52:03PM +0200, Pavel Stehule wrote: Syntax for named parameters should be consistent with prepared statement. Is there any comments in standard? Well, there's section 4.24 which says: In SQL-statements that are executed dynamically, the parameters are called dynamic

Re: [HACKERS] Needs Suggestion

2011-03-27 Thread Gurjeet Singh
In these (Postgres) mailing lists, top-posting is not preferred. See my response below. On Sun, Mar 27, 2011 at 1:01 PM, SUBHAM ROY subham@gmail.com wrote: On Sun, Mar 27, 2011 at 10:20 PM, Gurjeet Singh singh.gurj...@gmail.comwrote: On Sun, Mar 27, 2011 at 9:22 AM, SUBHAM ROY

Re: [HACKERS] Lock problem with autovacuum truncating heap

2011-03-27 Thread Simon Riggs
On Sun, Mar 27, 2011 at 2:13 PM, Robert Haas robertmh...@gmail.com wrote: On Mar 26, 2011, at 4:16 PM, Jan Wieck janwi...@yahoo.com wrote: That was what I meant. Go in steps of 16-64MB backwards and scan from there to the current end in forward direction to find a nondeletable block. In

Re: [HACKERS] WIP: Allow SQL-language functions to reference parameters by parameter name

2011-03-27 Thread Pavel Stehule
2011/3/27 Martijn van Oosterhout klep...@svana.org: On Sun, Mar 27, 2011 at 06:52:03PM +0200, Pavel Stehule wrote: Syntax for named parameters should be consistent with prepared statement. Is there any comments in standard? Well, there's section 4.24 which says: In SQL-statements that are

Re: [HACKERS] race condition in sync rep

2011-03-27 Thread Simon Riggs
On Sun, Mar 27, 2011 at 6:07 PM, Kevin Grittner kevin.gritt...@wicourts.gov wrote: Simon Riggs  wrote: I'm surprised that a network roundtrip takes less time than the backend takes to mark clog and then queue for the SyncRepLock. I'm not surprised by that at all.  Some of our replication

[HACKERS] Re: [HACKERS] Needs Suggestion

2011-03-27 Thread Tomáš Pospíšil
You could use this in psql. Don't know how precise is it, but is enought for initial testing. postgres=# \timing Timing is on. postgres=# create index dx on diplomka using gist(data); CREATE INDEX Time: 236752.569 ms Původní zpráva Od: SUBHAM ROY

Re: [HACKERS] Open issues for collations

2011-03-27 Thread Tom Lane
Martijn van Oosterhout klep...@svana.org writes: On Sat, Mar 26, 2011 at 12:36:43AM -0400, Tom Lane wrote: ** Selecting a field from a record-returning function's output. Currently, we'll use the field's declared collation; except that if the field has default collation, we'll replace that

Re: [HACKERS] Performance Farm Release

2011-03-27 Thread Greg Smith
I just dusted off this code and brought it back to current again. Basically a lot of reformatting the new performance farm parts to minimize their diff. Once that was done, all of the other buildfarm client updates since then applied cleanly. The result is now sitting as a fork of Andrew's

Re: [HACKERS] Lock problem with autovacuum truncating heap

2011-03-27 Thread Jan Wieck
On 3/27/2011 1:24 PM, Simon Riggs wrote: So we should truncate in 16MB chunks also. On a second though, fiddling with the scan direction is probably too much of a change for back releases anyway. That 8.3/8.4 can get into a situation, where autovacuum causes a 12 minute freeze of a

Re: [HACKERS] SSI bug?

2011-03-27 Thread Kevin Grittner
Robert Haas wrote: I don't see much advantage in changing these to asserts - in a debug build, that will promote ERROR to PANIC; whereas in a production build, they'll cause a random failure somewhere downstream. The reason Assert is appropriate is that it is *impossible* to hit that

Re: [HACKERS] SSI bug?

2011-03-27 Thread Kevin Grittner
Tom Lane wrote: There might perhaps be some value in adding a warning like this if it were enabled per-table (and not enabled by default). It only fires where a maximum has been declared and is exceeded. Most HTABs don't declare a maximum -- they leave it at zero. These are ignored.

Re: [HACKERS] Libpq PGRES_COPY_BOTH - version compatibility

2011-03-27 Thread Magnus Hagander
On Sun, Mar 27, 2011 at 04:02, Simon Riggs si...@2ndquadrant.com wrote: On Sun, Mar 27, 2011 at 4:09 AM, Robert Haas robertmh...@gmail.com wrote: On Mon, Jan 3, 2011 at 6:55 AM, Magnus Hagander mag...@hagander.net wrote: ISTM that the correct fix is to increment to protocol version number to

Re: [HACKERS] SSI bug?

2011-03-27 Thread Kevin Grittner
YAMAMOTO Takashi wrote: Kevin Grittner wrote: (1) Could you post the non-default configuration settings? none. it can happen with just initdb+createdb'ed database. (2) How many connections are in use in your testing? 4. (3) Can you give a rough categorization of how many of what

Re: [HACKERS] Performance Farm Release

2011-03-27 Thread Robert Haas
On Mar 27, 2011, at 3:20 PM, Greg Smith g...@2ndquadrant.com wrote: I just dusted off this code and brought it back to current again. Basically a lot of reformatting the new performance farm parts to minimize their diff. Once that was done, all of the other buildfarm client updates since

Re: [HACKERS] Libpq PGRES_COPY_BOTH - version compatibility

2011-03-27 Thread Simon Riggs
On Sun, Mar 27, 2011 at 9:09 PM, Magnus Hagander mag...@hagander.net wrote: On Sun, Mar 27, 2011 at 04:02, Simon Riggs si...@2ndquadrant.com wrote: On Sun, Mar 27, 2011 at 4:09 AM, Robert Haas robertmh...@gmail.com wrote: On Mon, Jan 3, 2011 at 6:55 AM, Magnus Hagander mag...@hagander.net

Re: [HACKERS] Libpq PGRES_COPY_BOTH - version compatibility

2011-03-27 Thread Robert Haas
On Mar 27, 2011, at 4:09 PM, Magnus Hagander mag...@hagander.net wrote: That doesn't mean we shouldn't do this (haven't reconsidered the whole thread) - but it doesn't solve the issue I originally raised. I'm somewhat inclined to just remove this from the list of open items. It doesn't seem

[HACKERS] Re: [COMMITTERS] pgsql: Fix plpgsql to release SPI plans when a function or DO block is

2011-03-27 Thread David Fetter
On Sun, Mar 27, 2011 at 04:51:13PM +, Tom Lane wrote: Fix plpgsql to release SPI plans when a function or DO block is freed. Do the other PLs we ship need similar fixes? Cheers, David. -- David Fetter da...@fetter.org http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!:

Re: [HACKERS] DO hint update?

2011-03-27 Thread Dimitri Fontaine
Tom Lane t...@sss.pgh.pa.us writes: Perhaps Use CREATE EXTENSION or CREATE LANGUAGE to load ... ? The only better phrasing I can think of would be to replace the or with then. Or… is it practical here to look at the available extensions and choose the HINT depending on whether the given

Re: [HACKERS] Open issues for collations

2011-03-27 Thread Martijn van Oosterhout
On Sun, Mar 27, 2011 at 03:14:37PM -0400, Tom Lane wrote: So the result of a cast would be the collation of the specified type/domain with state implicit. Hm. That makes sense for explicit CAST syntax, but what about a function returning a collatable type? In particular, applying this

[HACKERS] Additional options for Sync Replication

2011-03-27 Thread Simon Riggs
Proposed changes: Make synchronous_replication into an enum, so we can now also say synchronous_replication = recv, flush or apply as well as on or off. synchronous_replication = on is the same as flush Benefit: Allows 2 additional wait modes for sync rep: wait for receive and wait for apply.

Re: [HACKERS] Can I check if somebody is superuser in stored procedure?

2011-03-27 Thread David Fetter
On Sun, Mar 27, 2011 at 03:21:18PM +0200, Pavel Stehule wrote: Hello Is there some simple possibility to check a rights from stored procedure? Well, there's the catalog lookup method: SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_roles WHERE rolname=$1 AND rolsuper) Is that what you had in

Re: [HACKERS] Lock problem with autovacuum truncating heap

2011-03-27 Thread Greg Stark
On Sun, Mar 27, 2011 at 8:25 PM, Jan Wieck janwi...@yahoo.com wrote: Since we are talking about stable releases, I think just releasing and reacquiring the exclusive lock is enough. We can then try to further improve things for future releases. I like all of: 1) move the truncating to a new

Re: [HACKERS] Lock problem with autovacuum truncating heap

2011-03-27 Thread Robert Haas
On Sun, Mar 27, 2011 at 3:25 PM, Jan Wieck janwi...@yahoo.com wrote: Since we are talking about stable releases, I think just releasing and reacquiring the exclusive lock is enough. We can then try to further improve things for future releases. That seems unsafe - things can change under you

Re: [HACKERS] Additional options for Sync Replication

2011-03-27 Thread Robert Haas
On Sun, Mar 27, 2011 at 5:45 PM, Simon Riggs si...@2ndquadrant.com wrote: I was hoping to fine tune/tweak Sync Rep after feedback during beta, but my understanding of current consensus is that that will be too late to make user visible changes. So I'm proposing this change now, before Beta,

Re: [HACKERS] Additional options for Sync Replication

2011-03-27 Thread Greg Stark
On Sun, Mar 27, 2011 at 10:45 PM, Simon Riggs si...@2ndquadrant.com wrote: I was hoping to fine tune/tweak Sync Rep after feedback during beta, but my understanding of current consensus is that that will be too late to make user visible changes. So I'm proposing this change now, before Beta,

Re: [HACKERS] race condition in sync rep

2011-03-27 Thread Robert Haas
On Sun, Mar 27, 2011 at 7:46 AM, Simon Riggs si...@2ndquadrant.com wrote: Are the master and standby on same system or are they separated by a network? I'm surprised that a network roundtrip takes less time than the backend takes to mark clog and then queue for the SyncRepLock. When I first

Re: [HACKERS] [DOCS] patch for createdb section in tutorial

2011-03-27 Thread Robert Haas
On Sun, Mar 27, 2011 at 6:41 AM, Susanne Ebrecht susa...@2ndquadrant.com wrote: Hello, During translating the docs I found the following sentence in the tutorial section about createdb: Database names must have an alphabetic first character and are limited to 63 characters I wondered -

Re: [HACKERS] Lock problem with autovacuum truncating heap

2011-03-27 Thread Jan Wieck
On 3/27/2011 6:21 PM, Robert Haas wrote: On Sun, Mar 27, 2011 at 3:25 PM, Jan Wieckjanwi...@yahoo.com wrote: Since we are talking about stable releases, I think just releasing and reacquiring the exclusive lock is enough. We can then try to further improve things for future releases. That

Re: [HACKERS] Lock problem with autovacuum truncating heap

2011-03-27 Thread Robert Haas
On Sun, Mar 27, 2011 at 9:41 PM, Jan Wieck janwi...@yahoo.com wrote: On 3/27/2011 6:21 PM, Robert Haas wrote: On Sun, Mar 27, 2011 at 3:25 PM, Jan Wieckjanwi...@yahoo.com  wrote:  Since we are talking about stable releases, I think just releasing and  reacquiring the exclusive lock is

Re: [HACKERS] Lock problem with autovacuum truncating heap

2011-03-27 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Sun, Mar 27, 2011 at 3:25 PM, Jan Wieck janwi...@yahoo.com wrote: Since we are talking about stable releases, I think just releasing and reacquiring the exclusive lock is enough. We can then try to further improve things for future releases. That

Re: [HACKERS] Re: [COMMITTERS] pgsql: Fix plpgsql to release SPI plans when a function or DO block is

2011-03-27 Thread Tom Lane
David Fetter da...@fetter.org writes: On Sun, Mar 27, 2011 at 04:51:13PM +, Tom Lane wrote: Fix plpgsql to release SPI plans when a function or DO block is freed. Do the other PLs we ship need similar fixes? Offhand I think the other PLs leave management of prepared plans to the user. If

Re: [HACKERS] Lock problem with autovacuum truncating heap

2011-03-27 Thread Tom Lane
Greg Stark gsst...@mit.edu writes: I like all of: 1) move the truncating to a new transaction just like we currently do toast tables in a separate transaction from the main vacuum. +1 if we are going to continue the behavior of allowing other transactions to kick autovac off the exclusive

Re: [HACKERS] Comments on SQL/Med objects

2011-03-27 Thread Robert Haas
On Wed, Mar 23, 2011 at 12:53 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: On Tue, Mar 22, 2011 at 6:23 PM, Guillaume Lelarge guilla...@lelarge.info wrote: While working on adding support for SQL/Med objects to pgAdmin, I'm quite surprised to see there is

Re: [HACKERS] Comments on SQL/Med objects

2011-03-27 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Wed, Mar 23, 2011 at 12:53 PM, Tom Lane t...@sss.pgh.pa.us wrote: Yeah, I had a private TODO about that.  I'd like to see if we can refactor the grammar to eliminate some of the duplication there as well as the potential for oversights of this sort.

Re: [HACKERS] Comments on SQL/Med objects

2011-03-27 Thread Robert Haas
On Mon, Mar 28, 2011 at 12:06 AM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: On Wed, Mar 23, 2011 at 12:53 PM, Tom Lane t...@sss.pgh.pa.us wrote: Yeah, I had a private TODO about that.  I'd like to see if we can refactor the grammar to eliminate some of the

Re: [HACKERS] Problem with streaming replication, backups, and recovery (9.0.x)

2011-03-27 Thread Fujii Masao
On Sat, Mar 26, 2011 at 5:31 AM, hubert depesz lubaczewski dep...@depesz.com wrote: I can also setup streaming slave, and it also works, but when I create trigger file to promote this slave to master it fails with error: 2011-03-24 21:01:58.051 CET @ 9680  LOG:  trigger file found: