Re: [HACKERS] proposal - new SPI cursor function

2007-01-03 Thread Pavel Stehule
"Pavel Stehule" <[EMAIL PROTECTED]> writes: > I need new function > SPI_cursor_fetch_with_direction(Portal portal, int direction, long count) > where is possible set direction of fetch statement. Huh? SPI_cursor_fetch already lets you specify forward or backward. re

Re: [HACKERS] costing for arbitrary path

2007-01-03 Thread Tom Lane
uwcssa <[EMAIL PROTECTED]> writes: > The problem is that each join method has some value that seems to > change value each time I cost the SAME path. There's a bug in your code; but you've not provided nearly enough detail to identify exactly what it is. regards, tom lane

Re: [HACKERS] Dead Space Map for vacuum

2007-01-03 Thread ITAGAKI Takahiro
"Jochem van Dieten" <[EMAIL PROTECTED]> wrote: > On 12/28/06, ITAGAKI Takahiro wrote: > > > > | [TODO item] Allow data to be pulled directly from indexes > > | Another idea is to maintain a bitmap of heap pages where all rows are > > | visible to all backends, and allow index lookups to reference

[HACKERS] costing for arbitrary path

2007-01-03 Thread uwcssa
I wish to estimate the total cost for a given path of a query. This path is a tree consists of nestloop, hashjoin, mergejoin as internal nodes with seqscan or idxscan at the leaves. My approach is to cost the path bottom-up, and invoke the "cost_nestloop", "cost_merge_join" etc. The problem is t

Re: [HACKERS] [PATCHES] xlog directory at initdb time

2007-01-03 Thread Bruce Momjian
Your patch has been added to the PostgreSQL unapplied patches list at: http://momjian.postgresql.org/cgi-bin/pgpatches It will be applied as soon as one of the PostgreSQL committers reviews and approves it. --- Eul

Re: [HACKERS] pg_ctl options

2007-01-03 Thread Euler Taveira de Oliveira
Andrew Dunstan wrote: > Should this be cleared up (maybe a nice first project for lurking new > contributors)?\ > Maybe. > If we don't want long forms for some reason, then a comment in the code > saying why would make sense. > I don't see a strong reason for not to do it. But if you look clo

Re: [HACKERS] [PATCHES] xlog directory at initdb time

2007-01-03 Thread Euler Taveira de Oliveira
Peter Eisentraut wrote: > On the name of the option, it's not actually a "data" directory, so I'd just > call it --xlogdir, parallel to --datadir. > Seems reasonable. Patch modified is attached. -- Euler Taveira de Oliveira http://www.timbira.com/ *** ./doc/src/sgml/ref/initdb.sgml.orig 2

Re: [HACKERS] TODO: Add a GUC to control whether BEGIN inside

2007-01-03 Thread Jaime Casanova
On 1/2/07, Tom Lane <[EMAIL PROTECTED]> wrote: Lukas Kahwe Smith <[EMAIL PROTECTED]> writes: > Err, I think you misunderstood what I said. My implementation uses > SAVEPOINTs already. The point is having some API where you do not have > to care of you are already in a transaction or not. It's no

Re: [HACKERS] TODO: Add a GUC to control whether BEGIN inside

2007-01-03 Thread Jim Nasby
On Jan 2, 2007, at 2:01 PM, Lukas Kahwe Smith wrote: Tom Lane wrote: Lukas Kahwe Smith <[EMAIL PROTECTED]> writes: Err, I think you misunderstood what I said. My implementation uses SAVEPOINTs already. The point is having some API where you do not have to care of you are already in a transac

Re: [HACKERS] effective_cache_size vs units

2007-01-03 Thread Jim Nasby
You just proved the case for why the units shouldn't be case sensitive: On Dec 30, 2006, at 6:36 PM, Andrew Hammond wrote: I agree. But perhaps the solution instead of failing is to throw a warning to the effect of "Not to be pedantic, but you said mb and millibits as a unit doesn't make sense i

Re: [HACKERS] Deadline-Based Vacuum Delay

2007-01-03 Thread Jim Nasby
On Dec 29, 2006, at 12:30 PM, Chris Browne wrote: How you get the work to spread consistently across 6 hours is a challenge; personally, my preference would generally be to try to get the work done ASAP, so the goal seems a tad off to me... Agreed. If we're going to monkey with automatically se

Re: [HACKERS] Added the word TODO in comments

2007-01-03 Thread Jim Nasby
On Jan 1, 2007, at 2:24 AM, Gurjeet Singh wrote: The comment, "This should be improved someday" sure sounds like a TODO to me. I don't know if it should make it to the TODO doc, as that lists high-level/abstract feature-request-like items. Given that the TODO list is the official compilati

[HACKERS] Problem with windows installer

2007-01-03 Thread Andreas 'ads' Scherbaum
Hello all, a friend of mine ran into a problem installing PostgreSQL 8.0.9 on a Windows XP Pro machine. Before anyone is asking: it has to be a 8.0.x version and we even tried to install 8.2 and it did not work. Ok, the problem is: after installing all the files the installer wants to init the d

Re: [HACKERS] Tuning single row operations

2007-01-03 Thread Jim Nasby
On Dec 21, 2006, at 9:56 AM, Simon Riggs wrote: On Thu, 2006-12-21 at 09:36 -0500, Matthew O'Connor wrote: Richard Huxton wrote: Simon Riggs wrote: - improve RI check perf by caching small, static tables in each backend - apply index filter conditions on index scan to avoid heap lookup For

Re: [HACKERS] WITH support

2007-01-03 Thread Jonah H. Harris
On 1/3/07, David Fetter <[EMAIL PROTECTED]> wrote: As I recall, it was decided long ago, and the conclusions were: * Only BSD-compatibly licensed code goes in PostgreSQL's code base, * PostgreSQL will only support the SQL:2003 standard WITH (RECURSIVE) syntax in the main line code. Yes, see la

Re: [HACKERS] WITH support

2007-01-03 Thread David Fetter
On Wed, Jan 03, 2007 at 04:19:19PM -0700, Jonah H. Harris wrote: > On 1/3/07, Hubert FONGARNAND <[EMAIL PROTECTED]> wrote: > >Why not looking at http://gppl.moonbone.ru/ evgen potemkin. has > >ever made a patch for WITH and CONNECT BY? > > Nope, no good. This is what I started with last time and

Re: [HACKERS] WITH support

2007-01-03 Thread Jonah H. Harris
On 1/3/07, Mark Cave-Ayland <[EMAIL PROTECTED]> wrote: IIRC there were two issues - firstly the license for the patch was GPL as opposed to BSD used for PostgreSQL Yes, however Evgen was kind enough to grant me a BSD license for it should I get it committed into PostgreSQL. However, with the a

Re: [HACKERS] WITH support

2007-01-03 Thread Jonah H. Harris
On 1/3/07, Hubert FONGARNAND <[EMAIL PROTECTED]> wrote: Why not looking at http://gppl.moonbone.ru/ evgen potemkin. has ever made a patch for WITH and CONNECT BY? Nope, no good. This is what I started with last time and the refactoring attempt at WITH is just too massive. As for CONNECT BY, P

Re: [HACKERS] proposal - new SPI cursor function

2007-01-03 Thread Tom Lane
"Pavel Stehule" <[EMAIL PROTECTED]> writes: > I need new function > SPI_cursor_fetch_with_direction(Portal portal, int direction, long count) > where is possible set direction of fetch statement. Huh? SPI_cursor_fetch already lets you specify forward or backward. regar

Re: [HACKERS] proposal - new SPI cursor function

2007-01-03 Thread Pavel Stehule
i> > > Is "int" a reasonable domain for directions? I'd think there would be > at most values. Er, "at most two." enum is better, true tree fields: FORWARD, BACKWARD, ABSOLUTE Cheers, D > > Cheers, > D > > where is possible set direction of fetch statement. > > > > > any comments? > > >

Re: [HACKERS] [PATCHES] Patch to log usage of temporary files

2007-01-03 Thread Bill Moran
In response to "Simon Riggs" <[EMAIL PROTECTED]>: > On Tue, 2007-01-02 at 18:20 -0500, Tom Lane wrote: > > Bill Moran <[EMAIL PROTECTED]> writes: > > > In response to Alvaro Herrera <[EMAIL PROTECTED]>: > > >> Please change things to save the stat() syscall when the feature is not > > >> in use. >

Re: [HACKERS] Execution Plan

2007-01-03 Thread Simon Riggs
On Wed, 2007-01-03 at 19:44 +, alfranio correia junior wrote: > I have some questions on execution plans. > > When are the following plans used ? > > nodeFunctionscan.c When there is a Set Returning Function emitting tuples. > nodeTidscan.c When there is a query that accesses data usin

Re: [HACKERS] proposal - new SPI cursor function

2007-01-03 Thread David Fetter
On Wed, Jan 03, 2007 at 12:36:27PM -0800, David Fetter wrote: > On Wed, Jan 03, 2007 at 06:30:48PM +0100, Pavel Stehule wrote: > > Hello, > > > > I am working on support scrollable cursors in plpgpsm. Scrollable cursors > > are in ToDo for plpgsql too. I need new function > > SPI_cursor_fetch_w

Re: [HACKERS] proposal - new SPI cursor function

2007-01-03 Thread David Fetter
On Wed, Jan 03, 2007 at 06:30:48PM +0100, Pavel Stehule wrote: > Hello, > > I am working on support scrollable cursors in plpgpsm. Scrollable cursors > are in ToDo for plpgsql too. I need new function > SPI_cursor_fetch_with_direction(Portal portal, int direction, long count) Is "int" a reaso

[HACKERS] Execution Plan

2007-01-03 Thread alfranio correia junior
Hi, I have some questions on execution plans. When are the following plans used ? nodeFunctionscan.c nodeTidscan.c In particular, is the plan nodeBitmapHeapscan.c always used along with the nodeBitmapIndexscan.c ? Please, let me know if there is a previous thread on this subject or any d

Re: [HACKERS] proposal - new SPI cursor function

2007-01-03 Thread Pavel Stehule
> I am working on support scrollable cursors in plpgpsm. Scrollable cursors > are in ToDo for plpgsql too. I need new function > SPI_cursor_fetch_with_direction(Portal portal, int direction, long count) > where is possible set direction of fetch statement. Sounds good. Please ensure the def

Re: [HACKERS] Operator class group proposal

2007-01-03 Thread Gregory Stark
"Tom Lane" <[EMAIL PROTECTED]> writes: > Gregory Stark <[EMAIL PROTECTED]> writes: >> Merge Join (cost=10149.78..10448.70 rows=13161 width=36) >>Merge Cond: (a.a = "inner"."?column2?") >>-> Index Scan using aa on a (cost=0.00..62.45 rows=1230 width=32) >>-> Sort (cost=100

[HACKERS] Mark/Restore and avoiding RandomAccess sorts

2007-01-03 Thread Simon Riggs
Merge Joins require us to potentially Mark and Restore positions in the tuples arriving from executor sub-nodes. This currently means that if the tuples arrive from a Sort node, as they often do in an MJ, the sort node will be instructed to prepare a random access version of the sort result. That

Re: [HACKERS] Operator class group proposal

2007-01-03 Thread Tom Lane
Gregory Stark <[EMAIL PROTECTED]> writes: > Merge Join (cost=10149.78..10448.70 rows=13161 width=36) >Merge Cond: (a.a = "inner"."?column2?") >-> Index Scan using aa on a (cost=0.00..62.45 rows=1230 width=32) >-> Sort (cost=10149.78..10155.13 rows=2140 width=4) >

Re: [HACKERS] proposal - new SPI cursor function

2007-01-03 Thread Simon Riggs
On Wed, 2007-01-03 at 18:30 +0100, Pavel Stehule wrote: > I am working on support scrollable cursors in plpgpsm. Scrollable cursors > are in ToDo for plpgsql too. I need new function > SPI_cursor_fetch_with_direction(Portal portal, int direction, long count) > where is possible set direction o

Re: [HACKERS] Operator class group proposal

2007-01-03 Thread Gregory Stark
Hope you had a nice holiday. "Tom Lane" <[EMAIL PROTECTED]> writes: > Gregory Stark <[EMAIL PROTECTED]> writes: >> So the only reason we needed the cross-data-type operators was to get better >> estimates? I thought without them you couldn't get an index-based plan at >> all. > > Oh, hm, there

[HACKERS] proposal - new SPI cursor function

2007-01-03 Thread Pavel Stehule
Hello, I am working on support scrollable cursors in plpgpsm. Scrollable cursors are in ToDo for plpgsql too. I need new function SPI_cursor_fetch_with_direction(Portal portal, int direction, long count) where is possible set direction of fetch statement. any comments? Regards Pavel Stehu

Re: [HACKERS] InitPostgres and flatfiles question

2007-01-03 Thread Markus Schiltknecht
Tom Lane wrote: It should happen automatically at commit of the CREATE DATABASE ... and you'd not be able to see the pg_database row before that anyway. So I'm not clear on what you're worried about. Okay, thanks. I'll have to investigate on why exactly I still get the error, then. That's unc

Re: [HACKERS] InitPostgres and flatfiles question

2007-01-03 Thread Tom Lane
Markus Schiltknecht <[EMAIL PROTECTED]> writes: > Most probably I better go another way, than fiddling with postgres > startup internals. Is there a way to be sure the flatfile has been > written to disk after a CREATE DATABASE? I would like to ensure I can > connect to a newly created database.

Re: [HACKERS] InitPostgres and flatfiles question

2007-01-03 Thread Markus Schiltknecht
Hello Tom, Tom Lane wrote: In what PG version? Postgres-R 8.3devel ;-) Because the postmaster doesn't have direct database access. If it did, any corruption of shared memory would risk crashing the postmaster along with the backends. Understood, thanks. Most probably I better go another

Re: [HACKERS] InitPostgres and flatfiles question

2007-01-03 Thread Tom Lane
Markus Schiltknecht <[EMAIL PROTECTED]> writes: > I've just run into a race condition with creating a database and > connecting to it immediately afterwards. I'm getting a "database %s not > found" error just after the first flatfiles check in InitPostgres(). In what PG version? > What that Fin

Re: [HACKERS] Rare corruption of pg_class index

2007-01-03 Thread Tom Lane
"Greg Sabino Mullane" <[EMAIL PROTECTED]> writes: > So as a general rule, the system tables should be considered a special > case as far as transactional activity? To be more precise, you are saying > that a system table must be locked in access exclusive mode before any > change is made to guarant

[HACKERS] InitPostgres and flatfiles question

2007-01-03 Thread Markus Schiltknecht
Hi, I've just run into a race condition with creating a database and connecting to it immediately afterwards. I'm getting a "database %s not found" error just after the first flatfiles check in InitPostgres(). What that FindMyDatabase() there does, besides checking if the database exists, is

Re: [HACKERS] Rare corruption of pg_class index

2007-01-03 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tom Lane wrote: > No, it's not a violation of ACID. In this case what you are doing is > altering a table's schema without a sufficiently strong lock on the > table, and that's a no-no, whether you would like it to be or not. So as a general rule,

Re: [HACKERS] [PATCHES] Patch to log usage of temporary files

2007-01-03 Thread Simon Riggs
On Tue, 2007-01-02 at 18:20 -0500, Tom Lane wrote: > Bill Moran <[EMAIL PROTECTED]> writes: > > In response to Alvaro Herrera <[EMAIL PROTECTED]>: > >> Please change things to save the stat() syscall when the feature is not > >> in use. > > > Do you have a suggestion on how to do that and still ha

Re: [HACKERS] TODO: GNU TLS

2007-01-03 Thread Stephen Frost
* Florian Weimer ([EMAIL PROTECTED]) wrote: > * Stephen Frost: > > Ah, this does sound rather ugly and not something we'd want. The > > particular library doesn't make a whole heck of alot of difference to me > > provided it has the general functionality necessary and a compatible > > license (whe

Re: [HACKERS] TODO: GNU TLS

2007-01-03 Thread Florian Weimer
* Stephen Frost: > Ah, this does sound rather ugly and not something we'd want. The > particular library doesn't make a whole heck of alot of difference to me > provided it has the general functionality necessary and a compatible > license (where 'compatible' in this case really means 'Debian fee

[HACKERS] pg_ctl options

2007-01-03 Thread Andrew Dunstan
I notice that quite a few pg_ctl options have no long form equivalents, namely these: NopPwW Also, none of the long forms seems to be documented at all. Should this be cleared up (maybe a nice first project for lurking new contributors)?\ If we don't want long forms for some reason, then a

Re: [HACKERS] effective_cache_size vs units

2007-01-03 Thread Zeugswetter Andreas ADI SD
> > Yes, and I can't think of a single reason why we'd let people specify > > anything in millibytes, or kilobits. > > How about a configuration option related to connection throughput, which is > typically measured in bits? We'd use "kbit". I don't see us using "kb" in that case (or was it kB

Re: [HACKERS] Load distributed checkpoint

2007-01-03 Thread Zeugswetter Andreas ADI SD
> > I believe there's something similar for OS X as well. The question is: > > would it be better to do that, or to just delay calling fsync until the > > OS has had a chance to write things out. > > A delay is not going to help unless you can suppress additional writes > to the file, which I don

Re: [HACKERS] WITH support

2007-01-03 Thread Mark Cave-Ayland
On Wed, 2007-01-03 at 09:45 +0100, Hubert FONGARNAND wrote: > Why not looking at http://gppl.moonbone.ru/ evgen potemkin. has ever > made a patch for WITH and CONNECT BY? > > I'm ready to test these features... (RECURSIVE) when they'll land in > CVS... Hi Hubert, IIRC there were two issues - f

Re: [HACKERS] WITH support

2007-01-03 Thread Hubert FONGARNAND
Le mardi 02 janvier 2007 à 18:08 -0700, Jonah H. Harris a écrit : > On 12/30/06, Mark Cave-Ayland <[EMAIL PROTECTED]> wrote: > > In short, if people don't mind waiting for my free cycles to come along > > then I will continue to chip away at it; otherwise if it's considered an > > essential for 8.

Re: [HACKERS] [PATCHES] xlog directory at initdb time

2007-01-03 Thread Peter Eisentraut
Am Mittwoch, 27. Dezember 2006 02:56 schrieb Euler Taveira de Oliveira: > This simple patch lets someone specifies the xlog directory at initdb > time. It uses symlinks to do it, and create and/or set permissions at > the directory as appropriate. On the name of the option, it's not actually a "da