Re: [HACKERS] SQL/MED estimated time of arrival?

2010-11-06 Thread Hitoshi Harada
2010/11/5 Shigeru HANADA han...@metrosystems.co.jp: On Fri, 5 Nov 2010 16:27:49 +0900 Itagaki Takahiro itagaki.takah...@gmail.com wrote: PL/Proxy has a similar functionality with RUN ON ALL to start queries in parallel. So, I think it's a infrastructure commonly required. I noticed the lack

Re: [HACKERS] Make versus effective stack limit in regression tests

2010-11-06 Thread Heikki Linnakangas
On 06.11.2010 00:39, Tom Lane wrote: Andrew Dunstanand...@dunslane.net writes: On 11/05/2010 05:45 PM, Tom Lane wrote: Anyway, what this points up is that we are making a very conservative assumption about what to do when getrlimit() returns RLIM_INFINITY. It does not seem real reasonable to

[HACKERS] Protecting against unexpected zero-pages: proposal

2010-11-06 Thread Gurjeet Singh
A customer of ours is quite bothered about finding zero pages in an index after a system crash. The task now is to improve the diagnosability of such an issue and be able to definitively point to the source of zero pages. The proposed solution below has been vetted in-house at EnterpriseDB and am

Re: [HACKERS] temporary functions (and other object types)

2010-11-06 Thread Martijn van Oosterhout
On Fri, Nov 05, 2010 at 09:01:50PM -0400, Robert Haas wrote: On Fri, Nov 5, 2010 at 4:02 PM, Tom Lane t...@sss.pgh.pa.us wrote: The latter is an intentional security feature and will not get changed. I see that there could be a problem here with SECURITY DEFINER functions, but I'm not clear

Re: [HACKERS] improved parallel make support

2010-11-06 Thread Peter Eisentraut
On ons, 2010-11-03 at 16:34 +0200, Peter Eisentraut wrote: On tis, 2010-11-02 at 10:21 -0400, Tom Lane wrote: Do we have a handle on how many buildfarm members this will break? I suppose we don't. One way to find out would be to commit just this bit +# We need the $(eval) function,

Re: [HACKERS] How can we tell how far behind the standby is?

2010-11-06 Thread Brendan Jurd
On 6 November 2010 05:46, Josh Berkus j...@agliodbs.com wrote: I'm continuing in my efforts now to document how to deploy and manage replication on our wiki.  One of the things a DBA needs to do is to use pg_current_xlog_location() (and related functions) to check how far behind the master the

Re: [HACKERS] Fix for seg picksplit function

2010-11-06 Thread Alexander Korotkov
Do you think now patch is ready for committer or it require further review by you or somebody else? With best regards, Alexander Korotkov.

[HACKERS] SQL functions that can be inlined

2010-11-06 Thread Jim Nasby
Is there any way to have the database tell you if a particular SQL function can be inlined? -- Jim C. Nasby, Database Architect j...@nasby.net 512.569.9461 (cell) http://jim.nasby.net -- Sent via pgsql-hackers mailing list

Re: [HACKERS] Fix for seg picksplit function

2010-11-06 Thread Yeb Havinga
Alexander Korotkov wrote: Do you think now patch is ready for committer or it require further review by you or somebody else? It's probably ready for committer, however the code now doesn't mention any reference or bit of information that it is faster than the original one. I was wondering how

Re: [HACKERS] SQL/MED estimated time of arrival?

2010-11-06 Thread Tom Lane
Hitoshi Harada umi.tan...@gmail.com writes: And if we really make this async query come true, I suggest designing resource (i.e. remote connection) management very carefully. When the executor fails in the middle of its execution, it possibly fails to release its own resource; close() in

[HACKERS] PL/pgSQL and shared_preload_libraries

2010-11-06 Thread Bruce Momjian
Since we now install PL/pgSQL by default, should we configure shared_preload_libraries to preload PL/pgSQL? -- Bruce Momjian br...@momjian.ushttp://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. + -- Sent

Re: [HACKERS] temporary functions (and other object types)

2010-11-06 Thread Tom Lane
Martijn van Oosterhout klep...@svana.org writes: On Fri, Nov 05, 2010 at 09:01:50PM -0400, Robert Haas wrote: I see that there could be a problem here with SECURITY DEFINER functions, but I'm not clear whether it goes beyond that? IIRC correctly it's because even unpriveledged users can make

Re: [HACKERS] Protecting against unexpected zero-pages: proposal

2010-11-06 Thread Tom Lane
Gurjeet Singh singh.gurj...@gmail.com writes: .) The basic idea is to have a magic number in every PageHeader before it is written to disk, and check for this magic number when performing page validity checks. Um ... and exactly how does that differ from the existing behavior? .) To avoid

Re: [HACKERS] SQL functions that can be inlined

2010-11-06 Thread Tom Lane
Jim Nasby j...@nasby.net writes: Is there any way to have the database tell you if a particular SQL function can be inlined? Easiest way is to EXPLAIN a query using it and see if it did get inlined. For example, regression=# create function foo(int) returns int as regression-# 'select $1 + 1'

Re: [HACKERS] PL/pgSQL and shared_preload_libraries

2010-11-06 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: Since we now install PL/pgSQL by default, should we configure shared_preload_libraries to preload PL/pgSQL? I don't think that follows. The fact that it's there doesn't mean everyone is using it. In any case, I've seen no evidence that says you'd get a

[HACKERS] Should we use make -k on the buildfarm?

2010-11-06 Thread Andrew Dunstan
Peter Eisentraut has suggested that we should run make -k instead of plain make for most or all of the buildfarm steps. This flag essentially instructs make to keep going rather than fail at the first error. We haven't done that for the last five or six years that the buildfarm has been

Re: [HACKERS] psycopg and two phase commit

2010-11-06 Thread Daniele Varrazzo
On Fri, Nov 5, 2010 at 5:16 AM, Pavel Stehule pavel.steh...@gmail.com wrote: 2010/11/4 Daniele Varrazzo daniele.varra...@gmail.com: Just wanted to warn you that I have implemented the 2pc protocol in psycopg. I read a notice, but I didn't find a link for download, where is it, please? We

Re: [HACKERS] Simplifying replication

2010-11-06 Thread Dimitri Fontaine
Hannu Krosing ha...@2ndquadrant.com writes: To make pg_basebackup.py self-sufficient it should also open 2nd connection to the same master and make sure that all WAL files are copied for the duration of base copy. Excellent idea, will make that happen soon'ish. Regards, -- Dimitri Fontaine

Re: [HACKERS] Should we use make -k on the buildfarm?

2010-11-06 Thread Tom Lane
Andrew Dunstan and...@dunslane.net writes: Peter Eisentraut has suggested that we should run make -k instead of plain make for most or all of the buildfarm steps. This flag essentially instructs make to keep going rather than fail at the first error. We haven't done that for the last five

Re: [HACKERS] temporary functions (and other object types)

2010-11-06 Thread Robert Haas
On Sat, Nov 6, 2010 at 11:36 AM, Tom Lane t...@sss.pgh.pa.us wrote: Martijn van Oosterhout klep...@svana.org writes: On Fri, Nov 05, 2010 at 09:01:50PM -0400, Robert Haas wrote: I see that there could be a problem here with SECURITY DEFINER functions, but I'm not clear whether it goes beyond

Re: [HACKERS] Query Plan Columns

2010-11-06 Thread David Fetter
On Fri, Nov 05, 2010 at 01:39:07PM -0700, Josh Berkus wrote: Of course, there are containers too, which are not in your list at all. How do you intend to represent the tree-ish structure in a flat table? Andrew: we'll use a proximity tree. Adjacency list? If so, in my experience, it's

[HACKERS] IA64 versus effective stack limit

2010-11-06 Thread Tom Lane
Sergey was kind enough to lend me use of buildfarm member dugong (IA64, Debian Etch) so I could poke into why its behavior in the recursion-related regression tests was so odd. I had previously tried and failed to reproduce the behavior on a Red Hat IA64 test machine (running RHEL of course) so I

Re: [HACKERS] temporary functions (and other object types)

2010-11-06 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Sat, Nov 6, 2010 at 11:36 AM, Tom Lane t...@sss.pgh.pa.us wrote: Yeah, we changed that behavior as part of the fix for CVE-2007-2138. You'd need either SECURITY DEFINER functions or very careless use of SET ROLE/SET SESSION AUTHORIZATION for the

Re: [HACKERS] Simplifying replication

2010-11-06 Thread Hannu Krosing
On Sat, 2010-11-06 at 18:02 +0100, Dimitri Fontaine wrote: Hannu Krosing ha...@2ndquadrant.com writes: To make pg_basebackup.py self-sufficient it should also open 2nd connection to the same master and make sure that all WAL files are copied for the duration of base copy. Excellent idea,

Re: [HACKERS] Query Plan Columns

2010-11-06 Thread David E. Wheeler
On Nov 5, 2010, at 1:42 PM, David E. Wheeler wrote: http://git.postgresql.org/gitweb?p=postgresql.git;a=blob;f=src/backend/commands/explain.c;h=f494ec98e510c23120e072bd5ee8821ea12738a4;hb=HEAD#l617 Ah, great, thanks. So based on this, I've come up with: Node Type TEXT,

Re: [HACKERS] Should we use make -k on the buildfarm?

2010-11-06 Thread Andrew Dunstan
On 11/06/2010 01:07 PM, Tom Lane wrote: What I *have* occasionally wished for is that the buildfarm script would act more like make -k with respect to the various test stages. That is, not abandon the whole test after one stage fails, but allow stages that don't logically depend on the failed

Re: [HACKERS] Should we use make -k on the buildfarm?

2010-11-06 Thread Tom Lane
Andrew Dunstan and...@dunslane.net writes: On 11/06/2010 01:07 PM, Tom Lane wrote: What I *have* occasionally wished for is that the buildfarm script would act more like make -k with respect to the various test stages. I'm not sure that would be a great advance. Certainly, right now I'm

[HACKERS] knngist questions

2010-11-06 Thread Robert Haas
I'm gradually slogging my way through the KNNGIST patches which were posted here: http://archives.postgresql.org/pgsql-hackers/2010-07/msg01183.php I have a couple of conceptual questions. 1. Is KNNGIST intended to work if there's more than one pathkey? If so, how? Example: SELECT * FROM tab

Re: [HACKERS] temporary functions (and other object types)

2010-11-06 Thread Robert Haas
On Sat, Nov 6, 2010 at 1:43 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: On Sat, Nov 6, 2010 at 11:36 AM, Tom Lane t...@sss.pgh.pa.us wrote: Yeah, we changed that behavior as part of the fix for CVE-2007-2138. You'd need either SECURITY DEFINER functions or

Re: [HACKERS] temporary functions (and other object types)

2010-11-06 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: I guess. If you search pg_temp always then it's pretty much impossible to avoid having a security hole, if you use any non-trivial SQL. But if you search pg_temp for non-SD only then you'll only have a security hole if you assume (presumably without

Re: [HACKERS] IA64 versus effective stack limit

2010-11-06 Thread Greg Stark
On Sat, Nov 6, 2010 at 5:34 PM, Tom Lane t...@sss.pgh.pa.us wrote: As I said above, I don't know of any good way to measure register stack depth directly.  It's probably possible to find out by asking the kernel or something like that, but we surely do not want to introduce a kernel call into

Re: [HACKERS] IA64 versus effective stack limit

2010-11-06 Thread Tom Lane
Greg Stark gsst...@mit.edu writes: On Sat, Nov 6, 2010 at 5:34 PM, Tom Lane t...@sss.pgh.pa.us wrote: As I said above, I don't know of any good way to measure register stack depth directly.  It's probably possible to find out by asking the kernel or something like that, but we surely do not

Re: [HACKERS] IA64 versus effective stack limit

2010-11-06 Thread Tom Lane
Greg Stark gsst...@mit.edu writes: It seems more likely it would be some kind of asm than a trap. I seem to be getting plausible results from this bit of crockery: #include asm/ia64regs.h static __inline__ void * get_bsp(void) { void *ret; #ifndef __INTEL_COMPILER __asm__ __volatile__(

Re: [HACKERS] Query Plan Columns

2010-11-06 Thread David E. Wheeler
On Nov 6, 2010, at 11:44 AM, David E. Wheeler wrote: On Nov 5, 2010, at 1:42 PM, David E. Wheeler wrote: http://git.postgresql.org/gitweb?p=postgresql.git;a=blob;f=src/backend/commands/explain.c;h=f494ec98e510c23120e072bd5ee8821ea12738a4;hb=HEAD#l617 Ah, great, thanks. So based on this,

Re: [HACKERS] Simplifying replication

2010-11-06 Thread Dimitri Fontaine
Hannu Krosing ha...@2ndquadrant.com writes: To make pg_basebackup.py self-sufficient it should also open 2nd connection to the same master and make sure that all WAL files are copied for the duration of base copy. Done now, please have a look and try it if possible:

Re: [HACKERS] sorted writes for checkpoints

2010-11-06 Thread Jeff Janes
On Fri, Oct 29, 2010 at 6:17 AM, Robert Haas robertmh...@gmail.com wrote: On Fri, Oct 29, 2010 at 2:58 AM, Itagaki Takahiro itagaki.takah...@gmail.com wrote: On Fri, Oct 29, 2010 at 3:23 PM, Heikki Linnakangas heikki.linnakan...@enterprisedb.com wrote: Simon's argument in the thread that the

Re: [HACKERS] IA64 versus effective stack limit

2010-11-06 Thread Tom Lane
I wrote: I don't know why icc is so much worse than gcc on this measure of stack depth consumption, but clearly the combination of that and the 100kB max_stack_depth explains why dugong is failing to do very many levels of recursion before erroring out. I figured out why icc looked so much

Re: [HACKERS] improved parallel make support

2010-11-06 Thread Andrew Dunstan
On 11/06/2010 07:35 AM, Peter Eisentraut wrote: So far, two machines have reported an older make version: dawn_bat narwhal both of the mingw type. Andrew, Dave, could you see about upgrading the GNU make installation there? dawn_bat is done. cheers andrew -- Sent via pgsql-hackers

Re: [HACKERS] sorted writes for checkpoints

2010-11-06 Thread Robert Haas
On Sat, Nov 6, 2010 at 7:25 PM, Jeff Janes jeff.ja...@gmail.com wrote: There are really two separate things here: (1) trying to do all the writes to file A before you start doing writes to file B, and (2) trying to write out blocks to each file in ascending logical block number order I'm

Re: [HACKERS] IA64 versus effective stack limit

2010-11-06 Thread Robert Haas
On Sat, Nov 6, 2010 at 8:01 PM, Tom Lane t...@sss.pgh.pa.us wrote: I wrote: I don't know why icc is so much worse than gcc on this measure of stack depth consumption, but clearly the combination of that and the 100kB max_stack_depth explains why dugong is failing to do very many levels of

Re: [HACKERS] ALTER TABLE ... IF EXISTS feature?

2010-11-06 Thread Robert Haas
On Fri, Nov 5, 2010 at 7:49 PM, Daniel Farina drfar...@acm.org wrote: On Fri, Nov 5, 2010 at 4:20 PM, Robert Haas robertmh...@gmail.com wrote: Can you give us a self-contained example of the problem you're talking about? Sure. Consider the following: CREATE TABLE t1 (    id integer PRIMARY

Re: [HACKERS] ALTER TABLE ... IF EXISTS feature?

2010-11-06 Thread Daniel Farina
On Sat, Nov 6, 2010 at 6:09 PM, Robert Haas robertmh...@gmail.com wrote: If we're going to try to fix this, we probably ought to try to make sure that we are fixing it fairly completely.  How confident are you that this is the only problem? I haven't tried to isolate problems on really

Re: [HACKERS] Protecting against unexpected zero-pages: proposal

2010-11-06 Thread Gurjeet Singh
On Sat, Nov 6, 2010 at 11:48 PM, Tom Lane t...@sss.pgh.pa.us wrote: Gurjeet Singh singh.gurj...@gmail.com writes: .) The basic idea is to have a magic number in every PageHeader before it is written to disk, and check for this magic number when performing page validity checks. Um ...

Re: [HACKERS] Protecting against unexpected zero-pages: proposal

2010-11-06 Thread Greg Stark
On Sun, Nov 7, 2010 at 4:23 AM, Gurjeet Singh singh.gurj...@gmail.com wrote: I understand that it is a pretty low-level change, but IMHO the change is minimal and is being applied in well understood places. All the assumptions listed have been effective for quite a while, and I don't see these