Re: [GENERAL] Function parameter

2009-02-24 Thread Nico Callewaert
- Original Message - From: "John DeSoi" To: "Nico Callewaert" Cc: 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 to modify an input parameter of a function, but I receive followin

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 >> wrote: >> * Greg Smith [090201 00:00]: >> > Shouldn't someone have ranted about RAID-5 by this point in >> the thread? >> You m

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 wrote: > taken before the ~7000 rows were entered. > >relation| size > ---+ > public.mdl_log| 595 MB > public.mdl_forum_posts| 375 MB > public.mdl_log_coumodac

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 > wrote: > > > RAID5 outside of RAID 0 is the worst possible RAID level to > run with a > database. (of the commonly used raid level's that

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 Scott Marlowe
On Tue, Feb 24, 2009 at 5:21 PM, Jordan Tomkinson wrote: > > On Wed, Feb 25, 2009 at 12:05 AM, Aidan Van Dyk wrote: >> >> * Greg Smith [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 s

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 wrote: > > 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. > surely being (r

Re: [GENERAL] High cpu usage after many inserts

2009-02-24 Thread Greg Williamson
--- On Wed, 2/25/09, Jordan Tomkinson 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 instance

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 > wrote: > * Greg Smith [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 Jordan Tomkinson
On Wed, Feb 25, 2009 at 12:05 AM, Aidan Van Dyk wrote: > * Greg Smith [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? > > ;-) What exactly is wrong w

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 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 with a pessimis

[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] speaking of 8.4...

2009-02-24 Thread Fujii Masao
Hi, On Tue, Feb 24, 2009 at 5:16 AM, John R Pierce 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 NIPPON TELEGRAPH AND T

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

[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] 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, ther

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 a

[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 preferrabl

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

Re: [GENERAL] Indexing a Bit String column

2009-02-24 Thread Tom Lane
Gregory Stark 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 scan would be more

Re: [GENERAL] Indexing a Bit String column

2009-02-24 Thread Gregory Stark
George Oakman 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 btree index which

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

[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' = myB

Re: [GENERAL] High cpu usage after many inserts

2009-02-24 Thread Aidan Van Dyk
* Greg Smith [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 god, ai...@highrise

Re: [GENERAL] Large object loading stalls

2009-02-24 Thread Tom Lane
Michael Akinde 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 unlikely that we a

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

[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] 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 http://momjia

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

[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] 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 w

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 passwo

Re: [GENERAL] Large object loading stalls

2009-02-24 Thread Michael Akinde
Tom Lane wrote: Michael Akinde writes: Anyway - the situation now is that just the loading process is hanging on the server, with an in transaction. But it is definitely the loading program that is hanging, not the Postgres server. What the stack traces seem to show is that both the

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 wrote: > > > On Tue, Feb 24, 2009 at 11:42 AM, Greg Smith 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 in the >> process.  The script