Re: [GENERAL] Standalone Windows Installation

2008-10-01 Thread Jörn Heid
Thanks Ashesh for your answer. I will try to do so although I first have to install VC (or can I just use the directories from WinSxS?). Is there another possibility without setting an environment variable? Think of the simplest distribution of just copying files (e.g. to a USB stick) and

[GENERAL] error compiling postgres source

2008-10-01 Thread Roshni Mani
Hi , Can somebody tell me the solution for this.i tried compiling postgres as follows in vs2005 .its giving the following errors E:\postgresql-8.3.1\src\interfaces\libpqnmake /f win32.mak Microsoft (R) Program Maintenance Utility Version 8.00.50727.42 Copyright (C) Microsoft

Re: [GENERAL] pg_start_backup() takes too long

2008-10-01 Thread Simon Riggs
On Tue, 2008-09-30 at 12:58 +0400, Ivan Zolotukhin wrote: Just a few points on pg_start_backup() from user point of view. I personally would prefer to have some control over the process, e.g. it would be nice to have proposed pg_start_backup(label text, immediate_chkpt boolean). I've added

[GENERAL] tsearch2 Upgrade to 8.3 tsearch2.so errors

2008-10-01 Thread Darragh Gammell
Hi I am currently upgrading from 8.1 to 8.3 and am getting errors when restoring the dump from 8.1 into 8.3. Like below: ERROR: could not find function gtsvector_in in file /usr/lib/postgresql/8.3/lib/tsearch2.so ERROR: function public.gtsvector_in(cstring) does not exist ERROR: could not

Re: [GENERAL] Standalone Windows Installation

2008-10-01 Thread Ashesh D Vashi
Jörn Heid wrote: Thanks Ashesh for your answer. I will try to do so although I first have to install VC (or can I just use the directories from WinSxS?). Is there another possibility without setting an environment variable? Think of the simplest distribution of just copying files (e.g. to a

Re: [GENERAL] Standalone Windows Installation

2008-10-01 Thread Jörn Heid
Okay, that's a misunderstanding. I don't want to build it from the sources. I want to take the official pre-built postgres without installer package and put it on a Windows machine to make it work. That doesn't work (while it should IMHO) because of the dependencies. So I just want to add some

Re: [GENERAL] tsearch2 Upgrade to 8.3 tsearch2.so errors

2008-10-01 Thread Richard Huxton
Darragh Gammell wrote: I am currently upgrading from 8.1 to 8.3 and am getting errors when restoring the dump from 8.1 into 8.3. Like below: I have read this is due to the tsearch2 functions being moved into the core section of postgres and I'll need to do some editing after the dump to

[GENERAL] Index question regarding numeric operators

2008-10-01 Thread Mike Christensen
Hi guys, I'm very new to PostgreSQL so please excuse me if this is an easy question.. I have a table called Recipes which has a column called CookTime. I have an index on the CookTime column as such: CREATE INDEX idx_recipes_cooktime ON recipes USING btree (cooktime); If I run the

Re: [GENERAL] error compiling postgres source

2008-10-01 Thread Hiroshi Saito
Hi. It is strange?_? pg_config.h and pg_config_os.h must be copied as below. C:\MinGW\home\HIROSHI\postgresql-8.3.3\src\interfaces\libpqnmake -f win32.mak Microsoft (R) Program Maintenance Utility Version 8.00.50727.42 Copyright (C) Microsoft Corporation. All rights reserved. Building the

[GENERAL] How to force PostgreSQL to use multiple cores within one connection?

2008-10-01 Thread Sergey A.
Hello. My application generates a large amount of inserts (~ 2000 per second) using one connection to PostgreSQL. All queries are buffered in memory and then the whole buffers are send to DB. But when I use two connections to PostgreSQL instead of one on dual core CPU (i.e. I use two processes of

Re: [GENERAL] How to force PostgreSQL to use multiple cores within one connection?

2008-10-01 Thread Raymond O'Donnell
On 01/10/2008 11:44, Sergey A. wrote: Using several connections in my application is somewhat tricky, so I want to move this problem to PostgreSQL's side. Is there any method for PostgreSQL to process huge inserts coming from one connection on different cores? I don't think so. Postgres

Re: [GENERAL] How to force PostgreSQL to use multiple cores within one connection?

2008-10-01 Thread Sergey A.
Hello. I don't think so. Postgres spawns a single process for each connection, so each connection is going to be confined to a single core. Thanks for your answer. I know that I can use a connection pooler to involve early created connections. Can poolers balance queries coming from my

Re: [GENERAL] How to force PostgreSQL to use multiple cores within one connection?

2008-10-01 Thread Richard Huxton
Sergey A. wrote: I know that I can use a connection pooler to involve early created connections. Can poolers balance queries coming from my connection among a few physical connections to DB? The pg_loader project might be of use to you. http://pgfoundry.org/projects/pgloader/ -- Richard

Re: [GENERAL] How to force PostgreSQL to use multiple cores within one connection?

2008-10-01 Thread David Fetter
On Wed, Oct 01, 2008 at 05:13:59AM -0700, Sergey A. wrote: Hello. Are you using COPY? If not, start there :) I'm new to PostgreSQL. No, I'm not using COPY =) Are you about http://www.postgresql.org/docs/8.3/interactive/sql-copy.html (COPY -- copy data between a file and a table)? You

Re: [GENERAL] How to force PostgreSQL to use multiple cores within one connection?

2008-10-01 Thread David Fetter
On Wed, Oct 01, 2008 at 03:44:40AM -0700, Sergey A. wrote: Hello. My application generates a large amount of inserts (~ 2000 per second) using one connection to PostgreSQL. All queries are buffered in memory and then the whole buffers are send to DB. Are you using COPY? If not, start

Re: [GENERAL] How to force PostgreSQL to use multiple cores within one connection?

2008-10-01 Thread Sergey A.
Hello. You can use it for whatever you're generating. I've tested this technique, and I'm wondering! 12 inserts per ~600ms! Thanks for your help. Multiple cores are not the solution to your problem here, but COPY almost certainly is :) But as I can see this approach doesn't work over

Re: [GENERAL] Index question regarding numeric operators

2008-10-01 Thread Gurjeet Singh
On Wed, Oct 1, 2008 at 1:57 PM, Mike Christensen [EMAIL PROTECTED] wrote: Hi guys, I'm very new to PostgreSQL so please excuse me if this is an easy question.. I have a table called Recipes which has a column called CookTime. I have an index on the CookTime column as such: CREATE INDEX

Re: [GENERAL] How to force PostgreSQL to use multiple cores within one connection?

2008-10-01 Thread Scott Marlowe
On Wed, Oct 1, 2008 at 6:58 AM, Sergey A. [EMAIL PROTECTED] wrote: Hello. You can use it for whatever you're generating. I've tested this technique, and I'm wondering! 12 inserts per ~600ms! Thanks for your help. Multiple cores are not the solution to your problem here, but COPY almost

Re: [GENERAL] How to force PostgreSQL to use multiple cores within one connection?

2008-10-01 Thread Bill Moran
In response to Sergey A. [EMAIL PROTECTED]: Multiple cores are not the solution to your problem here, but COPY almost certainly is :) But as I can see this approach doesn't work over network: I need to create file with data locally, and then ask PostgreSQL to read it. There is a network

Re: [GENERAL] Index question regarding numeric operators

2008-10-01 Thread Tom Lane
Mike Christensen [EMAIL PROTECTED] writes: As you can see the index is not being used and it's doing a seq scan on the table directly. I would think if Postgres is indeed keeping a btree index on the column, meaning the values would be stored in numerical order, the index would be used

Re: [GENERAL] How to force PostgreSQL to use multiple cores within one connection?

2008-10-01 Thread Merlin Moncure
On Wed, Oct 1, 2008 at 6:44 AM, Sergey A. [EMAIL PROTECTED] wrote: Hello. My application generates a large amount of inserts (~ 2000 per second) using one connection to PostgreSQL. All queries are buffered in memory and then the whole buffers are send to DB. But when I use two connections to

Re: [GENERAL] How to force PostgreSQL to use multiple cores within one connection?

2008-10-01 Thread Nikolas Everett
If you happen to be using JDBC you can also get copy to work: http://kato.iki.fi/sw/db/postgresql/jdbc/copy/ On Wed, Oct 1, 2008 at 9:24 AM, Merlin Moncure [EMAIL PROTECTED] wrote: On Wed, Oct 1, 2008 at 6:44 AM, Sergey A. [EMAIL PROTECTED] wrote: Hello. My application generates a large

Re: [GENERAL] How to force PostgreSQL to use multiple cores within one connection?

2008-10-01 Thread Sergey A.
Sure it does. copy from STDIN 213 345 567 847 837 473 \. Thanks. Was this query entered in psql shell? -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] How to force PostgreSQL to use multiple cores within one connection?

2008-10-01 Thread Sergey A.
There is a network API for COPY. Look up pg_put_line (or PQputLine or whatever the convention is for whatever API you're using). Thanks for your answer. I use Erlang (erlang.org) + pgsql2 (it's native Erlang driver maintained by ejabberd developers). All all I have is the following functions:

Re: [GENERAL] How to force PostgreSQL to use multiple cores within one connection?

2008-10-01 Thread Scott Marlowe
On Wed, Oct 1, 2008 at 7:58 AM, Sergey A. [EMAIL PROTECTED] wrote: Sure it does. copy from STDIN 213 345 567 847 837 473 \. Thanks. Was this query entered in psql shell? Yes, but if you're using something like php, you can enter it as a single string and it will work. -- Sent via

Re: [GENERAL] How to force PostgreSQL to use multiple cores within one connection?

2008-10-01 Thread Scott Marlowe
On Wed, Oct 1, 2008 at 8:04 AM, Sergey A. [EMAIL PROTECTED] wrote: There is a network API for COPY. Look up pg_put_line (or PQputLine or whatever the convention is for whatever API you're using). Thanks for your answer. I use Erlang (erlang.org) + pgsql2 (it's native Erlang driver maintained

Re: [GENERAL] Why Does UPDATE Take So Long?

2008-10-01 Thread Bill Thoen
Many thanks to everyone who helped me with this. It'll be a while before I understand enough to be able to do a good job of tuning my system's configuration, but there seem to be a few basics I can apply right away. Also pointing out how UPDATE actually works was very helpful. Since I'm at the

[GENERAL] object references and renaming was: Why Does UPDATE Take So Long?

2008-10-01 Thread Ivan Sergio Borgonovo
On Wed, 01 Oct 2008 08:32:16 -0600 Bill Thoen [EMAIL PROTECTED] wrote: CREATE TABLE farm2 (LIKE farms); INSERT INTO farm2 (farm_id, fips_cd, farm_nbr, prog_year) SELECT farm_id, fips_cd, farm_nbr, '2007' FROM farms; DROP TABLE farms; ALTER TABLE farm2 RENAME TO farms; CREATE UNIQUE INDEX

[GENERAL] pg_restore stalled ???

2008-10-01 Thread Gauthier, Dave
Hi: I did a pg_dump of a v8,2,5 db using... pg_dump -C -file=thedb.pgdump thedb I'm attempting to restore in v8.3.4 using pg_restore running under v8.3.4 using... pg_restore -f mydb.pgdump -i -C It doesn;t appear to be doing anything. ps shows no cpu usage. du shows no

Re: [GENERAL] How to force PostgreSQL to use multiple cores within one connection?

2008-10-01 Thread Bill Moran
In response to Scott Marlowe [EMAIL PROTECTED]: On Wed, Oct 1, 2008 at 7:58 AM, Sergey A. [EMAIL PROTECTED] wrote: Sure it does. copy from STDIN 213 345 567 847 837 473 \. Thanks. Was this query entered in psql shell? Yes, but if you're using something like php, you can

Re: [GENERAL] pg_restore stalled ???

2008-10-01 Thread Andreas Kretschmer
Gauthier, Dave [EMAIL PROTECTED] schrieb: Hi: I did a pg_dump of a v8,2,5 db using... pg_dump –C –file=thedb.pgdump thedb This create a plain text dump. I’m attempting to restore in v8.3.4 using pg_restore running under v8.3.4 using... pg_restore –f

Re: [GENERAL] pg_restore stalled ???

2008-10-01 Thread Tom Lane
Gauthier, Dave [EMAIL PROTECTED] writes: I'm attempting to restore in v8.3.4 using pg_restore running under v8.3.4 using... pg_restore -f mydb.pgdump -i -C It doesn;t appear to be doing anything. It's waiting for an archive to show up on stdin :-( -f is the *output* file name for pg_restore.

Re: [GENERAL] pg_restore stalled ???

2008-10-01 Thread Gauthier, Dave
Ya, I aborted it and am successfully restoring the DB using psql. It's sure taking up cycles and disk space now :-) -dave -Original Message- From: Tom Lane [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 01, 2008 11:52 AM To: Gauthier, Dave Cc: pgsql-general@postgresql.org Subject:

Re: [GENERAL] Transactions within a function body

2008-10-01 Thread Andreas Kretschmer
Reg Me Please [EMAIL PROTECTED] schrieb: Hi all. Is there a way to have (sub)transactions within a function body? No. Andreas -- Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect. (Linus Torvalds) If I was god,

[GENERAL] WARNING: 25P01: there is no transaction in progress

2008-10-01 Thread Glyn Astill
Hi Chaps, I'm getting the aforementioned warning in my logs from a closed source piece of software. The software helps us convert over some old proprietary data files, and it's basically just done a COPY into a newly created table, after the warning it then goes on to create some indexes. I

Re: [GENERAL] WARNING: 25P01: there is no transaction in progress

2008-10-01 Thread Bill Moran
In response to Glyn Astill [EMAIL PROTECTED]: Hi Chaps, I'm getting the aforementioned warning in my logs from a closed source piece of software. The software helps us convert over some old proprietary data files, and it's basically just done a COPY into a newly created table, after

Re: [GENERAL] WARNING: 25P01: there is no transaction in progress

2008-10-01 Thread Glyn Astill
Ah, It just hit me that I probably logged all the wrong type of stuff there. I should have been logging statements shouldn't I? http://privatepaste.com/6f1LYISojo I think this shows up that they're sending an extra commit transaction on line 36. Could someone dous a favour and chack I've not

Re: [GENERAL] WARNING: 25P01: there is no transaction in progress

2008-10-01 Thread Glyn Astill
I presume it's issuing some sort of commit or rollback without a begin, however the programs authors are telling me that's not the case and their software is not at fault. Of course their software can't be at fault, as it is entirely bug free ;-) You could turn on statement logging in

Re: [GENERAL] WARNING: 25P01: there is no transaction in progress

2008-10-01 Thread Scott Marlowe
On Wed, Oct 1, 2008 at 10:23 AM, Glyn Astill [EMAIL PROTECTED] wrote: Hi Chaps, I'm getting the aforementioned warning in my logs from a closed source piece of software. The software helps us convert over some old proprietary data files, and it's basically just done a COPY into a newly

Re: [GENERAL] WARNING: 25P01: there is no transaction in progress

2008-10-01 Thread Bill Moran
In response to Glyn Astill [EMAIL PROTECTED]: Ah, It just hit me that I probably logged all the wrong type of stuff there. I should have been logging statements shouldn't I? http://privatepaste.com/6f1LYISojo I think this shows up that they're sending an extra commit transaction on

Re: [GENERAL] WARNING: 25P01: there is no transaction in progress

2008-10-01 Thread Glyn Astill
If you're using connection pooling it's possible that the a connection is getting reused and a commit is happening there. It's not an uncommon practice to do a rollback when first getting a shared connection to make sure it's fresh and clean... That's interesting to hear. Although we

Re: [GENERAL] WARNING: 25P01: there is no transaction in progress

2008-10-01 Thread Glyn Astill
Ah, It just hit me that I probably logged all the wrong type of stuff there. I should have been logging statements shouldn't I? http://privatepaste.com/6f1LYISojo I think this shows up that they're sending an extra commit transaction on line 36. Could someone do us a

Re: [GENERAL] WARNING: 25P01: there is no transaction in progress

2008-10-01 Thread Dennis Brakhane
On Wed, Oct 1, 2008 at 6:23 PM, Glyn Astill [EMAIL PROTECTED] wrote: I presume it's issuing some sort of commit or rollback without a begin, however the programs authors are telling me that's not the case and their software is not at fault. Of course their software can't be at fault, as it

[GENERAL] Transactions within a function body

2008-10-01 Thread Reg Me Please
Hi all. Is there a way to have (sub)transactions within a function body? I'd like to execute some code (a transaction!) inside a function and later decide whether that transaction is to be committed or not. Thanks. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make

[GENERAL] Ideas on how to use external perl script

2008-10-01 Thread Gauthier, Dave
Hi: I need to write a stored function that will perform a complex task which has already been handled in OO subfunctions of an external perl module. The perl module has many subroutines and OO constructs and may use whatever else is legal to use in perl. (I do have the source code for the

Re: [GENERAL] Ideas on how to use external perl script

2008-10-01 Thread Roderick A. Anderson
Sorry to all but my original reply went to Dave instead of the list. Gauthier, Dave wrote: Wait, I also appear to have plperlu (createlang plperlu seems to have worked successfully). Now if it will do what you need. :-) Rod -- -Original Message- From: Roderick A. Anderson

Re: [GENERAL] object references and renaming was: Why Does UPDATE Take So Long?

2008-10-01 Thread Filip Rembiałkowski
2008/10/1 Ivan Sergio Borgonovo [EMAIL PROTECTED]: On Wed, 01 Oct 2008 08:32:16 -0600 Bill Thoen [EMAIL PROTECTED] wrote: CREATE TABLE farm2 (LIKE farms); INSERT INTO farm2 (farm_id, fips_cd, farm_nbr, prog_year) SELECT farm_id, fips_cd, farm_nbr, '2007' FROM farms; DROP TABLE farms; this

Re: [GENERAL] Index question regarding numeric operators

2008-10-01 Thread Mike Christensen
Thanks Tom! I just tried a query for cooktimes over 1 million to test your theory, as it would almost instantly be able to tell from the index that there are zero rows matching that condition. Indeed, it hits the index which is what I would expect, and the total runtime is 0.163ms.

[GENERAL] inserting only new rows from csv file

2008-10-01 Thread Seb
Hi, I've seen some approaches to this problem, but I suspect there are better ways. A csv file is produced nightly, with the same table structure as a table in a PostgreSQL database. The file grows over time as new records are added every day. However, the rows in the file may not be sorted

Re: [GENERAL] Transactions within a function body

2008-10-01 Thread Dennis Brakhane
On Wed, Oct 1, 2008 at 5:54 PM, Reg Me Please [EMAIL PROTECTED] wrote: Hi all. Is there a way to have (sub)transactions within a function body? I'd like to execute some code (a transaction!) inside a function and later decide whether that transaction is to be committed or not. You could

Re: [GENERAL] inserting only new rows from csv file

2008-10-01 Thread Scott Marlowe
On Wed, Oct 1, 2008 at 3:16 PM, Seb [EMAIL PROTECTED] wrote: Hi, I've seen some approaches to this problem, but I suspect there are better ways. A csv file is produced nightly, with the same table structure as a table in a PostgreSQL database. The file grows over time as new records are

Re: [GENERAL] object references and renaming was: Why Does UPDATE Take So Long?

2008-10-01 Thread Ivan Sergio Borgonovo
On Wed, 1 Oct 2008 22:19:29 +0200 Filip Rembiałkowski [EMAIL PROTECTED] wrote: Is this kind of stuff going to affect any reference to the farm table? eg. inside functions, triggers etc? no, not in functions source. I've read somewhere that create *or replace* should be used exactly because

Re: [GENERAL] inserting only new rows from csv file

2008-10-01 Thread Harvey, Allan AC
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Scott Marlowe Sent: Thursday, 2 October 2008 7:39 AM To: Seb Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] inserting only new rows from csv file On Wed, Oct 1, 2008 at 3:16 PM, Seb [EMAIL

Re: [GENERAL] Transactions within a function body

2008-10-01 Thread Alvaro Herrera
Dennis Brakhane escribió: On Wed, Oct 1, 2008 at 5:54 PM, Reg Me Please [EMAIL PROTECTED] wrote: Hi all. Is there a way to have (sub)transactions within a function body? I'd like to execute some code (a transaction!) inside a function and later decide whether that transaction is to be

Re: [GENERAL] tsearch2 Upgrade to 8.3 tsearch2.so errors

2008-10-01 Thread Darragh Gammell
Hi Richard Thanks for your help. I'll try that. Darragh On Wed, Oct 1, 2008 at 6:03 PM, Richard Huxton [EMAIL PROTECTED] wrote: Darragh Gammell wrote: I am currently upgrading from 8.1 to 8.3 and am getting errors when restoring the dump from 8.1 into 8.3. Like below: I have read this

[GENERAL] That was easy

2008-10-01 Thread Gauthier, Dave
I just ported my whole DB instance, 4 db's inside with roles, triggers, stored procedures, etc... from v8.2.5 to v8.3.4. After the initdb, I mimiced the mods I had in the postgres.conf and pg_hba.conf files to v83. Then I used pg_dumpall and psql to do the move. That was far and away the easiest