[GENERAL] Poor performance of btrfs with Postgresql

2011-04-21 Thread Toby Corkindale
I've done some testing of PostgreSQL on different filesystems, and with different filesystem mount options. I found that xfs and ext4 both performed similarly, with ext4 just a few percent faster; and I found that adjusting the mount options only gave small improvements, except for the

Re: [GENERAL] how to force an insert before Raise Exception?

2011-04-21 Thread Craig Ringer
On 19/04/11 21:39, giova wrote: Hi. I made a function that Raise exception with some conditions. No problem with that, it is the goal. My problem is that i want to do an INSERT into a log table before to raise the exception. But RAISE EXCEPTION cancels my Insert. How to force the

Re: [GENERAL] Questions about Partitioning

2011-04-21 Thread Craig Ringer
On 19/04/11 23:56, Phoenix Kiula wrote: While I fix some bigger DB woes, I have learned a lesson. Huge indexes and tables are a pain. Which makes me doubly keen on looking at partitioning. Most examples I see online are partitioned by date. As in months, or quarter, and so on. This

Re: [GENERAL] Needs Suggestion

2011-04-21 Thread Alban Hertroys
On 20 Apr 2011, at 19:11, SUBHAM ROY wrote: By doing \timing in psql, we enable the timing and then when we type the query we are able to see its execution time. Similarly, is there any way to view the number I/Os and memory usage by a particular query. You seem to be unfamiliar with the

Re: [GENERAL] Poor performance of btrfs with Postgresql

2011-04-21 Thread Merlin Moncure
On Thu, Apr 21, 2011 at 2:22 AM, Toby Corkindale toby.corkind...@strategicdata.com.au wrote: I've done some testing of PostgreSQL on different filesystems, and with different filesystem mount options. I found that xfs and ext4 both performed similarly, with ext4 just a few percent faster; and

Re: [GENERAL] Poor performance of btrfs with Postgresql

2011-04-21 Thread Toby Corkindale
On 21/04/11 17:28, Merlin Moncure wrote: On Thu, Apr 21, 2011 at 2:22 AM, Toby Corkindale toby.corkind...@strategicdata.com.au wrote: I've done some testing of PostgreSQL on different filesystems, and with different filesystem mount options. I found that xfs and ext4 both performed similarly,

Re: [GENERAL] Poor performance of btrfs with Postgresql

2011-04-21 Thread Henry C.
I've done some testing of PostgreSQL on different filesystems, and with different filesystem mount options. Since Pg is already journalling, why bother duplicating (and pay the performance penalty, whatever that penalty may be) the effort for no real gain (except maybe a redundant sense of

[GENERAL] Which version of postgresql supports replication on RHEL6?

2011-04-21 Thread Tiruvenkatasamy Baskaran
Hi, Which version of postgresql supports replication on RHEL6? RHEL version : 2.6.32-71.el6.x86_64 Regards, Tiru ::DISCLAIMER:: --- The

Re: [GENERAL] Which version of postgresql supports replication on RHEL6?

2011-04-21 Thread Vibhor Kumar
On Apr 21, 2011, at 4:42 PM, Tiruvenkatasamy Baskaran wrote: Which version of postgresql supports replication on RHEL6? RHEL version : 2.6.32-71.el6.x86_64 If you are talking about inbuld replication, then from PG9.0 onwards. Else slony-I replication tool is available for replication of

Re: [GENERAL] problem with parent/child table and FKs

2011-04-21 Thread Karsten Hilbert
Does anyone have any suggestions regarding the below ? Thanks, Karsten On Mon, Apr 18, 2011 at 03:53:16PM +0200, Karsten Hilbert wrote: Hello all, since (according to the docs) PostgreSQL does not propagate INSERTs from child tables unto parent tables the below does not work,

[GENERAL] Defining input function for new datatype

2011-04-21 Thread Nick Raj
Hi, I am defining a new data type called mpoint i.e. typedef struct mpoint { Point p; Timestamp t; } mpoint; For defining input/output function 1 Datum mpoint_in(PG_FUNCTION_ARGS) 2 { 3 4mpoint *result; 5char *pnt=(char *)malloc (sizeof (20)); 6char

Re: [GENERAL] Installing PGDG on a fresh CentOS 5.6

2011-04-21 Thread Alexander Farber
Thank you Tom, yum install postgresql84 has worked for CentOS 5.6/64 bit -- 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] Different views of remote server

2011-04-21 Thread Bob Pawley
Hi Adrian I looked at the table in JEdit. The binary strings for the missing fields are considerably longer than the others. What limiting factor have I probably exceeded?? Bob -Original Message- From: Adrian Klaver Sent: Wednesday, April 20, 2011 4:14 PM To:

Re: [GENERAL] problem with parent/child table and FKs

2011-04-21 Thread Karsten Hilbert
On Thu, Apr 21, 2011 at 01:36:51PM +0200, Karsten Hilbert wrote: Does anyone have any suggestions regarding the below ? If you guys happen to think this could be a please-do-my-class-assignment-for-me question -- I'd be glad to read up on things if someone clues me in on the relevant keywords

Re: [GENERAL] [HACKERS] Defining input function for new datatype

2011-04-21 Thread Pavel Stehule
Hello 2011/4/21 Nick Raj nickrajj...@gmail.com: Hi, I am defining a new data type called mpoint i.e. typedef struct mpoint {     Point p;     Timestamp t; } mpoint; For defining input/output function 1 Datum mpoint_in(PG_FUNCTION_ARGS) 2 { 3 4    mpoint *result; 5  

Re: [GENERAL] Poor performance of btrfs with Postgresql

2011-04-21 Thread Andres Freund
On Thursday, April 21, 2011 12:16:04 PM Henry C. wrote: I've done some testing of PostgreSQL on different filesystems, and with different filesystem mount options. Since Pg is already journalling, why bother duplicating (and pay the performance penalty, whatever that penalty may be) the

Re: [GENERAL] Which version of postgresql supports replication on RHEL6?

2011-04-21 Thread Tiruvenkatasamy Baskaran
Hi Vibhor Kumar, We downloaded postgresql-9.0.4.tar source from postgresql.org. We installed postgresql db from source on machine1(master) and machine2(slave). RHEL version : 2.6.32-71.el6.x86_64 In order to enable replication between master and slave, we did necessary

Re: [GENERAL] Which version of postgresql supports replication on RHEL6?

2011-04-21 Thread Vibhor Kumar
On Apr 21, 2011, at 6:35 PM, Tiruvenkatasamy Baskaran wrote: Got the following messages in log file on the master DB. LOG: database system was shut down at 2011-04-01 14:27:37 IST LOG: database system is ready to accept connections LOG: autovacuum launcher started LOG: replication

[GENERAL] Which version of postgresql supports replication on RHEL6?

2011-04-21 Thread Tiruvenkatasamy Baskaran
HI, Which version of postgresql supports replication on RHEL6? RHEL version : 2.6.32-71.el6.x86_64 Regards, Tiru ::DISCLAIMER:: --- The

Re: [GENERAL] Which version of postgresql supports replication on RHEL6?

2011-04-21 Thread Vibhor Kumar
On Apr 21, 2011, at 4:23 PM, Tiruvenkatasamy Baskaran wrote: Which version of postgresql supports replication on RHEL6? RHEL version : 2.6.32-71.el6.x86_64 Why are you re-posting your question, if it has been answered? Thanks Regards, Vibhor Kumar Blog:http://vibhork.blogspot.com --

Re: [GENERAL] Different views of remote server

2011-04-21 Thread Adrian Klaver
On Thursday, April 21, 2011 5:20:13 am Bob Pawley wrote: Hi Adrian I looked at the table in JEdit. The binary strings for the missing fields are considerably longer than the others. What limiting factor have I probably exceeded?? Per Scotts post, are you sure you are only looking at one

Re: [GENERAL] Trouble loading Perl modules from postgresql.conf

2011-04-21 Thread Chris Greenhill
Just an update for those interested. I found an insecure work around for pre-loading any modules I may need by editing the sitecustomize.pl file, essentially adding any use's and requires I need. As I said, probably not secure since I hear there's been issues with sitecustomize.pl From:

Re: [GENERAL] Defining input function for new datatype

2011-04-21 Thread Tom Lane
Nick Raj nickrajj...@gmail.com writes: 1 Datum mpoint_in(PG_FUNCTION_ARGS) 2 { 3 4mpoint *result; 5char *pnt=(char *)malloc (sizeof (20)); 6char *ts=(char *)malloc (sizeof (20)); (1) You should *not* use malloc here. There is seldom any reason to use malloc

Re: [GENERAL] SSDs with Postgresql?

2011-04-21 Thread Greg Smith
On 04/20/2011 01:50 AM, Toby Corkindale wrote: Also, the number of erase cycles you can get, over the whole disk, is quite large on modern disks! So large that you'll probably go decades before you wear the disk out, even with continual writes. Don't buy into the SSD FUD myths.. There is

Re: [GENERAL] problem with parent/child table and FKs

2011-04-21 Thread Adrian Klaver
On Thursday, April 21, 2011 4:36:51 am Karsten Hilbert wrote: Does anyone have any suggestions regarding the below ? The only thing I can come up with is to eliminate the FK : fk_code integer not null references code_root(pk_code_root) on update restrict

[GENERAL] Re: [ADMIN] How to uninstall PostgreSQL 8.4 on both Windows XP and Windows 7

2011-04-21 Thread Kevin Grittner
Mlondolozi Ncapayi mlon...@gmail.com wrote: I installed PostgreSql 8.4 and now I want to delete/ uninstall it completely to start a new fresh installation. Can you please give me clear instructions on how to do that or maybe a script that I can run. That's going to depend entirely on how

Re: [GENERAL] SSDs with Postgresql?

2011-04-21 Thread Florian Weimer
* Greg Smith: The fact that every row update can temporarily use more than 8K means that actual write throughput on the WAL can be shockingly large. The smallest customer I work with regularly has a 50GB database, yet they write 20GB of WAL every day. You can imagine how much WAL is

Re: [GENERAL] SSDs with Postgresql?

2011-04-21 Thread Adrian Klaver
On Thursday, April 21, 2011 8:33:45 am Florian Weimer wrote: * Greg Smith: The fact that every row update can temporarily use more than 8K means that actual write throughput on the WAL can be shockingly large. The smallest customer I work with regularly has a 50GB database, yet they

Re: [GENERAL] SSDs with Postgresql?

2011-04-21 Thread Florian Weimer
* Adrian Klaver: Interesting. Is there an easy way to monitor WAL traffic in away? It does not have to be finegrained, but it might be helpful to know if we're doing 10 GB, 100 GB or 1 TB of WAL traffic on a particular database, should the question of SSDs ever come up. They are found in

Re: [GENERAL] How to realize ROW_NUMBER() in 8.3?

2011-04-21 Thread David Fetter
On Wed, Apr 20, 2011 at 11:51:25AM -0400, Emi Lu wrote: Hello, ROW_NUMBER() is only ready in 8.4. For 8.3, is there a simple way to get row_number select row_number(), col1, col2... FROM tableName Thanks a lot! 丁叶 Your best bet is to upgrade to a modern version of PostgreSQL.

Re: [GENERAL] SSDs with Postgresql?

2011-04-21 Thread Scott Ribe
On Apr 21, 2011, at 9:44 AM, Florian Weimer wrote: But log files are recycled, so looking at the directory alone does not seem particularly helpful. You have to look at the file timestamps. From that you can get an idea of traffic. -- Scott Ribe scott_r...@elevated-dev.com

Re: [GENERAL] SSDs with Postgresql?

2011-04-21 Thread Greg Smith
On 04/21/2011 11:33 AM, Florian Weimer wrote: Is there an easy way to monitor WAL traffic in away? It does not have to be finegrained, but it might be helpful to know if we're doing 10 GB, 100 GB or 1 TB of WAL traffic on a particular database, should the question of SSDs ever come up. You

Re: [GENERAL] SSDs with Postgresql?

2011-04-21 Thread Tom Lane
Florian Weimer fwei...@bfk.de writes: * Adrian Klaver: Interesting. Is there an easy way to monitor WAL traffic in away? They are found in $DATA/pg_xlog so checking the size of that directory regularly would get you the information. But log files are recycled, so looking at the directory

Re: [GENERAL] Different views of remote server

2011-04-21 Thread Bob Pawley
Hi Scott According to NSAuditor(www.nsauditor.com) there is only one server with port 5432. When I enter information into the remote database it shows up on the same database that has this problem. How do I determine my 'connection credentials'? Bob -Original Message- From:

Re: [GENERAL] Help - corruption issue?

2011-04-21 Thread Tomas Vondra
Dne 21.4.2011 07:16, Phoenix Kiula napsal(a): Tomas, I did a crash log with the strace for PID of the index command as you suggested. Here's the output: http://www.heypasteit.com/clip/WNR Also including below, but because this will wrap etc, you can look at the link above. Thanks

Re: [GENERAL] How to realize ROW_NUMBER() in 8.3?

2011-04-21 Thread raghu ram
On Thu, Apr 21, 2011 at 9:19 PM, David Fetter da...@fetter.org wrote: On Wed, Apr 20, 2011 at 11:51:25AM -0400, Emi Lu wrote: Hello, ROW_NUMBER() is only ready in 8.4. For 8.3, is there a simple way to get row_number select row_number(), col1, col2... FROM tableName Thanks a

Re: [GENERAL] problem with parent/child table and FKs

2011-04-21 Thread Alban Hertroys
On 18 Apr 2011, at 15:53, Karsten Hilbert wrote: What is the suggested approach for this situation ? (there will be more tables like icd10 holding other coding systems of fairly diverse nature but all of them sharing .code and .term: LOINC, ATC, ICPC-2, ICD-9, ...). I think your best bet is

Re: [GENERAL] How to realize ROW_NUMBER() in 8.3?

2011-04-21 Thread hubert depesz lubaczewski
On Wed, Apr 20, 2011 at 09:27:18PM +0530, raghu ram wrote: On Wed, Apr 20, 2011 at 9:21 PM, Emi Lu em...@encs.concordia.ca wrote: Hello, ROW_NUMBER() is only ready in 8.4. For 8.3, is there a simple way to get row_number select row_number(), col1, col2... FROM tableName

Re: [GENERAL] problem with parent/child table and FKs

2011-04-21 Thread Karsten Hilbert
On Thu, Apr 21, 2011 at 07:53:04AM -0700, Adrian Klaver wrote: On Thursday, April 21, 2011 4:36:51 am Karsten Hilbert wrote: Does anyone have any suggestions regarding the below ? The only thing I can come up with is to eliminate the FK : fk_code integer not null

Re: [GENERAL] Poor performance of btrfs with Postgresql

2011-04-21 Thread Greg Smith
On 04/21/2011 06:16 AM, Henry C. wrote: Since Pg is already journalling, why bother duplicating (and pay the performance penalty, whatever that penalty may be) the effort for no real gain (except maybe a redundant sense of safety)? ie, use a non-journalling battle-tested fs like ext2. The

Re: [GENERAL] problem with parent/child table and FKs

2011-04-21 Thread Karsten Hilbert
On Thu, Apr 21, 2011 at 07:15:38PM +0200, Alban Hertroys wrote: BTW, do you really need those artificial PK's? If not, you may well be better off dropping them. That way (code, term) could be your PK instead. I don't know enough about your data to make more than a guess though, I just get

[GENERAL] getting EXPLAIN output from inside a function

2011-04-21 Thread Joseph S
I saw this in the mailing list archives without an answer, so for future reference: DECLARE ... line TEXT; BEGIN ... FOR line IN EXECUTE ''EXPLAIN ANALYZE statement goes here LOOP RAISE NOTICE ''% '' , line; END LOOP; -- Sent via pgsql-general mailing

Re: [GENERAL] SSDs with Postgresql?

2011-04-21 Thread Scott Marlowe
On Thu, Apr 21, 2011 at 11:22 AM, Tom Lane t...@sss.pgh.pa.us wrote: Florian Weimer fwei...@bfk.de writes: * Adrian Klaver: Interesting.  Is there an easy way to monitor WAL traffic in away? They are found in $DATA/pg_xlog so checking the size of that directory regularly would get you the

Re: [GENERAL] Poor performance of btrfs with Postgresql

2011-04-21 Thread Greg Smith
On 04/21/2011 02:22 AM, Toby Corkindale wrote: I also tested btrfs, and was disappointed to see it performed *dreadfully* - even with the recommended options for database loads. Best TPS I could get out of ext4 on the test machine was 2392 TPS, but btrfs gave me just 69! This is appalling

[GENERAL] Re: Column storage (EXTERNAL/EXTENDED) settings for bytea/text column

2011-04-21 Thread Noah Misch
On Mon, Apr 11, 2011 at 03:19:23PM -0700, Joel Stevenson wrote: I'm trying to do some comparisons between the EXTERNAL and the EXTENDED storage methods on a bytea column and from the outside the setting doesn't appear to affect the value stored on initial insert, but perhaps I'm looking at

Re: [GENERAL] Different views of remote server

2011-04-21 Thread Adrian Klaver
On Thursday, April 21, 2011 9:24:57 am Bob Pawley wrote: Hi Scott According to NSAuditor(www.nsauditor.com) there is only one server with port 5432. When I enter information into the remote database it shows up on the same database that has this problem. How do I determine my

Re: [GENERAL] Poor performance of btrfs with Postgresql

2011-04-21 Thread mark
-Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general- ow...@postgresql.org] On Behalf Of Toby Corkindale Sent: Thursday, April 21, 2011 12:22 AM To: luv-main; pgsql-general@postgresql.org Subject: [GENERAL] Poor performance of btrfs with Postgresql

Re: [GENERAL] Help - corruption issue?

2011-04-21 Thread Phoenix Kiula
On Fri, Apr 22, 2011 at 12:51 AM, Tomas Vondra t...@fuzzy.cz wrote: Dne 21.4.2011 07:16, Phoenix Kiula napsal(a): Tomas, I did a crash log with the strace for PID of the index command as you suggested. Here's the output: http://www.heypasteit.com/clip/WNR Also including below, but

Re: [GENERAL] Help - corruption issue?

2011-04-21 Thread Phoenix Kiula
On Fri, Apr 22, 2011 at 12:06 PM, Phoenix Kiula phoenix.ki...@gmail.com wrote: On Fri, Apr 22, 2011 at 12:51 AM, Tomas Vondra t...@fuzzy.cz wrote: Dne 21.4.2011 07:16, Phoenix Kiula napsal(a): Tomas, I did a crash log with the strace for PID of the index command as you suggested. Here's