Re: [HACKERS] Hot Backup with rsync fails at pg_clog if under load

2011-10-15 Thread Chris Redekop
> > Linas, could you capture the output of pg_controldata *and* increase the > > log level to DEBUG1 on the standby? We should then see nextXid value of > > the checkpoint the recovery is starting from. > > I'll try to do that whenever I'm in that territory again... Incidentally, > recently there w

[HACKERS] plpython SPI cursors

2011-10-15 Thread Jan Urbański
Hi, attached is a patch implementing the usage of SPI cursors in PL/Python. Currently when trying to process a large table in PL/Python you have slurp it all into memory (that's what plpy.execute does). This patch allows reading the result set in smaller chunks, using a SPI cursor behind the scen

Re: [HACKERS] COUNT(*) and index-only scans

2011-10-15 Thread Jeff Janes
On Mon, Oct 10, 2011 at 9:48 PM, Kevin Grittner wrote: >> Jeff Janes  wrote: >> Kevin Grittner  wrote: > >>> create table t (id int not null primary key); >>> insert into t select generate_series(1, 100); >>> vacuum freeze analyze; >>> explain analyze select count(*) from t >>> where id betwee

Re: [HACKERS] Pushing ScalarArrayOpExpr support into the btree index AM

2011-10-15 Thread Noah Misch
On Sat, Oct 15, 2011 at 02:58:45PM -0400, Tom Lane wrote: > [algorithm for a regular index scan satisfying "key IN (...)"] > So, at least as far as btrees are concerned, it seems like I implemented > the ScalarArrayOpExpr logic at the wrong level and it ought to be pushed > down into the index AM.

Re: [HACKERS] index-only scans

2011-10-15 Thread Jeff Janes
On Sat, Oct 15, 2011 at 2:16 PM, Jeff Janes wrote: > On Fri, Oct 7, 2011 at 11:40 AM, Tom Lane wrote: >> Robert Haas writes: >>> Please find attached a patch implementing a basic version of >>> index-only scans. >> >> I'm making some progress with this, but I notice what seems like a >> missing

Re: [HACKERS] Pushing ScalarArrayOpExpr support into the btree index AM

2011-10-15 Thread Robert Haas
On Sat, Oct 15, 2011 at 2:58 PM, Tom Lane wrote: > In principle somebody could be doing something like >        WHERE pointcol <@ ANY (ARRAY[list of box values]) > and expecting that to generate a bitmap indexscan on a GIST index, but > is it likely that anyone is doing that?  (As opposed to the e

Re: [HACKERS] index-only scans

2011-10-15 Thread Jeff Janes
On Fri, Oct 7, 2011 at 11:40 AM, Tom Lane wrote: > Robert Haas writes: >> Please find attached a patch implementing a basic version of >> index-only scans. > > I'm making some progress with this, but I notice what seems like a > missing feature: there needs to be a way to turn it off.  Otherwise

Re: [HACKERS] Call stacks and RAISE INFO

2011-10-15 Thread Josh Berkus
> No, I don't think so. The use-case for this sort of thing seems to me > to be messages that are directed to the user or DBA, and don't want to > be decorated with a lot of information about where they came from. > That determination is usually pretty clear when you write the code. For my case,

[HACKERS] Pushing ScalarArrayOpExpr support into the btree index AM

2011-10-15 Thread Tom Lane
Almost immediately after we committed index-only scans, there were complaints that it didn't work with "indexkey IN (...)" conditions, that is ScalarArrayOpExpr index quals. That's because the current code only supports ScalarArrayOpExpr as a bitmap indexscan qual, not a regular indexscan. The ex

Re: [HACKERS] Call stacks and RAISE INFO

2011-10-15 Thread Pavel Stehule
2011/10/15 Tom Lane : > Pavel Stehule writes: >> 2011/10/15 Robert Haas : >>> On Sat, Oct 15, 2011 at 12:24 AM, Pavel Stehule >>> wrote: I have no problem with this.  A context can be false for info and true for other in default. Please, use a different identifier than "context",

Re: .psqlrc version dependence (was Re: [HACKERS] about EDITOR_LINENUMBER_SWITCH)

2011-10-15 Thread Bruce Momjian
Tom Lane wrote: > Peter Eisentraut writes: > > Contrary to what the subject suggests, I think the main reason people > > wanted this feature was to be able to set the linestyle to unicode > > without getting a warning from older releases about unknown linestyle or > > something. But in a few year

.psqlrc version dependence (was Re: [HACKERS] about EDITOR_LINENUMBER_SWITCH)

2011-10-15 Thread Tom Lane
Peter Eisentraut writes: > Contrary to what the subject suggests, I think the main reason people > wanted this feature was to be able to set the linestyle to unicode > without getting a warning from older releases about unknown linestyle or > something. But in a few years, they'll have to > maint

Re: [HACKERS] pg_dump vs malloc

2011-10-15 Thread Magnus Hagander
On Fri, Oct 14, 2011 at 21:11, Bruce Momjian wrote: > Magnus Hagander wrote: >> On Wed, Jun 22, 2011 at 17:48, Tom Lane wrote: >> > Magnus Hagander writes: >> >> Something along the line of this? >> > >> > I think this is a seriously, seriously bad idea: >> > >> >> +#define strdup(x) pg_strdup(x

Re: [HACKERS] WIP: collect frequency statistics for arrays

2011-10-15 Thread Alexander Korotkov
Hi! Thanks for your attention to my patch! On Sat, Oct 15, 2011 at 2:47 PM, Nathan Boley wrote: > > Looking now, I see that Alexander wasn't Cc'd on the review, so it's > > possible he missed the message? > > > > We've corresponded off list and have discussed my review at some length. > > Alex

Re: [HACKERS] Call stacks and RAISE INFO

2011-10-15 Thread Tom Lane
Pavel Stehule writes: > 2011/10/15 Robert Haas : >> On Sat, Oct 15, 2011 at 12:24 AM, Pavel Stehule >> wrote: >>> I have no problem with this.  A context can be false for info and true >>> for other in default. Please, use a different identifier than >>> "context", that can be use for reading c

Re: [HACKERS] about EDITOR_LINENUMBER_SWITCH

2011-10-15 Thread Bruce Momjian
Andrew Dunstan wrote: > > > On 10/15/2011 09:37 AM, Peter Eisentraut wrote: > > On tor, 2011-10-13 at 11:31 -0400, Bruce Momjian wrote: > >> The attached patch changes this to use the _major_ version number for > >> psql rc files. Does this have to be backward-compatible? Should I > >> check fo

Re: [HACKERS] about EDITOR_LINENUMBER_SWITCH

2011-10-15 Thread Bruce Momjian
Peter Eisentraut wrote: > On tor, 2011-10-13 at 11:31 -0400, Bruce Momjian wrote: > > The attached patch changes this to use the _major_ version number for > > psql rc files. Does this have to be backward-compatible? Should I > > check for minor and major matches? That is going to be confusing t

Re: [HACKERS] about EDITOR_LINENUMBER_SWITCH

2011-10-15 Thread Andrew Dunstan
On 10/15/2011 09:37 AM, Peter Eisentraut wrote: On tor, 2011-10-13 at 11:31 -0400, Bruce Momjian wrote: The attached patch changes this to use the _major_ version number for psql rc files. Does this have to be backward-compatible? Should I check for minor and major matches? That is going to

Re: [HACKERS] about EDITOR_LINENUMBER_SWITCH

2011-10-15 Thread Peter Eisentraut
On tor, 2011-10-13 at 11:31 -0400, Bruce Momjian wrote: > The attached patch changes this to use the _major_ version number for > psql rc files. Does this have to be backward-compatible? Should I > check for minor and major matches? That is going to be confusing to > document. Contrary to what

Re: [HACKERS] LIMITing number of results in a VIEW with global variables

2011-10-15 Thread Thomas Girault
Hello Florian, It seems dangerous for a cast to modify global state such a MU. The > evaluation > order of functions during query execute isn't always easy to guess, and may > change depending on the execution plan. I supposed that fuzzy2bool is called just before the terminal evaluation of the

Re: [HACKERS] LIMITing number of results in a VIEW with global variables

2011-10-15 Thread Thomas Girault
Hello, Thank you for your answer Robert. > Well, SQL, our our dialect of it anyway, doesn't have global > variables. So I think the above is going to throw a syntax error. > You may have global variables in your C code, but those won't be > visible from the SQL level. I was wrong in the definit

Re: [HACKERS] LIMITing number of results in a VIEW with global variables

2011-10-15 Thread Florian Pflug
On Oct14, 2011, at 16:43 , Thomas Girault wrote: > CREATE OR REPLACE FUNCTION fuzzy2bool(FLOAT) > RETURNS BOOLEAN LANGUAGE SQL AS 'SELECT set_mu($1);SELECT $1 > get_alpha()'; It seems dangerous for a cast to modify global state such a MU. The evaluation order of functions during query execute is

Re: [HACKERS] Call stacks and RAISE INFO

2011-10-15 Thread Pavel Stehule
2011/10/15 Robert Haas : > On Sat, Oct 15, 2011 at 12:24 AM, Pavel Stehule > wrote: >> I have no problem with this.  A context can be false for info and true >> for other in default. Please, use a different identifier than >> "context", that can be use for reading context in future - maybe >> "at

Re: [GENERAL][HACKERS] register creation date of table

2011-10-15 Thread Robert Haas
On Fri, Oct 14, 2011 at 6:20 AM, Willy-Bas Loos wrote: > 1. I think that there is no such information in the system tables. is > that correct? Yes. It's been discussed before but some people (particularly, Tom, IIRC) are not convinced that it's useful enough to justify its existence. > 2. i wou

Re: [HACKERS] Call stacks and RAISE INFO

2011-10-15 Thread Robert Haas
On Sat, Oct 15, 2011 at 12:24 AM, Pavel Stehule wrote: > I have no problem with this.  A context can be false for info and true > for other in default. Please, use a different identifier than > "context", that can be use for reading context in future - maybe > "attach_context" or some similar. er

Re: [HACKERS] LIMITing number of results in a VIEW with global variables

2011-10-15 Thread Robert Haas
On Fri, Oct 14, 2011 at 10:43 AM, Thomas Girault wrote: > I am now trying to limit the number of results in the view according > to the global value K : > > CREATE OR REPLACE VIEW filtered_employees AS >    SELECT *, get_mu() as mu >    FROM employees >    ORDER BY mu DESC >    LIMIT K; Well, SQL

Re: [HACKERS] WIP: collect frequency statistics for arrays

2011-10-15 Thread Nathan Boley
> Looking now, I see that Alexander wasn't Cc'd on the review, so it's > possible he missed the message? > We've corresponded off list and have discussed my review at some length. Alex submitted an updated patch on Sep 22 to me personally ( although not to the list? Alex? ), with the promise of a

Re: [HACKERS] Bug in walsender when calling out to do_pg_stop_backup (and others?)

2011-10-15 Thread Florian Pflug
On Oct11, 2011, at 09:21 , Magnus Hagander wrote: > On Tue, Oct 11, 2011 at 03:29, Florian Pflug wrote: >> On Oct10, 2011, at 21:25 , Magnus Hagander wrote: >>> On Thu, Oct 6, 2011 at 23:46, Florian Pflug wrote: It'd be nice to generally terminate a backend if the client vanishes, but