[HACKERS] SPI_fnumber is case sensitive

2004-05-05 Thread Thomas Hallgren
The SPI_fnumber (returns the column number using a name) is case sensitive. I think a patch would be appropriate. Either to the documentation that could state this fact and suggest lowercasing the colname parameter, or to the code to make it case insensitive. I'd be happy to provide the one chosen.

Re: [HACKERS] PostgreSQL pre-fork speedup

2004-05-05 Thread sdv mailer
Yes, I realize it's a bit old but I just wanted to make a small point that forking is slower. It's funny you should ask because thread creation on Linux has in fact improved over process creation much more in 2.4 kernel. Benchmark at IBM shows Linux 2.4 thread creation is 30x faster than process c

Re: [HACKERS] PostgreSQL pre-fork speedup

2004-05-05 Thread Andrew Dunstan
sdv mailer said: > Forking is expensive on many systems. Linux is a bit > better but still expensive compared to threads. On > Windows, creating process is much more expensive than > on Linux. Check this benchmark: > > http://cs.nmu.edu/~randy/Research/Papers/Scheduler/understanding.html > > Forkin

Re: [HACKERS] PostgreSQL pre-fork speedup

2004-05-05 Thread sdv mailer
I don't think I can volunteer on this end as I am already actively volunteering for another open project. I was hoping someone could take up on this since one of the last threads mentionned we don't have something substantial to present for 7.5 if June 1 is dateline for code freeze. Pre-fork came t

Re: [HACKERS] PostgreSQL pre-fork speedup

2004-05-05 Thread sdv mailer
I'll pretend I didn't see that last comment on Windows. I wouldn't want to disappoint the users who are eagerly expecting the Win32 port to complete including myself. ;-) Having said that, I think it's more the reason to get a working pre-fork for Win32. Don't you think so? --- "scott.marlowe

Re: [HACKERS] PostgreSQL pre-fork speedup

2004-05-05 Thread sdv mailer
Forking is expensive on many systems. Linux is a bit better but still expensive compared to threads. On Windows, creating process is much more expensive than on Linux. Check this benchmark: http://cs.nmu.edu/~randy/Research/Papers/Scheduler/understanding.html Forking shouldn't be taken lightly as

Re: [HACKERS] PostgreSQL pre-fork speedup

2004-05-05 Thread sdv mailer
I've already tried pooling (SQLRelay) and persistent connection (PHP). They may work for other people but they do not work for me. I have already separated static from database driven codes but you can never balance web server load with database server load. Pre-fork scales with database load and

Re: [HACKERS] ALTER TABLE TODO items

2004-05-05 Thread Bruce Momjian
Tom Lane wrote: > Richard Huxton <[EMAIL PROTECTED]> writes: > > Does that mean I'll want to disable triggers while I do this? > > Hrm. Right now the code does not fire triggers at all, but that seems > wrong. However, I doubt that very many triggers could cope with update > events in which the

Re: [HACKERS] Multiple Xids in PGPROC?

2004-05-05 Thread Bruce Momjian
Manfred Koizar wrote: > With subtransactions we'd have to fall back to checking pg_clog (and > pg_subtrans) in certain cases. There are lots of possible > implementations. Here are some ideas (just brainstorming): > > . We could first scan the PGPROC array. If the xid is an active main > tran

Re: [HACKERS] Multiple Xids in PGPROC?

2004-05-05 Thread Bruce Momjian
Alvaro Herrera wrote: > On Tue, May 04, 2004 at 11:21:18PM -0400, Bruce Momjian wrote: > > Sorry I haven't gotten your patches in yet. Tom is working on some > > other back patches. > > I've been sloppy lately with #ifdef, because it takes some time to get > right and testing it takes even more t

Re: [HACKERS] Multiple Xids in PGPROC?

2004-05-05 Thread Bruce Momjian
Tom Lane wrote: > Manfred Koizar <[EMAIL PROTECTED]> writes: > > The straightforward pg_clog lookup is still in transam.c, > > but has been deactivated: > > * Now this func in shmem.c and gives quality answer by scanning > > * PGPROC structures of all running backend. - vadim 11/26/96 > > > What

Re: [HACKERS] ALTER TABLE TODO items

2004-05-05 Thread Christopher Kings-Lynne
Yeah, the USING is actually any arbitrary expression over the old table row. (Getting that to work was a tad tricky...) So you can view this as a full-table UPDATE operation that folds in possible column type changes. All I can say is three cheers for Tom and Rod on this one Chris ---

Re: [HACKERS] initdb failure in CVS

2004-05-05 Thread Tom Lane
Andrew Dunstan <[EMAIL PROTECTED]> writes: > Did we actually find a current system where it broke with a straight > putenv("LC_ALL")? Well, the Single Unix Spec does not say that that works, and neither does the HPUX man page for putenv, so you're going to have a hard time convincing me that it's

Re: [HACKERS] COPY command - CSV files

2004-05-05 Thread Christopher Kings-Lynne
I believe this has already been implemented in CVS... Chris Umberto Zappi wrote: I wish modify COPY command for support of CSV files (dump/load files in CSV format). I think this option is very important from import data from spreedsheet as OpenOffice/calc or M$/excel. I have found this task in TOD

Re: [HACKERS] Multiple Xids in PGPROC?

2004-05-05 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > I think if we want to do nontrivial manipulations in PGPROC we should > make sure it's properly locked. Maybe it's a good time to implement the > locking suggested here? With a LWLock instead of a spinlock, of course; > we would need MaxBackends extra

Re: [HACKERS] PostgreSQL pre-fork speedup

2004-05-05 Thread Andrew Dunstan
Rod Taylor wrote: As a temporary step these types of things help. But it's still doesn't really fix the problem of Apache not using real connection pooling. Rod, In principle, this should not be enormously hard to do - at least for Unix where the methods of handing off file handles between pro

Re: [HACKERS] Multiple "selects" returned from a single stored procedure

2004-05-05 Thread Joe Conway
Shachar Shemesh wrote: MS-SQL has the capacity for both out variables from stored procedures, as well as running several "selects" inside the procedures, and then giving the results for all selects to the caller. Fortunetly for me, that specific application doesn't run more than one select per stor

Re: [HACKERS] PostgreSQL pre-fork speedup

2004-05-05 Thread Rod Taylor
> > I cannot tell if mod_pg_pool works across Apache forked backends or is > > still bound to a single process. They state it is intended for sharing > > connections across modules, so it is probably still backend specific. > > Have you looked at sqlrealy.sourceforge.net? IT looks like it might d

Re: [HACKERS] PostgreSQL pre-fork speedup

2004-05-05 Thread scott.marlowe
On Wed, 5 May 2004, Rod Taylor wrote: > > And, of course, most development environments (perl, php, java etc) > > have their own language specific connection pooling solutions. > > Yes, the one for php is what I was thinking of when I made my statement. > They work on a per backend basis as Apach

[HACKERS] database read/write from applications code Request for advice

2004-05-05 Thread terr
I am wondering if there is a simple way to implement a read() blah and write() blah function to a database. The application I'm looking at is very simple and this is all that is required. In the past I used a cursor - did the select, then retrieved the records one at a time. Any suggestions?

Re: [HACKERS] Multiple Xids in PGPROC?

2004-05-05 Thread Alvaro Herrera
On Wed, May 05, 2004 at 02:18:16PM -0400, Tom Lane wrote: > Manfred Koizar <[EMAIL PROTECTED]> writes: > > . We could include a small number of subtransaction xids in PGPROC. > > Yeah, I was just thinking that myself. If we only need to show open > subtrans xids, then the number you'd need wou

Re: [HACKERS] PostgreSQL pre-fork speedup

2004-05-05 Thread Rod Taylor
> And, of course, most development environments (perl, php, java etc) > have their own language specific connection pooling solutions. Yes, the one for php is what I was thinking of when I made my statement. They work on a per backend basis as Apache does not allow for the type of communication be

Re: [HACKERS] Postgres Optimization: IO and Data Organization

2004-05-05 Thread Doug McNaught
[EMAIL PROTECTED] (James Thornton) writes: > I want to understand how Postgres organizes data and handles IO > operations so that I will better know how to optimize a Postgres > database server. I am looking for answers to specific questions and > pointers to where this stuff is documented. If yo

Re: [HACKERS] initdb failure in CVS

2004-05-05 Thread Bruce Momjian
Thanks, works. --- Tom Lane wrote: > Bruce Momjian <[EMAIL PROTECTED]> writes: > > I am seeing the following failure of initdb in CVS: > > Okay, I did some more work on handling unsetenv cleanly ... give it > another try. >

Re: [HACKERS] Multiple Xids in PGPROC?

2004-05-05 Thread Simon Riggs
On Wed, 2004-05-05 at 05:30, Rod Taylor wrote: > Yup.. And some of us intend on wrapping every single statement in a > subtransaction so we can rollback on an error without aborting the main > transaction. > That is exactly what is needed to achieve full Oracle & DB2 compatibility. I suggest th

Re: [HACKERS] PostgreSQL pre-fork speedup

2004-05-05 Thread Joshua D. Drake
The fact that windows has a heavy process / lightweight thread design means little to me, since I'll likely never deploy a production postgresql server on it that needs to handle any serious load. Yes but Solaris also has a heavy process / lightweight thread design. J --

Re: [HACKERS] initdb failure in CVS

2004-05-05 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > I am seeing the following failure of initdb in CVS: Okay, I did some more work on handling unsetenv cleanly ... give it another try. regards, tom lane ---(end of broadcast)--- TIP

Re: [HACKERS] PostgreSQL pre-fork speedup

2004-05-05 Thread Stephen Frost
* Steve Atkins ([EMAIL PROTECTED]) wrote: > On Wed, May 05, 2004 at 02:12:58PM -0400, Rod Taylor wrote: > > > > Most of it has been. It's the duty cycle. As stated in another email, > > only about 20% of the work a script does is database related -- which > > occurs all at one time. Even when all

Re: [HACKERS] PostgreSQL pre-fork speedup

2004-05-05 Thread scott.marlowe
On Wed, 5 May 2004, sdv mailer wrote: > Forking is quite fast on Linux but creating a new > process is still 10x more expensive than creating a > thread and is even worse on Win32 platform. CPU load > goes up because the OS needs to allocate/deallocate > memory making it difficult to get a steady

Re: [HACKERS] initdb failure in CVS

2004-05-05 Thread Andrew Dunstan
Bruce Momjian wrote: I am seeing the following failure of initdb in CVS: The files belonging to this database system will be owned by user "postgres". This user must also own the server process. The database cluster will be initialized with locale C.

Re: [HACKERS] PostgreSQL pre-fork speedup

2004-05-05 Thread Steve Atkins
On Wed, May 05, 2004 at 02:12:58PM -0400, Rod Taylor wrote: > > Most of it has been. It's the duty cycle. As stated in another email, > only about 20% of the work a script does is database related -- which > occurs all at one time. Even when all Apache backends are active, a > large number of conn

Re: [HACKERS] initdb failure in CVS

2004-05-05 Thread Rod Taylor
On Wed, 2004-05-05 at 13:48, Bruce Momjian wrote: > I am seeing the following failure of initdb in CVS: > > FATAL: invalid value for parameter "client_encoding": "" I get the same thing. ---(end of broadcast)--- TIP 5: Have you checked o

Re: [HACKERS] initdb failure in CVS

2004-05-05 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > I am seeing the following failure of initdb in CVS: > FATAL: invalid value for parameter "client_encoding": "" Hmm. Apparently the pg_unsetenv routine I put into initdb.c doesn't work on your platform. Which is odd, because we've used exactly

[HACKERS] Multiple "selects" returned from a single stored procedure

2004-05-05 Thread Shachar Shemesh
Hi list, I'm in the process of porting an existing MS-SQL database to PostgreSQL. The application uses OLE DB (and that's why I'm writing the OLE DB for Postgresql). One of the requirements is that we will introduce as little changes to the application. It has to be able to work with both databases

Re: [HACKERS] ALTER TABLE TODO items

2004-05-05 Thread Tom Lane
Richard Huxton <[EMAIL PROTECTED]> writes: > Does that mean I'll want to disable triggers while I do this? Hrm. Right now the code does not fire triggers at all, but that seems wrong. However, I doubt that very many triggers could cope with update events in which the old and new rows have differ

Re: [HACKERS] ALTER TABLE TODO items

2004-05-05 Thread Richard Huxton
Tom Lane wrote: Bruce Momjian <[EMAIL PROTECTED]> writes: Wow, you can reference different column as part of the alter column. Yeah, the USING is actually any arbitrary expression over the old table row. (Getting that to work was a tad tricky...) So you can view this as a full-table UPDATE opera

Re: [HACKERS] PostgreSQL pre-fork speedup

2004-05-05 Thread Jonathan Gardner
On Wednesday 05 May 2004 07:24 am, Rod Taylor wrote: > > And "preforking" makes this different, how ? Perhaps having a pool of > > processes ready to be handed a query to a specific database, where you > > configure N connections to db1, M to db2 etc. still means lots of > > resource usage. In effe

Re: [HACKERS] Multiple Xids in PGPROC?

2004-05-05 Thread Alvaro Herrera
On Tue, May 04, 2004 at 11:21:07PM -0400, Tom Lane wrote: > Alvaro Herrera <[EMAIL PROTECTED]> writes: > > So, the big question is, how do we do this? The most obvious way (to > > me) is to keep the whole array inside the PGPROC struct. > > ... > > The main downside is that it potentially > > requ

Re: [HACKERS] Multiple Xids in PGPROC?

2004-05-05 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > (I'd like to avoid the pg_subtrans lookup in the non-subtransaction case, > but I don't see how to do that.) Could we afford to make xids self-identifying? For instance, odd numbers are base xacts, even numbers are sub xacts. This would in the worst c

[HACKERS] initdb failure in CVS

2004-05-05 Thread Bruce Momjian
I am seeing the following failure of initdb in CVS: The files belonging to this database system will be owned by user "postgres". This user must also own the server process. The database cluster will be initialized with locale C. creating d

Re: [HACKERS] ALTER TABLE TODO items

2004-05-05 Thread Tom Lane
Robert Treat <[EMAIL PROTECTED]> writes: > On Wed, 2004-05-05 at 10:36, Bruce Momjian wrote: >> Do we still want this TODO? >> >> o Allow columns to be reordered using ALTER ... POSITION i col1 [,col2]; > I think we should leave since it is still functionality that people will > want. It's not t

Re: [HACKERS] pg_autovacuum misinterpreting reltuples?

2004-05-05 Thread Matthew T. O'Connor
Jeff Boes wrote: We noticed that one of our high-volume insert tables was being vacuumed every time pg_autovacuum woke up. (I"m running it with the default threshold values, and a 900-second sleep cycle.) The table has a few million rows in it. With "debug = 2" on, here's what the pg_autovacuum

Re: [HACKERS] Multiple Xids in PGPROC?

2004-05-05 Thread Manfred Koizar
On Tue, 04 May 2004 23:21:07 -0400, Tom Lane <[EMAIL PROTECTED]> wrote: >I thought we had devised a solution that did not require expansible >shared memory for this. Bruce, Manfred, do you recall how that went? AFAIR we did not discuss TransactionIdIsInProgress() specifically. Currently this func

Re: [HACKERS] Postgres Crashes

2004-05-05 Thread F Harvell
This sounds very much like a memory problem. I would replace all of the memory with another set of (preferably known good) memory and see if the problems persist. Also look for other cores that may be dropped. If there are several, memory is the likely cause. Be aware that it will likely

Re: [HACKERS] ALTER TABLE TODO items

2004-05-05 Thread Bruce Momjian
Tom Lane wrote: > select * from another; > f1 | f2 > +--- > 1 | one > 2 | two > 3 | three > (3 rows) > > alter table another > alter f1 type text using f2 || ' more', > alter f2 type bigint using f1 * 10; > > select * from another; > f1 | f2 > + >

Re: [HACKERS] PostgreSQL pre-fork speedup

2004-05-05 Thread Andrew Dunstan
sdv mailer wrote: [snip] Pre-fork will give MySQL one less argument to throw at PostgreSQL. I think optimizing is this area will speed up the general case for everyone rather than optimizing a feature that affects 10% of the users. On top of that, it will make a strong marketing case because fork

Re: [HACKERS] ALTER TABLE TODO items

2004-05-05 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > Wow, you can reference different column as part of the alter column. Yeah, the USING is actually any arbitrary expression over the old table row. (Getting that to work was a tad tricky...) So you can view this as a full-table UPDATE operation that fold

Re: [HACKERS] Postgres Crashes

2004-05-05 Thread Tom Lane
[EMAIL PROTECTED] (Prem Gopalan) writes: > The dying process is postmaster. After these crashes the server is > missing from ps and no more new connections are possible. The backend > processes stay on till their connections close. That behavior does sound like a postmaster crash --- but all the s

Re: [HACKERS] PostgreSQL pre-fork speedup

2004-05-05 Thread Rod Taylor
On Wed, 2004-05-05 at 11:57, Greg Stark wrote: > Rod Taylor <[EMAIL PROTECTED]> writes: > > > Cutting that count down to 10 idlers in total by having PostgreSQL > > prefork a specific database would make a significant difference. > > Well it would be 10 for each database. Since as has been pointe

Re: [HACKERS] PostgreSQL pre-fork speedup

2004-05-05 Thread Richard Huxton
sdv mailer wrote: I'm talking about connecting to multiple database servers on separate machines. Schemas don't apply here. How much work would it take to make a pre-fork smart enough to open different databases on incoming connection? How much of it can be modeled after Apache? I've not used it bu

Re: [HACKERS] PostgreSQL pre-fork speedup

2004-05-05 Thread Rod Taylor
> Or, you run several seperate Apache webservers. The ones that serve static > content or don't need database connections don't run with the ones that do. > And just like each idle Apache process uses memory and other resources, > each idle PostgreSQL connection does to. So managing the number o

Re: [HACKERS] ALTER TABLE TODO items

2004-05-05 Thread Bruce Momjian
Stephen Frost wrote: > > I don't think so. As I remember it was part of doing logical attribute > > numbers as a way to add ALTER COLUMN TYPE, but because we now use table > > recreate to implement this, it is unlikely we will ever add logical > > attribute numbers (adds too much complexity to the

Re: [HACKERS] Multiple Xids in PGPROC?

2004-05-05 Thread Tom Lane
Manfred Koizar <[EMAIL PROTECTED]> writes: > The straightforward pg_clog lookup is still in transam.c, > but has been deactivated: > * Now this func in shmem.c and gives quality answer by scanning > * PGPROC structures of all running backend. - vadim 11/26/96 > What was the motivation for this c

Re: [HACKERS] PostgreSQL pre-fork speedup

2004-05-05 Thread Greg Stark
Rod Taylor <[EMAIL PROTECTED]> writes: > Cutting that count down to 10 idlers in total by having PostgreSQL > prefork a specific database would make a significant difference. Well it would be 10 for each database. Since as has been pointed out before loading the database is most of the delay. I

Re: [HACKERS] PostgreSQL pre-fork speedup

2004-05-05 Thread sdv mailer
Pre-fork does not equal to idle connections! Pre-fork scales with database load where as persistent connections scales with webserver load. A web server that is heavily loaded but not necessarily performing a lot of database activity will spawn hundreds of idle database connections using persistent

Re: [HACKERS] ALTER TABLE TODO items

2004-05-05 Thread Gaetano Mendola
Bruce Momjian wrote: Do we still want this TODO? o Allow columns to be reordered using ALTER ... POSITION i col1 [,col2]; have SELECT * and INSERT honor such ordering I don't think so. As I remember it was part of doing logical attribute numbers as a way to add ALTER COLUMN TYPE,

Re: [HACKERS] The features I'm waiting for.

2004-05-05 Thread Gaetano Mendola
Bruce Momjian wrote: David Garamond wrote: scott.marlowe wrote: For me, the only features I'm likely to use in the upcoming releases are nested transactions. While PITR is a great selling point, and the Windows Port is something I do look forward to, having to do half my job programming windows

Re: [HACKERS] PostgreSQL pre-fork speedup

2004-05-05 Thread sdv mailer
I'm talking about connecting to multiple database servers on separate machines. Schemas don't apply here. How much work would it take to make a pre-fork smart enough to open different databases on incoming connection? How much of it can be modeled after Apache?

Re: [HACKERS] COPY command - CSV files

2004-05-05 Thread Andrew Dunstan
It's been done already. see http://developer.postgresql.org/todo.php and http://developer.postgresql.org/docs/postgres/sql-copy.html cheers andrew Umberto Zappi wrote: I wish modify COPY command for support of CSV files (dump/load files in CSV format). I think this option is very important from i

Re: [HACKERS] ALTER TABLE TODO items

2004-05-05 Thread Bruce Momjian
Tom Lane wrote: > Stephen Frost <[EMAIL PROTECTED]> writes: > > Does using table recreate break views built against the table? > > Right now it just rejects the ALTER attempt: > > regression=# create table t1 (f1 int); > CREATE TABLE > regression=# create view v1 as select * from t1; > CREATE VIE

Re: [HACKERS] COPY command - CSV files

2004-05-05 Thread Bruno Wolff III
On Sun, May 02, 2004 at 17:03:35 +0200, Umberto Zappi <[EMAIL PROTECTED]> wrote: > I wish modify COPY command for support of CSV files (dump/load files in > CSV format). > I think this option is very important from import data from spreedsheet > as OpenOffice/calc or M$/excel. > I have found this

Re: [HACKERS] PostgreSQL pre-fork speedup

2004-05-05 Thread Rod Taylor
> I know the issue of pre-fork PostgreSQL has been discussed previously. > Someone mentionned pre-fork can be implemented when schemas become available > Any chance of that happening for 7.5? 0 chance unless you have a patch ready now. ---(end of broadcast)--

Re: [HACKERS] COPY command - CSV files

2004-05-05 Thread Bruce Momjian
Umberto Zappi wrote: > I wish modify COPY command for support of CSV files (dump/load files in > CSV format). > I think this option is very important from import data from spreedsheet > as OpenOffice/calc or M$/excel. > I have found this task in TODO list, also. > > I've begin my work, modify COPY

Re: [HACKERS] ALTER TABLE TODO items

2004-05-05 Thread Robert Treat
On Wed, 2004-05-05 at 10:36, Bruce Momjian wrote: > > TODO items completed: > > o -ALTER TABLE ADD COLUMN does not honor DEFAULT and non-CHECK CONSTRAINT > o -ALTER TABLE ADD COLUMN column DEFAULT should fill existing > rows with DEFAULT value > o -Allow ALTER TA

Re: [HACKERS] Postgres Crashes

2004-05-05 Thread Bruce Momjian
Prem Gopalan wrote: > We run a multithreaded application that uses postgres 7.4 on Linux > 2.4.18, dual cpu Xeon processor machine. We have occassional weird > crashes and have tried a lot of things to reproduce them in house, but > in vain. We do have coredumps and I have listed the backtraces and

Re: [HACKERS] ALTER TABLE TODO items

2004-05-05 Thread Tom Lane
Stephen Frost <[EMAIL PROTECTED]> writes: > Does using table recreate break views built against the table? Right now it just rejects the ALTER attempt: regression=# create table t1 (f1 int); CREATE TABLE regression=# create view v1 as select * from t1; CREATE VIEW regression=# alter table t1 alte

[HACKERS] PostgreSQL pre-fork speedup

2004-05-05 Thread sdv mailer
Hi, I know the issue of pre-fork PostgreSQL has been discussed previously. Someone mentionned pre-fork can be implemented when schemas become available in PostgreSQL because there will be less of the need to run multiple databases. I think Oracle 7 uses pre-forking and it helps speed up the start

[HACKERS] pg_autovacuum misinterpreting reltuples?

2004-05-05 Thread Jeff Boes
We noticed that one of our high-volume insert tables was being vacuumed every time pg_autovacuum woke up. (I"m running it with the default threshold values, and a 900-second sleep cycle.) The table has a few million rows in it. With "debug = 2" on, here's what the pg_autovacuum log reports for

Re: [HACKERS] Weird prepared stmt behavior

2004-05-05 Thread Oliver Jowett
(I'm not on -hackers, but saw this in the archives) Alvaro Herrera wrote: On Fri, Apr 30, 2004 at 09:44:52PM -0400, Tom Lane wrote: Alvaro Herrera writes: > Is this expected? If so, why? I'd expect the prepared stmt to be > deallocated. prepare.c probably should have provisions for rolling back

[HACKERS] Postgres Optimization: IO and Data Organization

2004-05-05 Thread James Thornton
I want to understand how Postgres organizes data and handles IO operations so that I will better know how to optimize a Postgres database server. I am looking for answers to specific questions and pointers to where this stuff is documented. How does Postgres organize its data? For example, is it g

[HACKERS] PostgreSQL pre-fork speedup

2004-05-05 Thread Private
Hi, I know the issue of pre-fork PostgreSQL has been discussed previously. Someone mentionned pre-fork can be implemented when schemas become available in PostgreSQL because there will be less of the need to run multiple databases. I think Oracle 7 uses pre-forking and it helps speed up the start

[HACKERS] Postgres Crashes

2004-05-05 Thread Prem Gopalan
We run a multithreaded application that uses postgres 7.4 on Linux 2.4.18, dual cpu Xeon processor machine. We have occassional weird crashes and have tried a lot of things to reproduce them in house, but in vain. We do have coredumps and I have listed the backtraces and their common characteristic

[HACKERS] COPY command - CSV files

2004-05-05 Thread Umberto Zappi
I wish modify COPY command for support of CSV files (dump/load files in CSV format). I think this option is very important from import data from spreedsheet as OpenOffice/calc or M$/excel. I have found this task in TODO list, also. I've begin my work, modify COPY syntax in: COPY tablename [ ( colum

Re: [HACKERS] PostgreSQL pre-fork speedup

2004-05-05 Thread Andrew Sullivan
On Mon, May 03, 2004 at 11:59:45PM -0700, sdv mailer wrote: > > Connection pooling (eg. SQLRelay) didn't work either > because we needed to connect to hundreds of DB servers > from each web server. Imagine having 200+ open > connections on the web server and how many more of > these connections re

Re: [HACKERS] ALTER TABLE TODO items

2004-05-05 Thread Stephen Frost
* Bruce Momjian ([EMAIL PROTECTED]) wrote: > Do we still want this TODO? > > o Allow columns to be reordered using ALTER ... POSITION i col1 [,col2]; > have SELECT * and INSERT honor such ordering > > I don't think so. As I remember it was part of doing logical attribute > numb

Re: [HACKERS] Multiple Xids in PGPROC?

2004-05-05 Thread Rod Taylor
> Is there some solution whereby the common case (99.999% of transactions > won't be subtransactoins) is fast, and the uncommon case of being in a > subtransaction is slower? I hope not, because for many of us there will be as many (if not more) subtransactions than standard transactions. -- R

Re: [HACKERS] inconsistent owners in newly created databases?

2004-05-05 Thread Greg Stark
Fabien COELHO <[EMAIL PROTECTED]> writes: > nspacl = aclitems_switch_grantor(nspacl, datdba) Instead of having a hard coded list of template1 objects that need to be chowned to the database owner. Perhaps there should be a special user like dbowner which owns the schema and whatever othe

[HACKERS] ALTER TABLE TODO items

2004-05-05 Thread Bruce Momjian
TODO items completed: o -ALTER TABLE ADD COLUMN does not honor DEFAULT and non-CHECK CONSTRAINT o -ALTER TABLE ADD COLUMN column DEFAULT should fill existing rows with DEFAULT value o -Allow ALTER TABLE to modify column lengths and change to binary comp

Re: [HACKERS] Multiple Xids in PGPROC?

2004-05-05 Thread Greg Stark
Christopher Kings-Lynne <[EMAIL PROTECTED]> writes: > > Yup.. And some of us intend on wrapping every single statement in a > > subtransaction so we can rollback on an error without aborting the main > > transaction. > > Point there being "main transaction". What i'm saying is that the vast > ma

Re: [HACKERS] PostgreSQL pre-fork speedup

2004-05-05 Thread Rod Taylor
> And "preforking" makes this different, how ? Perhaps having a pool of > processes ready to be handed a query to a specific database, where you > configure N connections to db1, M to db2 etc. still means lots of resource > usage. In effect a preforked database server *is* an idle connection, just

Re: [HACKERS] Multiple Xids in PGPROC?

2004-05-05 Thread Alvaro Herrera
On Tue, May 04, 2004 at 11:21:18PM -0400, Bruce Momjian wrote: > Alvaro Herrera wrote: > > I've whacked the subtrans patch enough so that the simple tests (i.e. > > non concurrent) for tuple visibility work. I can create a table and > > populate it in subtransactions, rollback or commit them sele

Re: [HACKERS] PostgreSQL pre-fork speedup

2004-05-05 Thread Peter Galbavy
sdv mailer wrote: > We used to run persistent connection until the DB > servers got maxed out because of too many idle > connections sucking up all the memory. Web servers run > different loads than database servers and persistent > connections are notorious for crashing your DB. And this translat

Re: [HACKERS] ERROR: heapgettup: failed ReadBuffer

2004-05-05 Thread jihuang
Thanks for your real-time respone! the problem was sloved after I upgrade the postgreSQL from 7.3.4 to 7.4.2. by the way, is there any bug-tracking website for postgreSQL ? I follow the [HOMEPAGE] -> [DEVELOPERS] ->find nothing relative to bugzilla-like items, follow the [GBROG] ->>> it's P

Re: [HACKERS] Resource allocation?

2004-05-05 Thread Neil Conway
On 4-May-04, at 2:18 PM, David Fetter wrote: I'd like to be able to run large batch-process jobs for caching, but limit the total resource utilization on them, something like nice(1). Better still would be some way to put a max on total resources & be able to allocate from that. Does PostgreSQL hav