Re: [GENERAL] High Availability

2016-07-20 Thread Tatsuo Ishii
> On 07/20/2016 11:53 AM, dangal wrote: >> >> Dear , I have a question for them , in our work we have an environment >> with >> streaming replication and everything works in the best way , we are >> trying >> to implement high availability and for that we try to use pgpool and >> we >> could not

Re: [GENERAL] upsert with trigger (or rule)

2016-07-20 Thread Adrian Klaver
On 07/20/2016 12:54 PM, Maeldron T. wrote: On 19/07/16 23:45, Adrian Klaver wrote: To be more complete it would nice to see the schema definition for the table messages. Also maybe some idea of what you the code is supposed to do. If I understand it correctly: 1) Check if a message is a

Re: [GENERAL] Is it possible to control the location of the lock file when starting postgres?

2016-07-20 Thread rob stone
On Thu, 2016-07-21 at 00:12 +, Steve Langlois wrote: > > > On Jul 20, 2016, at 7:48 PM, Steve Langlois > om> wrote: > > > > > you never did answer my previous question, why are you messing > > > about with manually starting postgres from the wrong user > > >

Re: [GENERAL] Is it possible to control the location of the lock file when starting postgres?

2016-07-20 Thread John R Pierce
On 7/20/2016 5:12 PM, Steve Langlois wrote: Then I try to run psql and [20:01:11 slanglois@tron bin]$ psql psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432”? I would

Re: [GENERAL] Is it possible to control the location of the lock file when starting postgres?

2016-07-20 Thread Steve Langlois
> On Jul 20, 2016, at 8:03 PM, John R Pierce wrote: > > On 7/20/2016 4:48 PM, Steve Langlois wrote: >> I am upgrading an existing system running CentOS 5.6 with Postgres 8.2.5 to >> CentOS 7 with 9.2.15. The original system modified the postgresql script to >> manually

Re: [GENERAL] Is it possible to control the location of the lock file when starting postgres?

2016-07-20 Thread Steve Langlois
On Jul 20, 2016, at 7:48 PM, Steve Langlois > wrote: you never did answer my previous question, why are you messing about with manually starting postgres from the wrong user account, when it should be run as a system service with

Re: [GENERAL] Is it possible to control the location of the lock file when starting postgres?

2016-07-20 Thread John R Pierce
On 7/20/2016 4:48 PM, Steve Langlois wrote: I am upgrading an existing system running CentOS 5.6 with Postgres 8.2.5 to CentOS 7 with 9.2.15. The original system modified the postgresql script to manually running postmaster to start the database under the current user control. So it is really

Re: [GENERAL] High Availability

2016-07-20 Thread Adrian Klaver
On 07/20/2016 11:53 AM, dangal wrote: Dear , I have a question for them , in our work we have an environment with streaming replication and everything works in the best way , we are trying to implement high availability and for that we try to use pgpool and we could not get it to work with md5

Re: [GENERAL] Is it possible to control the location of the lock file when starting postgres?

2016-07-20 Thread Steve Langlois
you never did answer my previous question, why are you messing about with manually starting postgres from the wrong user account, when it should be run as a system service with systemctl ? I am upgrading an existing system running CentOS 5.6 with Postgres 8.2.5 to CentOS 7 with 9.2.15. The

Re: [GENERAL] Is it possible to control the location of the lock file when starting postgres?

2016-07-20 Thread Adrian Klaver
On 07/20/2016 10:44 AM, Steve Langlois wrote: Steve Langlois writes: I ran + /usr/bin/initdb --pgdata=/usr/xxx/databases/pgsql/data --auth=ident without issue however when I try to start the database it complains about the lockfile. FATAL: could not create lock

Re: [GENERAL] BDR Cluster vs DB Config

2016-07-20 Thread Jonathan Eastgate
Thanks guys. Very helpful - I was thinking we may need to look at moving to schemas instead of individual db's. I assume that once BDR is enabled on a database that any additional schemas added post config are automatically included in BDR replication? And so you see any issues having

Re: [GENERAL] Is it possible to control the location of the lock file when starting postgres?

2016-07-20 Thread John R Pierce
On 7/20/2016 10:44 AM, Steve Langlois wrote: Why is the local connection not working without having to add host ::1/128 to the pg_hba.conf file. I thought specifying local all all trust would allow any local connection. local != localhost... on your system localhost is resolving to the ipv6

Re: [GENERAL] upsert with trigger (or rule)

2016-07-20 Thread Maeldron T.
On 19/07/16 23:45, Adrian Klaver wrote: To be more complete it would nice to see the schema definition for the table messages. Also maybe some idea of what you the code is supposed to do. If I understand it correctly: 1) Check if a message is a draft. 2) Check if there is a uniqueness

Re: [GENERAL] unique constraint with several null values

2016-07-20 Thread Jerry Sievers
Mark Lybarger writes: > I have a relation such as > create table order_item ( id uuid not null primary key, order_id number not > null, item_code text, make text, model text, reason text, size text, > expiration_date > timestamp ); > > where the combination of the columns

Re: [GENERAL] unique constraint with several null values

2016-07-20 Thread Kevin Grittner
On Wed, Jul 20, 2016 at 1:48 PM, David G. Johnston wrote: > On Wed, Jul 20, 2016 at 2:14 PM, Mark Lybarger wrote: >> Another solution I can think of is to just use a trigger to >> prevent the duplicate rows. If you go that route you will need to

[GENERAL] High Availability

2016-07-20 Thread dangal
Dear , I have a question for them , in our work we have an environment with streaming replication and everything works in the best way , we are trying to implement high availability and for that we try to use pgpool and we could not get it to work with md5 authentication The area of systems my

Re: [GENERAL] unique constraint with several null values

2016-07-20 Thread David G. Johnston
On Wed, Jul 20, 2016 at 2:14 PM, Mark Lybarger wrote: > I have a relation such as > create table order_item ( id uuid not null primary key, order_id number > not null, item_code text, make text, model text, reason text, size text, > expiration_date timestamp ); > > where the

[GENERAL] unique constraint with several null values

2016-07-20 Thread Mark Lybarger
I have a relation such as create table order_item ( id uuid not null primary key, order_id number not null, item_code text, make text, model text, reason text, size text, expiration_date timestamp ); where the combination of the columns order_id, item_code, make, model, reason, size must be

Re: [GENERAL] pg_dump without any SET command in header of output plain text sql file

2016-07-20 Thread Sameer Kumar
On Thu, 21 Jul 2016, 1:17 a.m. Alex Ignatov, wrote: > Hello everyone! > > Is there any way to make pg_dump(9.5) to dump table (with data) without > any SET command in the header of output plain sql file? > Yeah you need to use specific switch/option to disable each set

Re: [GENERAL] Is it possible to control the location of the lock file when starting postgres?

2016-07-20 Thread Steve Langlois
Steve Langlois writes: > I ran > + /usr/bin/initdb --pgdata=/usr/xxx/databases/pgsql/data --auth=ident > without issue however when I try to start the database it complains about the > lockfile. > FATAL: could not create lock file

Re: [GENERAL] pg_dump without any SET command in header of output plain text sql file

2016-07-20 Thread Tom Lane
Alex Ignatov writes: > Is there any way to make pg_dump(9.5) to dump table (with data) without > any SET command in the header of output plain sql file? No, but if all you want is the table data in a file, why not just use COPY? regards, tom

Re: [GENERAL] MediaWiki + PostgreSQL is not ready for production?

2016-07-20 Thread Scott Marlowe
On Mon, Jul 18, 2016 at 10:14 PM, Tatsuo Ishii wrote: > I found following comment for using PostgreSQL with MediaWiki: > > https://www.mediawiki.org/wiki/Compatibility#Database > > "Anything other than MySQL or MariaDB is not recommended for > production use at this point."

[GENERAL] pg_dump without any SET command in header of output plain text sql file

2016-07-20 Thread Alex Ignatov
Hello everyone! Is there any way to make pg_dump(9.5) to dump table (with data) without any SET command in the header of output plain sql file? P.S. Yeah I know about sedding =) -- Alex Ignatov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company -- Sent via

Re: [GENERAL] MediaWiki + PostgreSQL is not ready for production?

2016-07-20 Thread Joshua D. Drake
On 07/20/2016 08:57 AM, John DeSoi wrote: On Jul 18, 2016, at 11:47 PM, John R Pierce wrote: Drupal even tried to offer a database API so plugin developers wouldn't touch SQL directly, but too many ignored it. I have been using Drupal with PostgreSQL for more than 10

Re: [GENERAL] MediaWiki + PostgreSQL is not ready for production?

2016-07-20 Thread Raymond O'Donnell
On 20/07/16 16:57, John DeSoi wrote: On Jul 18, 2016, at 11:47 PM, John R Pierce wrote: Drupal even tried to offer a database API so plugin developers wouldn't touch SQL directly, but too many ignored it. I have been using Drupal with PostgreSQL for more than 10 years

Re: [GENERAL] Multiple clusters with same tablespace location

2016-07-20 Thread Tom Lane
Nate Dudenhoeffer writes: > The issue is that both clusters are using a base_backup and wal restore > from the same master database, so when they are restored, the tablespace > will already exist. Is there a way to change the tablespace location during > the recovery

Re: [GENERAL] MediaWiki + PostgreSQL is not ready for production?

2016-07-20 Thread John DeSoi
> On Jul 18, 2016, at 11:47 PM, John R Pierce wrote: > > Drupal even tried to offer a database API so plugin developers wouldn't touch > SQL directly, but too many ignored it. I have been using Drupal with PostgreSQL for more than 10 years without too many problems.

Re: [GENERAL] Multiple clusters with same tablespace location

2016-07-20 Thread Nate Dudenhoeffer
Thanks for the response Melvin. The issue is that both clusters are using a base_backup and wal restore from the same master database, so when they are restored, the tablespace will already exist. Is there a way to change the tablespace location during the recovery process? On Wed, Jul 20, 2016

Re: [GENERAL] Multiple clusters with same tablespace location

2016-07-20 Thread Melvin Davidson
On Wed, Jul 20, 2016 at 10:59 AM, Nate Dudenhoeffer wrote: > What happens if I have two postgresql clusters running on the same server > each with a tablespace pointing at the same location? > > I have a production server, where I intend to move some tables to a second

Re: [GENERAL] Unix Postgres 9.5. using pg_basebackup and WAL files. Can't get a PITR recovery

2016-07-20 Thread Jeff Janes
On Fri, Jul 15, 2016 at 10:09 AM, Pruett, Jennis wrote: > I can't cut and paste my issues, so I will explain as best I can. > > > > I’m testing PITR on a single 9.5 db (no replication setups). > > > > I have all the settings that I can find, wal_level, archive_command, >

[GENERAL] Multiple clusters with same tablespace location

2016-07-20 Thread Nate Dudenhoeffer
What happens if I have two postgresql clusters running on the same server each with a tablespace pointing at the same location? I have a production server, where I intend to move some tables to a second tablespace. I have a development/qa server which has multiple clusters running, each with a

Re: [GENERAL] Enhansement proposal: ordering by parameter

2016-07-20 Thread Chris Travers
On Wed, Jul 20, 2016 at 1:34 PM, Jordan Gigov wrote: > Just about every web developer encounters scenarios where they need to let > the user sort the results by the column they choose and that leads to > dangers of possible SQL injection, but also the loss of prepared

[GENERAL] Enhansement proposal: ordering by parameter

2016-07-20 Thread Jordan Gigov
Just about every web developer encounters scenarios where they need to let the user sort the results by the column they choose and that leads to dangers of possible SQL injection, but also the loss of prepared statement caching and optimizations (at least under Java with JPA). I have tried using

[GENERAL] crosstab issue

2016-07-20 Thread Eugenio Trumpy
Hi, I was just tying to perform a crosstab query on pgsql 9.1.4. I wonder if there is something to know for creating a pivot table by using crosstab when the pivot table has more then ten fields. I prepared crosstab query that aggregate less than 10 fields correctly whilst another crosstab

Re: [GENERAL] BDR Cluster vs DB Config

2016-07-20 Thread Craig Ringer
On 20 July 2016 at 13:22, Jonathan Eastgate wrote: > Hi everyone. > > We've been testing BDR on and off for the last 2 years and are keen to > start looking at implementing it in production as it seems 0.93 has > resolved most of the issues we faced with it in the