Re: [HACKERS] proposal - assign result of query to psql variable

2012-07-26 Thread Tom Lane
Pavel Stehule writes: > 2012/7/26 David Fetter : How about \gset var1,,,var2,var3... >>> I don't like this - you can use fake variable - and ignoring some >>> variable has no big effect on client >> Why assign to a variable you'll never use? > so why you get data from server, when you

[HACKERS] external_pid_file not removed on postmaster exit

2012-07-26 Thread Peter Eisentraut
It seems strange that the external_pid_file is never removed. There is even a C comment about it: /* Should we remove the pid file on postmaster exit? */ I think it should be removed with proc_exit hook just like the main postmaster.pid file. Does anyone remember why this was not done originall

[HACKERS] How to form a self-defined TupleTableSlot

2012-07-26 Thread Chaoyong.Wang
Hi, guys. Here is my task situation: I have a TupleTableSlot, with its own TupleDesc. Now I want to extract several attributes to form a new TupleTableSlot, how can I define my own TupleDesc and the ProjectionInfo? Best.

Re: [HACKERS] [GENERAL] Where is diskchecker.pl ?

2012-07-26 Thread Bruce Momjian
On Thu, Jul 26, 2012 at 09:11:17PM -0400, Bruce Momjian wrote: > On Thu, Jul 26, 2012 at 06:07:30PM -0700, Josh Berkus wrote: > > On 7/26/12 5:35 PM, Bruce Momjian wrote: > > > On Wed, Jul 18, 2012 at 04:11:21PM +0200, jg wrote: > > >> Hi, > > >> > > >> The PostgreSQK documentation refers to diskch

Re: [HACKERS] [GENERAL] Where is diskchecker.pl ?

2012-07-26 Thread Bruce Momjian
On Thu, Jul 26, 2012 at 06:07:30PM -0700, Josh Berkus wrote: > On 7/26/12 5:35 PM, Bruce Momjian wrote: > > On Wed, Jul 18, 2012 at 04:11:21PM +0200, jg wrote: > >> Hi, > >> > >> The PostgreSQK documentation refers to diskchecker.pl on the page > >> http://brad.livejournal.com/2116715.html > >> Bu

Re: [HACKERS] [GENERAL] Where is diskchecker.pl ?

2012-07-26 Thread Josh Berkus
On 7/26/12 5:35 PM, Bruce Momjian wrote: > On Wed, Jul 18, 2012 at 04:11:21PM +0200, jg wrote: >> Hi, >> >> The PostgreSQK documentation refers to diskchecker.pl on the page >> http://brad.livejournal.com/2116715.html >> But on this page, the given link for diskchecker.pl does not exist anymore. >

Re: [HACKERS] [GENERAL] Where is diskchecker.pl ?

2012-07-26 Thread Josh Berkus
On 7/26/12 5:35 PM, Bruce Momjian wrote: > On Wed, Jul 18, 2012 at 04:11:21PM +0200, jg wrote: >> Hi, >> >> The PostgreSQK documentation refers to diskchecker.pl on the page >> http://brad.livejournal.com/2116715.html >> But on this page, the given link for diskchecker.pl does not exist anymore. >

Re: [HACKERS] [GENERAL] Where is diskchecker.pl ?

2012-07-26 Thread Bruce Momjian
On Wed, Jul 18, 2012 at 04:11:21PM +0200, jg wrote: > Hi, > > The PostgreSQK documentation refers to diskchecker.pl on the page > http://brad.livejournal.com/2116715.html > But on this page, the given link for diskchecker.pl does not exist anymore. > After some unsuccessfull queries on Google to

Re: [HACKERS] isolation check takes a long time

2012-07-26 Thread Noah Misch
On Thu, Jul 26, 2012 at 12:16:29PM -0400, Alvaro Herrera wrote: > Excerpts from Noah Misch's message of jue jul 26 06:28:54 -0400 2012: > > var "isolation" = { "rc" => "READ COMMITTED", "rr" => "REPEATABLE READ" > > } > > Agreed. What would be the syntax to specify a particular value to use

Re: [HACKERS] Using pg_upgrade on log-shipping standby servers

2012-07-26 Thread Bruce Momjian
On Thu, Jul 26, 2012 at 02:26:16PM -0700, Jeff Davis wrote: > On Thu, 2012-07-26 at 14:17 -0400, Bruce Momjian wrote: > > Yes, that would be a problem because the WAL records are deleted by > > pg_upgrade. Does a shutdown of the standby not already replay all WAL > > logs? > > There is no notion

Re: [HACKERS] Using pg_upgrade on log-shipping standby servers

2012-07-26 Thread Bruce Momjian
On Thu, Jul 26, 2012 at 02:17:22PM -0400, Bruce Momjian wrote: > > > Is that sufficient? > > > > Well, at the very least, you need to guarantee that the standby is > > caught up - i.e. that it replayed all the WAL records that were > > generated on the master before it was shut down for the final

Re: [HACKERS] Using pg_upgrade on log-shipping standby servers

2012-07-26 Thread Daniel Farina
On Thu, Jul 26, 2012 at 3:01 PM, Daniel Farina wrote: > For example: suppose pg_upgrade emitted full-page-write records in the > format of the new postgres version on an unoccupied timeline. One can > use PG.next tools to report on the first txid and by txid I meant WAL position, which mucks it

Re: [HACKERS] Using pg_upgrade on log-shipping standby servers

2012-07-26 Thread Daniel Farina
On Thu, Jul 26, 2012 at 2:26 PM, Jeff Davis wrote: >> I was originally thinking that we would require users to run pg_upgrade >> on the standby, where you need to first switch into master mode. > > That sounds a little strange to me. If the original master has generated > WAL that the original sta

Re: [HACKERS] Using pg_upgrade on log-shipping standby servers

2012-07-26 Thread Jeff Davis
On Thu, 2012-07-26 at 14:17 -0400, Bruce Momjian wrote: > Yes, that would be a problem because the WAL records are deleted by > pg_upgrade. Does a shutdown of the standby not already replay all WAL > logs? There is no notion of "all WAL logs" because the WAL is infinite. Do you mean "all WAL gen

Re: [HACKERS] Using pg_upgrade on log-shipping standby servers

2012-07-26 Thread Bruce Momjian
On Thu, Jul 26, 2012 at 01:24:19PM -0400, Robert Haas wrote: > On Thu, Jul 26, 2012 at 12:06 PM, Bruce Momjian wrote: > > I don't see the "don't modify the user files" behavior changing anytime > > soon, and it is documented, so I feel pretty confident that those files > > were not modified on the

Re: [HACKERS] Covering Indexes

2012-07-26 Thread Merlin Moncure
On Thu, Jul 26, 2012 at 12:17 PM, Robert Haas wrote: >> I think so. The case where you want a wide multiple column primary >> key to be extended to cover that one extra commonly grabbed value is >> not super common but entirely plausible. With the existing >> infrastructure to get the advantages

Re: [HACKERS] Using pg_upgrade on log-shipping standby servers

2012-07-26 Thread Robert Haas
On Thu, Jul 26, 2012 at 12:06 PM, Bruce Momjian wrote: > I don't see the "don't modify the user files" behavior changing anytime > soon, and it is documented, so I feel pretty confident that those files > were not modified on the primary or standby cluster, and are hence the > same, or at least as

Re: [HACKERS] Covering Indexes

2012-07-26 Thread Robert Haas
On Thu, Jul 26, 2012 at 12:25 PM, Merlin Moncure wrote: > On Thu, Jul 26, 2012 at 11:13 AM, Bruce Momjian wrote: >> On Tue, Jul 17, 2012 at 06:00:37PM +0100, Simon Riggs wrote: >>> > Either way the data in "c" and "d" are IN THE INDEX otherwise in neither >>> > case could the data values be retur

Re: [HACKERS] Covering Indexes

2012-07-26 Thread Merlin Moncure
On Thu, Jul 26, 2012 at 11:13 AM, Bruce Momjian wrote: > On Tue, Jul 17, 2012 at 06:00:37PM +0100, Simon Riggs wrote: >> > Either way the data in "c" and "d" are IN THE INDEX otherwise in neither >> > case could the data values be returned while strictly querying the index. >> > >> > So the questi

Re: [HACKERS] isolation check takes a long time

2012-07-26 Thread Alvaro Herrera
Excerpts from Noah Misch's message of jue jul 26 06:28:54 -0400 2012: > > On Tue, Jul 24, 2012 at 11:08:09AM -0400, Alvaro Herrera wrote: > > I would expect that if no permutations are specified, all possible > > values for a certain setting would be generated. That way it'd be easy > > to defi

Re: [HACKERS] Covering Indexes

2012-07-26 Thread Bruce Momjian
On Tue, Jul 17, 2012 at 06:00:37PM +0100, Simon Riggs wrote: > > Either way the data in "c" and "d" are IN THE INDEX otherwise in neither > > case could the data values be returned while strictly querying the index. > > > > So the question that needs to be asked is what kind of performance increase

Re: [HACKERS] Using pg_upgrade on log-shipping standby servers

2012-07-26 Thread Bruce Momjian
On Thu, Jul 26, 2012 at 11:03:15AM -0400, Robert Haas wrote: > >> IMV, pg_upgrade is not yet sufficiently reliable that we should be > >> looking for new projects that seem certain to make it less reliable. > > > > The script has to make the primary/standby identical, and guarantee > > that. That

Re: [HACKERS] Using pg_upgrade on log-shipping standby servers

2012-07-26 Thread Robert Haas
On Thu, Jul 26, 2012 at 10:40 AM, Bruce Momjian wrote: > On Thu, Jul 26, 2012 at 10:26:53AM -0400, Robert Haas wrote: >> > Well, then that would call for another list of files. >> >> I cannot escape the feeling that if we go down this route in any form >> we're going to spend years tracking down d

Re: [HACKERS] Using pg_upgrade on log-shipping standby servers

2012-07-26 Thread Bruce Momjian
On Thu, Jul 26, 2012 at 10:26:53AM -0400, Robert Haas wrote: > > Well, then that would call for another list of files. > > I cannot escape the feeling that if we go down this route in any form > we're going to spend years tracking down data-loss-inducing bugs. The > ones we have on the master are

Re: [HACKERS] Using pg_upgrade on log-shipping standby servers

2012-07-26 Thread Bruce Momjian
On Thu, Jul 26, 2012 at 04:59:46PM +0300, Peter Eisentraut wrote: > On tor, 2012-07-26 at 08:30 -0400, Bruce Momjian wrote: > > On Mon, Jul 23, 2012 at 11:11:27PM +0300, Peter Eisentraut wrote: > > > On mån, 2012-07-23 at 10:08 -0400, Robert Haas wrote: > > > > Relying on the number of hard links s

Re: [HACKERS] Using pg_upgrade on log-shipping standby servers

2012-07-26 Thread Andrew Dunstan
On 07/26/2012 09:59 AM, Peter Eisentraut wrote: I think I could create a list and pass that into a loop so only the command has to be modified, but again, how do we do that on Windows? Can we create a shell function in Windows and pass the file name as an argument? I don't know, but I assume th

Re: [HACKERS] Using pg_upgrade on log-shipping standby servers

2012-07-26 Thread Robert Haas
On Thu, Jul 26, 2012 at 9:59 AM, Peter Eisentraut wrote: >> I think I could create a list and pass that into a loop so only >> the command has to be modified, but again, how do we do that on Windows? >> Can we create a shell function in Windows and pass the file name as an >> argument? > > I don't

Re: [HACKERS] filenames in pg_basebackup

2012-07-26 Thread Robert Haas
On Thu, Jul 26, 2012 at 10:15 AM, Fujii Masao wrote: > On Thu, Jul 26, 2012 at 12:58 PM, Alvaro Herrera > wrote: >> >> Excerpts from Alvaro Herrera's message of mié jul 25 18:23:46 -0400 2012: >>> Excerpts from Tom Lane's message of mié jul 25 16:25:36 -0400 2012: >>> > Alvaro Herrera writes: >>

Re: [HACKERS] Tab completion for INHERIT and NO INHERIT

2012-07-26 Thread Robert Haas
On Mon, Jul 23, 2012 at 9:22 PM, Jeff Janes wrote: > I was playing around with partitioning recently, and was annoyed that > tab completion doesn't work for setting the table to (dis)inherit. Thanks for the patch. Committed. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterpri

Re: [HACKERS] filenames in pg_basebackup

2012-07-26 Thread Fujii Masao
On Thu, Jul 26, 2012 at 12:58 PM, Alvaro Herrera wrote: > > Excerpts from Alvaro Herrera's message of mié jul 25 18:23:46 -0400 2012: >> Excerpts from Tom Lane's message of mié jul 25 16:25:36 -0400 2012: >> > Alvaro Herrera writes: >> >> > > Apparently, this needs a thorough revision ... >> > >>

Re: [HACKERS] Using pg_upgrade on log-shipping standby servers

2012-07-26 Thread Peter Eisentraut
On tor, 2012-07-26 at 08:30 -0400, Bruce Momjian wrote: > On Mon, Jul 23, 2012 at 11:11:27PM +0300, Peter Eisentraut wrote: > > On mån, 2012-07-23 at 10:08 -0400, Robert Haas wrote: > > > Relying on the number of hard links seems very fragile. For example, > > > it'll break if you are using copy m

Re: [HACKERS] Using pg_upgrade on log-shipping standby servers

2012-07-26 Thread Bruce Momjian
On Thu, Jul 26, 2012 at 08:30:40AM -0400, Bruce Momjian wrote: > On Mon, Jul 23, 2012 at 11:11:27PM +0300, Peter Eisentraut wrote: > > On mån, 2012-07-23 at 10:08 -0400, Robert Haas wrote: > > > Relying on the number of hard links seems very fragile. For example, > > > it'll break if you are using

Re: [HACKERS] Using pg_upgrade on log-shipping standby servers

2012-07-26 Thread Bruce Momjian
On Mon, Jul 23, 2012 at 11:11:27PM +0300, Peter Eisentraut wrote: > On mån, 2012-07-23 at 10:08 -0400, Robert Haas wrote: > > Relying on the number of hard links seems very fragile. For example, > > it'll break if you are using copy mode. And it won't work on Windows, > > either. > > pg_upgrade

Re: [HACKERS] isolation check takes a long time

2012-07-26 Thread Noah Misch
On Tue, Jul 24, 2012 at 11:08:09AM -0400, Alvaro Herrera wrote: > Excerpts from Noah Misch's message of dom jul 22 17:11:53 -0400 2012: > > setting "i-rc" "isolation" = "READ COMMITTED" > > setting "i-rr" "isolation" = "REPEATABLE READ" > > > > session "s1" > > setup{ BEGIN

Re: [HACKERS] Re: [BUGS] BUG #6733: All Tables Empty After pg_upgrade (PG 9.2.0 beta 2)

2012-07-26 Thread Bruce Momjian
On Wed, Jul 25, 2012 at 04:40:14PM -0400, Bruce Momjian wrote: > On Wed, Jul 25, 2012 at 04:30:10PM -0400, Tom Lane wrote: > > Bruce Momjian writes: > > > Tom suggested that load_directory() return a (char *) array, rather than > > > a struct dirent array, greatly simplifying the code. > > > I hav