Re: [GENERAL] High cpu usage after many inserts

2009-02-24 Thread Scott Marlowe
On Tue, Feb 24, 2009 at 12:40 AM, Jordan Tomkinson jor...@moodle.com wrote: On Tue, Feb 24, 2009 at 11:42 AM, Greg Smith gsm...@gregsmith.com wrote: Right, the useful thing to do in this case is to take a look at how big all the relations (tables, indexes) involved are at each of the steps

Re: [GENERAL] Large object loading stalls

2009-02-24 Thread Michael Akinde
Tom Lane wrote: Michael Akinde michael.aki...@met.no writes: Anyway - the situation now is that just the loading process is hanging on the server, with an IDLE in transaction. But it is definitely the loading program that is hanging, not the Postgres server. What the stack traces

Re: [GENERAL] javascript and postgres

2009-02-24 Thread 野村
thanks for replies. Craig Ringer wrote: This is a really, really, REALLY bad idea. I agree. John R Pierce wrote: if you mean client side Javascript running on the end users web browser, no, it should NOT be allowed to connect to a database server directly. Web pages have username and password

Re: [GENERAL] restore single table

2009-02-24 Thread Albe Laurenz
Kevin Duffy wrote: I need guidance on how move some changes that I have made to my production database. On my development database I made changes to a table called DEPT. I added a column, added a couple of records and did some general data cleanup What I did not do was change

[GENERAL] Oracle Functions to PostgreSQL

2009-02-24 Thread Abdul Rahman
Hi all, Is there any preferably open source tool to convert Oracle Functions to PostgreSQL Functions. Thanks, Abdul Rehman.

Re: [GENERAL] Oracle Functions to PostgreSQL

2009-02-24 Thread A. Kretschmer
In response to Abdul Rahman : Hi all, Is there any preferably open source tool to convert Oracle Functions to PostgreSQL Functions. Maybe orafce, see http://pgfoundry.org/projects/orafce/ Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: - Header)

Re: [GENERAL] Oracle Functions to PostgreSQL

2009-02-24 Thread Bruce Momjian
Abdul Rahman wrote: Hi all, Is there any preferably open source tool to convert Oracle Functions to PostgreSQL Functions. No, not that I know of. I assume you mean user-created functions. There is orafce for adding Oracle functions to Postgres. -- Bruce Momjian br...@momjian.us

[GENERAL] Rotating WAL files

2009-02-24 Thread Alexander Farber
Hello, I've just read about WAL and tried to set these 2 commands for my test database (which is doing nothing 99% of time): archive_command = 'cp -v %p /var/lib/pgsql/data/archive/%f' archive_timeout = 300 # force a logfile segment switch after this

Re: [GENERAL] Rotating WAL files

2009-02-24 Thread salman
Alexander Farber wrote: Hello, I've just read about WAL and tried to set these 2 commands for my test database (which is doing nothing 99% of time): archive_command = 'cp -v %p /var/lib/pgsql/data/archive/%f' archive_timeout = 300 # force a logfile segment switch after this

Re: [GENERAL] Large object loading stalls

2009-02-24 Thread Tom Lane
Michael Akinde michael.aki...@met.no writes: Tom Lane wrote: In the past we've seen this type of thing caused by multithreaded client programs in which more than one thread tried to use the same PGconn object without adequate interlocking. Our application is single-threaded, so it seems

Re: [GENERAL] High cpu usage after many inserts

2009-02-24 Thread Aidan Van Dyk
* Greg Smith gsm...@gregsmith.com [090201 00:00]: Shouldn't someone have ranted about RAID-5 by this point in the thread? What? Sorry, I wasn't paying attention... You mean someone's actually still using RAID-5? ;-) -- Aidan Van Dyk Create like a

[GENERAL] Indexing a Bit String column

2009-02-24 Thread George Oakman
Hi all, I am planning to use the Bit String data type for a large number of binary strings, e.g. CREATE TABLE myTable (myBitStringCol BIT(3)); I will need to perform (bitwise AND) operations using SELECT on this column, e.g. SELECT * FROM myTable WHERE myBitStringCol B'101' =

Re: [GENERAL] Oracle Functions to PostgreSQL

2009-02-24 Thread Martin Gainty
you're going to have alot of work as ANNOTATIONS and DATATYPES are different e.g. --- Postgres function which calcs geo_distance CREATE OR REPLACE FUNCTION geo_distance (point, point) RETURNS float8 LANGUAGE 'C' IMMUTABLE STRICT AS '$libdir/earthdistance'; --Oracle has no clue what

Re: [GENERAL] Indexing a Bit String column

2009-02-24 Thread Gregory Stark
George Oakman oakm...@hotmail.com writes: Is it all I need to do? Will PgSQL know how to index properly a Bit String column? Should I build the index using a special method, e.g. CREATE INDEX myBitStringCol_idx ON myTable USING gist(myBitStringCol); No, the default will be to build a

Re: [GENERAL] Indexing a Bit String column

2009-02-24 Thread Tom Lane
Gregory Stark st...@enterprisedb.com writes: Note that something like WHERE myBitStringCol B'101' might be selecting too much of your table to make an index useful anyways. If each bit is set in half the table then you're talking about selecting 3/4 of the table in which case a full table

Re: [GENERAL] Indexing a Bit String column

2009-02-24 Thread George Oakman
Hi, Thanks for the info. I new it would have been too easy! :) Sorry, I made a mistake earlier, my queries will actually be more like SELECT * FROM myTable WHERE myBitStringCol B'101' = B'101'; This doesn't make much difference for the indexing problem, but it may help address

[GENERAL] Warm standby failover mechanism

2009-02-24 Thread Thom Brown
Hi all, We're looking at setting up a warm-standby server using log shipping and aren't too sure about how we should trigger failover. Is there a commonly-used approach which is reliable enough to recommend? Looking at the documentation, there doesn't seem to be any recommendation. I

Re: [GENERAL] javascript and postgres

2009-02-24 Thread John R Pierce
野村 wrote: Web pages have username and password with basic, digest or ldap authorization. So if I createuser with same user and password, and if there is md5 or something to encode password, I wonder javascript connects to postgres securely. for that to work, irregardless of security

Re: [GENERAL] Warm standby failover mechanism

2009-02-24 Thread Simon Riggs
On Tue, 2009-02-24 at 16:55 +, Thom Brown wrote: We're looking at setting up a warm-standby server using log shipping and aren't too sure about how we should trigger failover. Is there a commonly-used approach which is reliable enough to recommend? Looking at the documentation, there

[GENERAL] Query question

2009-02-24 Thread Sharma, Sid
Hi, I am new to Postgres and am trying to write a query like the one below (without any luck) SELECT col_speed, col_time, (col_speed / col_time) AS distance FROM speed_ratings HAVING distance ? ORDER BY distance In other words, I want to filter on a calculated column. But I get an

Re: [GENERAL] Query question

2009-02-24 Thread Adam Rich
-Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general- ow...@postgresql.org] On Behalf Of Sharma, Sid Sent: Tuesday, February 24, 2009 12:47 PM To: pgsql-general@postgresql.org Subject: [GENERAL] Query question Hi, I am new to Postgres and am

Re: [GENERAL] speaking of 8.4...

2009-02-24 Thread Fujii Masao
Hi, On Tue, Feb 24, 2009 at 5:16 AM, John R Pierce pie...@hogranch.com wrote: is it looking like the simple replication will make it into 8.4? You mean the built-in synchronous replication feature? If so, no. It was decided that synch-rep will be postponed to 8.5. Regards, -- Fujii Masao

[GENERAL] Function parameter

2009-02-24 Thread Nico Callewaert
Hi ! I'm trying to modify an input parameter of a function, but I receive following error : ERROR: $17 is declared CONSTANT CONTEXT: compile of PL/pgSQL function update_jobreg near line 26 Is there a way to modify an input parameter or I have to declare a local variable and assign that

Re: [GENERAL] Poor select count(*) performance

2009-02-24 Thread Sam Mason
On Mon, Feb 23, 2009 at 11:21:16PM -0800, Mike Ivanov wrote: On Mon, Feb 23, 2009 at 6:54 PM, Sam Mason s...@samason.me.uk wrote: Depending on where these are on disk and how fast your disks are this could take up to 30 seconds. This does not sound very inspiring :-) It was calculated

Re: [GENERAL] High cpu usage after many inserts

2009-02-24 Thread Jordan Tomkinson
On Wed, Feb 25, 2009 at 12:05 AM, Aidan Van Dyk ai...@highrise.ca wrote: * Greg Smith gsm...@gregsmith.com [090201 00:00]: Shouldn't someone have ranted about RAID-5 by this point in the thread? What? Sorry, I wasn't paying attention... You mean someone's actually still using RAID-5?

Re: [GENERAL] High cpu usage after many inserts

2009-02-24 Thread Joshua D. Drake
On Wed, 2009-02-25 at 09:21 +0900, Jordan Tomkinson wrote: On Wed, Feb 25, 2009 at 12:05 AM, Aidan Van Dyk ai...@highrise.ca wrote: * Greg Smith gsm...@gregsmith.com [090201 00:00]: Shouldn't someone have ranted about RAID-5 by this point in the thread?

Re: [GENERAL] High cpu usage after many inserts

2009-02-24 Thread Greg Williamson
--- On Wed, 2/25/09, Jordan Tomkinson jor...@moodle.com wrote: ... What exactly is wrong with RAID5 and what should we have gone with? RAID10 is often used. As others have pointed out, it is very slow for random writes. It also has issues that expose your data to total loss, see for

Re: [GENERAL] High cpu usage after many inserts

2009-02-24 Thread Jordan Tomkinson
On Wed, Feb 25, 2009 at 9:23 AM, Joshua D. Drake j...@commandprompt.comwrote: RAID5 outside of RAID 0 is the worst possible RAID level to run with a database. (of the commonly used raid level's that is). It is very, very slow on random writes which is what databases do. Switch to RAID 10.

Re: [GENERAL] High cpu usage after many inserts

2009-02-24 Thread Scott Marlowe
On Tue, Feb 24, 2009 at 5:21 PM, Jordan Tomkinson jor...@moodle.com wrote: On Wed, Feb 25, 2009 at 12:05 AM, Aidan Van Dyk ai...@highrise.ca wrote: * Greg Smith gsm...@gregsmith.com [090201 00:00]: Shouldn't someone have ranted about RAID-5 by this point in the thread? What?  Sorry, I

Re: [GENERAL] Function parameter

2009-02-24 Thread John DeSoi
On Feb 24, 2009, at 5:10 PM, Nico Callewaert wrote: I'm trying to modify an input parameter of a function, but I receive following error : ERROR: $17 is declared CONSTANT CONTEXT: compile of PL/pgSQL function update_jobreg near line 26 Is there a way to modify an input parameter or I

Re: [GENERAL] High cpu usage after many inserts

2009-02-24 Thread Joshua D. Drake
On Wed, 2009-02-25 at 09:44 +0900, Jordan Tomkinson wrote: On Wed, Feb 25, 2009 at 9:23 AM, Joshua D. Drake j...@commandprompt.com wrote: RAID5 outside of RAID 0 is the worst possible RAID level to run with a database. (of the commonly used raid

Re: [GENERAL] High cpu usage after many inserts

2009-02-24 Thread Jordan Tomkinson
On Tue, Feb 24, 2009 at 4:40 PM, Jordan Tomkinson jor...@moodle.com wrote: taken before the ~7000 rows were entered. relation| size ---+ public.mdl_log| 595 MB public.mdl_forum_posts| 375 MB

Re: [GENERAL] High cpu usage after many inserts

2009-02-24 Thread Ron Mayer
Joshua D. Drake wrote: On Wed, 2009-02-25 at 09:21 +0900, Jordan Tomkinson wrote: On Wed, Feb 25, 2009 at 12:05 AM, Aidan Van Dyk ai...@highrise.ca wrote: * Greg Smith gsm...@gregsmith.com [090201 00:00]: Shouldn't someone have ranted about RAID-5 by this point in

Re: [GENERAL] Function parameter

2009-02-24 Thread Nico Callewaert
- Original Message - From: John DeSoi de...@pgedit.com To: Nico Callewaert callewaert.n...@telenet.be Cc: pgsql-general@postgresql.org Sent: Wednesday, February 25, 2009 1:52 AM Subject: Re: [GENERAL] Function parameter On Feb 24, 2009, at 5:10 PM, Nico Callewaert wrote: I'm trying