Re: [GENERAL] help replacing expresion in plpgsql

2013-12-18 Thread Albe Laurenz
Juan Pablo L wrote: Hi, i have a function that receives a parameter which represents days: FUNCTION aaa_recharge_account(expdays integer) i want to add those days to the CURRENT_DATE, but i do not know how to do it, i have tried several ways to replace that in an expresion like:

Re: [GENERAL] Bus error in libxml2 in postgresql 9.2.x on FreeBSD

2013-12-18 Thread Achilleas Mantzios
Hello Steve, this reminds me the problems i had when trying to install pl/java in postgresql 9.2 FreeBSD : http://lists.freebsd.org/pipermail/freebsd-java/2013-February/010019.html http://lists.freebsd.org/pipermail/freebsd-java/2013-February/010021.html

[GENERAL] Multi Master Replication

2013-12-18 Thread itishree sukla
Hi all, I need suggestion about setting up multi master replication between two postgresql server place two different geographical area. As i know using some third party tool like Bucardo,RubyRep it can be achievable, not sue which is the good one to use. If any one can provide me some online

[GENERAL] anyrecord/anyelement escaping question.

2013-12-18 Thread Marc Mamin
Hello, I'd like to store some special record of a list of tables in a single table for later reimport: e.g.: table t1 (a int, b int) table t2 (c int, t varchar) myTable (tsource text trecord text): t1, (1,2) t1, (3,18) t2, (1,'a b') Later I will be able to populate t1 or t2 tables using

Re: [GENERAL] Replication: GZIP compression in WAL sender/receiver processes communication?

2013-12-18 Thread Rahila Syed
Hello, Yes gzip compression can be used for compressing WAL traffic during streaming replication Following tools can be used in this regard. SSL compression-SSL support is built in PostgreSQL. You need to ensure you have OpenSSL library support in your PostgreSQL installation. Also, you can

[GENERAL] Foreign keys

2013-12-18 Thread Dean Gibson (DB Administrator)
I have general question about FOREIGN KEYs: 1. Suppose I have table A with primary key X, and another table B with field Y. 2. When I 'ALTER TABLE B ADD FOREIGN KEY( Y ) REFERENCES A ON UPDATE CASCADE ON DELETE CASCADE', that clearly spends some time building a separate index.

Re: [GENERAL] Foreign keys

2013-12-18 Thread Rob Sargent
On 12/18/2013 11:02 AM, Dean Gibson (DB Administrator) wrote: I have general question about FOREIGN KEYs: 1. Suppose I have table A with primary key X, and another table B with field Y. 2. When I 'ALTER TABLE B ADD FOREIGN KEY( Y ) REFERENCES A ON UPDATE CASCADE ON DELETE

Re: [GENERAL] Foreign keys

2013-12-18 Thread Kevin Grittner
Dean Gibson (DB Administrator) postgre...@ultimeth.com wrote: I have general question about FOREIGN KEYs:     1. Suppose I have table A with primary key X, and another    table B with field Y.     2. When I 'ALTER TABLE B  ADD FOREIGN KEY( Y )  REFERENCES    A  ON UPDATE CASCADE  ON

[GENERAL] Replication failed after stalling

2013-12-18 Thread Joe Van Dyk
I'm running Postgresql 9.3. I have a streaming replication server. Someone was running a long COPY query (8 hours) on the standby which halted replication. The replication stopped at 3:30 am. I canceled the long-running query at 9:30 am and replication data started catching up. The data up until

Re: [GENERAL] Foreign keys

2013-12-18 Thread Dean Gibson (DB Administrator)
On 2013-12-18 10:41, Kevin Grittner wrote: Dean Gibson (DB Administrator) postgre...@ultimeth.com wrote: ... that clearly spends some time building a separate index. No it doesn't. If you are observing activity at that time, it is probably from validating that the constraint is initially

Re: [GENERAL] Replication failed after stalling

2013-12-18 Thread Joe Van Dyk
A possibly related question: I've set wal_keep_segments to 10,000 and also have archive_command running wal-e. I'm seeing my wal files disappear from pg_xlog after 30 minutes. Is that expected? Is there a way around that? (I want to use streaming replication and wal-e for PITR restores) On

Re: [GENERAL] Multi Master Replication

2013-12-18 Thread John R Pierce
On 12/18/2013 1:31 AM, itishree sukla wrote: I need suggestion about setting up multi master replication between two postgresql server place two different geographical area. As i know using some third party tool like Bucardo,RubyRep it can be achievable, not sue which is the good one to use.

Re: [GENERAL] Replication failed after stalling

2013-12-18 Thread Jerry Sievers
Joe Van Dyk j...@tanga.com writes: I'm running Postgresql 9.3. I have a streaming replication server. Someone was running a long COPY query (8 hours) on the standby which halted replication. The replication stopped at 3:30 am. I canceled the long-running query at 9:30 am and replication

Re: [GENERAL] Replication failed after stalling

2013-12-18 Thread Adrian Klaver
On 12/18/2013 12:15 PM, Joe Van Dyk wrote: A possibly related question: I've set wal_keep_segments to 10,000 and also have archive_command running wal-e. I'm seeing my wal files disappear from pg_xlog after 30 minutes. Is that expected? Is there a way around that? Well a WAL segment is 16MB

Re: [GENERAL] Question(s) about crosstab

2013-12-18 Thread John Abraham
Regarding crosstab, yes it's basically too complicated to use directly. Here are the options: 1) write code (in another language, perhaps) to create your cross tab queries by inspecting the tables, which then submits those queries to create views. We have a web-app in django/python that will

Re: [GENERAL] Question(s) about crosstab

2013-12-18 Thread Joe Conway
On 12/18/2013 03:32 PM, John Abraham wrote: Regarding crosstab, yes it's basically too complicated to use directly. Here are the options: 1) write code (in another language, perhaps) to create your cross tab queries by inspecting the tables, which then submits those queries to create views.

Re: [GENERAL] Question(s) about crosstab

2013-12-18 Thread Sergey Konoplev
On Tue, Dec 17, 2013 at 3:31 PM, Ken Tanzer ken.tan...@gmail.com wrote: 1) Is there a simpler way? I'm hoping I made this unnecessarily cumbersome and complicated. 2) AFAICT, if a new unit type were to be added, I'd have to rewrite this query. Is there any way to avoid that? 3) It

Re: [GENERAL] Multi Master Replication

2013-12-18 Thread Scott Marlowe
On Wed, Dec 18, 2013 at 1:16 PM, John R Pierce pie...@hogranch.com wrote: On 12/18/2013 1:31 AM, itishree sukla wrote: I need suggestion about setting up multi master replication between two postgresql server place two different geographical area. As i know using some third party tool like

Re: [GENERAL] Question(s) about crosstab

2013-12-18 Thread John Abraham
On Dec 18, 2013, at 3:52 PM, Joe Conway m...@joeconway.com wrote: 3) Can't someone write a pl language routine that does it better? I'd be willing to work on the core functionality in python if someone else would be willing to embed it in plpython (I've never used plpython.) 3) Not

Re: [GENERAL] Question(s) about crosstab

2013-12-18 Thread AI Rumman
Hi, Once I faced the same problem of adding new type and reqriting the query working with crosstab function. Then I created a dynamic crosstab function. You may have a look at it if it work out for you: http://www.rummandba.com/2013/03/postgresql-dynamic-crosstab-function.html Thanks. On Tue,

Re: [GENERAL] Replication failed after stalling

2013-12-18 Thread Sergey Konoplev
On Wed, Dec 18, 2013 at 11:26 AM, Joe Van Dyk j...@tanga.com wrote: I'm running Postgresql 9.3. I have a streaming replication server. Someone was running a long COPY query (8 hours) on the standby which halted replication. The replication stopped at 3:30 am. I canceled the long-running query

Re: [GENERAL] Question(s) about crosstab

2013-12-18 Thread Joe Conway
On 12/18/2013 05:14 PM, John Abraham wrote: On Dec 18, 2013, at 3:52 PM, Joe Conway m...@joeconway.com wrote: 3) Not possible -- reason was given down thread. Column definition must be known/determinable by the parser prior to query execution. No, wait, I think you misunderstood my idea.

[GENERAL] unexpected pageaddr error in db log

2013-12-18 Thread wd
hi, We have upgrade our database from PostgreSQL 9.2.4 to 9.3.2, use dump restore in a fresh db created by initdb. Then use pg_basebackup created 2 slave db, the error occur when start the database. db1 [2013-12-19 04:00:56.882 CST 17956 52b1fef8.4624 1 0]LOG: database system was

Re: [GENERAL] Multi Master Replication

2013-12-18 Thread Michael Paquier
On Thu, Dec 19, 2013 at 7:12 AM, Scott Marlowe scott.marl...@gmail.com wrote: On Wed, Dec 18, 2013 at 1:16 PM, John R Pierce pie...@hogranch.com wrote: that sort of replication is very problematic. its virtually impossible to maintain ACID (Atomicity, Consistency, Isolation, Durability) and

[GENERAL] Installed postgres.app 9.3.1.0. pgadmin doesn't appear to see it

2013-12-18 Thread Bob Futrelle
I uninstalled 9.2 before installing 9.3.1.0. The app is called Postgres93, it is version 9.3.1.0 I downloaded the latest pgAdmin, it is pgAdmin3 version 1.18.1 I have a database MiniServer which is supposed to use postgres as its Maintenance database. But there is no such database. Perhaps it

Re: [GENERAL] Multi Master Replication

2013-12-18 Thread Scott Marlowe
On Wed, Dec 18, 2013 at 10:25 PM, Michael Paquier michael.paqu...@gmail.com wrote: On Thu, Dec 19, 2013 at 7:12 AM, Scott Marlowe scott.marl...@gmail.com wrote: When people start talking multi-master replication my first response is to ask what problem you're trying to solve. Sometimes MM

Re: [GENERAL] unexpected pageaddr error in db log

2013-12-18 Thread Amit Langote
On Thu, Dec 19, 2013 at 12:25 PM, wd w...@wdicc.com wrote: hi, We have upgrade our database from PostgreSQL 9.2.4 to 9.3.2, use dump restore in a fresh db created by initdb. Then use pg_basebackup created 2 slave db, the error occur when start the database. db1 [2013-12-19

Re: [GENERAL] Multi Master Replication

2013-12-18 Thread Michael Paquier
On Thu, Dec 19, 2013 at 2:05 PM, Scott Marlowe scott.marl...@gmail.com wrote: Sharding with plproxy is pretty easy and can scale hugely. Yeah indeed, the writable postgres_fdw could also be used as a solution, if designed carefully. -- Michael -- Sent via pgsql-general mailing list

Re: [GENERAL] Multi Master Replication

2013-12-18 Thread Chris Travers
On Wed, Dec 18, 2013 at 1:31 AM, itishree sukla itishree.su...@gmail.comwrote: Hi all, I need suggestion about setting up multi master replication between two postgresql server place two different geographical area. As i know using some third party tool like Bucardo,RubyRep it can be