Re: [GENERAL] horizontal sharding

2009-06-28 Thread Greg Smith
On Fri, 26 Jun 2009, mobiledream...@gmail.com wrote: 2009-06-26 18:48:34 ERROR: pid 5563: pool_read_int: data does not match between between master(0) slot[1] (50331648) 2009-06-26 18:48:34 ERROR: pid 5563: pool_do_auth: read auth kind failed My guess is that you have different types of

Re: [GENERAL] Date math

2009-06-28 Thread Guy Flaherty
On Sun, Jun 28, 2009 at 2:52 PM, Joe Conway m...@joeconway.com wrote: Adam Rich wrote: Hello, I have a table with a DATE field birth_date. The data obviously contains various dates in the past, such as 07/04/1970. In my query, I need to retrieve the person's next birthday. In other

[GENERAL] Replication and coding good practices

2009-06-28 Thread Ivan Sergio Borgonovo
I'm starting to see the need of a replication solution in my horizon. I've learned that some replication solution require code modification, some require different assumption abut how connections behave... Are there any rules of thumb to consider for making an application easier to work with a

Re: [GENERAL] data modeling question

2009-06-28 Thread andy
Brandon Metcalf wrote: I asked a question similar to this a couple of weeks ago, but the requirement has changed a bit and I want to be sure I'm designing my tables correctly. I have the following table: CREATE TABLE workorder ( numberVARCHAR(8), quantity INTEGER, generic

Re: [GENERAL] Replication and coding good practices

2009-06-28 Thread David Fetter
On Sun, Jun 28, 2009 at 12:05:08PM +0200, Ivan Sergio Borgonovo wrote: I'm starting to see the need of a replication solution in my horizon. I've learned that some replication solution require code modification, some require different assumption abut how connections behave... Are there

Re: [GENERAL] Switching from MySQL: ON DUPLICATE KEY UPDATE, plpgsql function

2009-06-28 Thread APseudoUtopia
On Sat, Jun 27, 2009 at 9:13 PM, justinjus...@emproshunts.com wrote: APseudoUtopia wrote: Hey list, I have a query which allows users to Catch up on read posts on the forum. It works by either updating or inserting the last post read number from every forum thread into the readposts table

[GENERAL] partitioning question -- how to guarantee uniqueness across partitions

2009-06-28 Thread Whit Armstrong
I have a simple example copied from the 8.3 manual on partitioning (http://www.postgresql.org/docs/8.3/interactive/ddl-partitioning.html). My question is, if you create a serial type in the parent table which is meant to be the primary key across all the partitions, how does one guarantee

Re: [GENERAL] horizontal sharding

2009-06-28 Thread mobiledreamers
Thanks a lot greg trying it out If it does not work i ll post to pgpool groups thanks again but i think what you have pointed out is the right solution On Sat, Jun 27, 2009 at 10:59 PM, Greg Smith gsm...@gregsmith.com wrote: On Fri, 26 Jun 2009, mobiledream...@gmail.com wrote: 2009-06-26

Re: [GENERAL] Switching from MySQL: ON DUPLICATE KEY UPDATE, plpgsql function

2009-06-28 Thread Justin
APseudoUtopia wrote: thread, then logs out (intending to read all the other forum threads at some point in the future when they log in again). If I used a VIEW, it would automatically consider all those unread forum posts to be read when the user logs out. That wouldn't work. What if

Re: [GENERAL] partitioning question -- how to guarantee uniqueness across partitions

2009-06-28 Thread Tom Lane
Whit Armstrong armstrong.w...@gmail.com writes: I have a simple example copied from the 8.3 manual on partitioning (http://www.postgresql.org/docs/8.3/interactive/ddl-partitioning.html). My question is, if you create a serial type in the parent table which is meant to be the primary key

Re: [GENERAL] partitioning question -- how to guarantee uniqueness across partitions

2009-06-28 Thread Whit Armstrong
Thanks, Tom. Let me give a little more detail on my actual data rather than the simple example I sent. I have a 60GB table of loan balances, which I've partitioned into 26 tables. The loan id's are a sequence of 6 characters, so the partitioning rule I've used is the first character of the loan

[GENERAL] Re: partitioning question -- how to guarantee uniqueness across partitions

2009-06-28 Thread Arndt Lehmann
Hi Whit, you could consider using GUIDs instead of Integer for primary keys. Here is a nice blog post explaining how to do this in Rails:    http://ariejan.net/2008/08/12/ruby-on-rails-uuid-as-your-activerecord... Best Regards,   Arndt Lehmann just a note: As per above blog post, the GUID

[GENERAL] Re: partitioning question -- how to guarantee uniqueness across partitions

2009-06-28 Thread Arndt Lehmann
Hi Whit, you could consider using GUIDs instead of Integer for primary keys. Here is a nice blog post explaining how to do this in Rails:    http://ariejan.net/2008/08/12/ruby-on-rails-uuid-as-your-activerecord... Best Regards,   Arndt Lehmann just a note: As per above blog post, the GUID

[GENERAL] Re: partitioning question -- how to guarantee uniqueness across partitions

2009-06-28 Thread Arndt Lehmann
On Jun 29, 3:45 am, armstrong.w...@gmail.com (Whit Armstrong) wrote: Thanks, Tom. Let me give a little more detail on my actual data rather than the simple example I sent. I have a 60GB table of loan balances, which I've partitioned into 26 tables. The loan id's are a sequence of 6

[GENERAL] another can't connect

2009-06-28 Thread BJ Freeman
PostgreSQL version 8.1.11 (With schemas) I have read the recent emails and believe I have covered all the bases from net stat tcp0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 5091/postmaster I do a psql -h 127.0.0.1 -U ofbiz -d ofbiz from a terminal on the server. and

Re: [GENERAL] another can't connect

2009-06-28 Thread Chris
BJ Freeman wrote: PostgreSQL version 8.1.11 (With schemas) I have read the recent emails and believe I have covered all the bases from net stat tcp0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 5091/postmaster I do a psql -h 127.0.0.1 -U ofbiz -d ofbiz from a terminal

Re: [GENERAL] another can't connect

2009-06-28 Thread BJ Freeman
tcp0 0 127.0.0.1:5432 0.0.0.0:* LISTEN is the only line for that port Chris sent the following on 6/28/2009 7:33 PM: BJ Freeman wrote: PostgreSQL version 8.1.11 (With schemas) I have read the recent emails and believe I have covered all the bases from net stat

Re: [GENERAL] another can't connect

2009-06-28 Thread Chris
Please don't top-post, it's so hard to follow discussions. Chris sent the following on 6/28/2009 7:33 PM: BJ Freeman wrote: PostgreSQL version 8.1.11 (With schemas) I have read the recent emails and believe I have covered all the bases from net stat tcp0 0 127.0.0.1:5432

Re: [GENERAL] another can't connect

2009-06-28 Thread Andrej
2009/6/29 BJ Freeman bjf...@free-man.net: ACCEPT tcp -- localhostlocalhost tcp dpt:postgres state NEW What about established connections? tcp0 0 127.0.0.1:5432 0.0.0.0:* LISTEN is the only line for that port I think Chris meant What

Re: [GENERAL] another can't connect

2009-06-28 Thread BJ Freeman
sorry about the post did not do a reply all and sent a personal replay yes in the chain I have ACCEPT all -- anywhere anywherestate RELATED,ESTABLISHED it is the next to last rule. Andrej sent the following on 6/28/2009 8:14 PM: 2009/6/29 BJ Freeman

[GENERAL] Copying only incremental records to another DB..

2009-06-28 Thread Phoenix Kiula
Hi We're trying PG on a new machine, so we copied our current (live) database to that server. Tested the code and it's all working. Now, to make that second server the main live server, we will need to copy the db again including the new records since we copied for testing. Is there any way to

Re: [GENERAL] Copying only incremental records to another DB..

2009-06-28 Thread Arndt Lehmann
On Jun 29, 1:10 pm, phoenix.ki...@gmail.com (Phoenix Kiula) wrote: Hi We're trying PG on a new machine, so we copied our current (live) database to that server. Tested the code and it's all working. Now, to make that second server the main live server, we will need to copy the db again