[GENERAL] Tunning Server 9.1.

2016-08-03 Thread Periko Support
Hi. I have server that hras increase users and need to increase max_connections from default value. Current value = 100 New Value = 200 This send me a message about shared_memory need to lower the value which default settings = 24MB. My server has 128GB in size, for 200 connections what

Re: [GENERAL] Question about wal files / pg_xlogs

2016-08-03 Thread Venkata Balaji N
> > I use a bash script to ship them. The script hasn't being changed So > it isn't the problem. > > > *postgresql.conf:* > >> archive_command = 'exec nice -n 19 ionice -c 2 -n 7 archive_command.bash >> "%p" slave01 slave02' > > *archive_command.bash:* > > Basically we use TAR to ship through

Re: [GENERAL] Question about wal files / pg_xlogs

2016-08-03 Thread Patrick B
> > >> > Both machines have same timezone? > Yes! Shouldn't be showing 2 hours before.. I just checked and both server has the same date / timezone > > How fast are you generating WALs? > Check below please checkpoint_segments = 64 > checkpoint_timeout = 5min > checkpoint_completion_target =

Re: [GENERAL] Question about wal files / pg_xlogs

2016-08-03 Thread Adrian Klaver
On 08/03/2016 07:21 PM, Patrick B wrote: Hi all, I'm currently using PostgreSQL 9.2. I noticed that the wal_files are being generated by the master well, no problems. But on the slaves, it seems to be a delay to the delivery of those wal_files. I got two slaves using streaming replication and

[GENERAL] Question about wal files / pg_xlogs

2016-08-03 Thread Patrick B
Hi all, I'm currently using PostgreSQL 9.2. I noticed that the wal_files are being generated by the master well, no problems. But on the slaves, it seems to be a delay to the delivery of those wal_files. I got two slaves using streaming replication and wal files shipment from Master. *On the

[GENERAL] pglogical cross subscribe

2016-08-03 Thread Andy Colson
Hi all. I have a localdb and a remotedb. A) I'd like to send table1 and table2 from localdb to remotedb. B) I'd like to send table3 from remotedb to localdb. I have PG9.5 and pglogical setup, and (A) works fine. Well, worked. I then tried to set up (B) which seems to work, but now (A) is

Re: [GENERAL] connection file descriptors created with identical number after process fork on mac

2016-08-03 Thread John R Pierce
On 8/3/2016 4:25 PM, Chris Withers wrote: How can I convince myself, from the client side, that I really have got a new connection and not somehow ended up with one that been passed on as part of the fork? $ psql -tc "select pg_backend_pid();" 18635 $ psql -tc "select

Re: [GENERAL] connection file descriptors created with identical number after process fork on mac

2016-08-03 Thread Chris Withers
On 04/08/2016 00:20, Tom Lane wrote: Chris Withers writes: I'm writing some multi-process code in Python and trying to make sure I open a new connection for each process. Here's the really cut down code: ... What's really surpising to me is the output on a mac: $

Re: [GENERAL] connection file descriptors created with identical number after process fork on mac

2016-08-03 Thread Tom Lane
Chris Withers writes: > I'm writing some multi-process code in Python and trying to make sure I > open a new connection for each process. Here's the really cut down code: > ... > What's really surpising to me is the output on a mac: > $ python psycopg2_multiprocess.py >

[GENERAL] connection file descriptors created with identical number after process fork on mac

2016-08-03 Thread Chris Withers
Hi All, I'm writing some multi-process code in Python and trying to make sure I open a new connection for each process. Here's the really cut down code: """ import os, time import psycopg2 from multiprocessing import Pool def init(): conn = psycopg2.connect("dbname=...host=localhost")

[GENERAL] Question on table inheritance and privileges

2016-08-03 Thread 윤기태
Dear pgsql-general, I found something strange with DROP TABLE CASCADE. create role a login; grant all on database mydb to a; create role b inherit role a login; grant all on database mydb to b; (session of role a) psql -U a -d mydb; create schema a; create table a(i1 int); (session of role

Re: [GENERAL] Problem with partitioning

2016-08-03 Thread Adrian Klaver
On 08/03/2016 12:11 PM, JotaComm wrote: Hello, 2016-08-03 15:29 GMT-03:00 Adrian Klaver >: On 08/03/2016 11:24 AM, JotaComm wrote: 2016-08-03 15:20 GMT-03:00 JotaComm

Re: [GENERAL] Problem with partitioning

2016-08-03 Thread Tom Lane
JotaComm writes: >​The trigger code: > tg_table_update AFTER UPDATE ON parent_table FOR EACH ROW EXECUTE PROCEDURE > f_table_update() I'm fairly sure that per-row triggers only fire on events in their table, ie this would fire on updates to rows in parent_table itself,

Re: [GENERAL] Problem with partitioning

2016-08-03 Thread JotaComm
Hello, 2016-08-03 15:29 GMT-03:00 Adrian Klaver : > On 08/03/2016 11:24 AM, JotaComm wrote: > >> >> >> 2016-08-03 15:20 GMT-03:00 JotaComm > >: >> >> > >> ​When I create a trigger for each child table the trigger

Re: [GENERAL] Problem with partitioning

2016-08-03 Thread Adrian Klaver
On 08/03/2016 11:24 AM, JotaComm wrote: 2016-08-03 15:20 GMT-03:00 JotaComm >: ​When I create a trigger for each child table the trigger works very well.​ Without seeing any code this problem is not going to be solved.

Re: [GENERAL] Problem with partitioning

2016-08-03 Thread JotaComm
2016-08-03 15:20 GMT-03:00 JotaComm : > > > 2016-08-03 15:15 GMT-03:00 JotaComm : > >> Hello, >> >> 2016-08-03 14:21 GMT-03:00 David G. Johnston >> : >> >>> On Wed, Aug 3, 2016 at 1:16 PM, Adrian Klaver

Re: [SPAM] Re: [GENERAL] WAL directory size calculation

2016-08-03 Thread Moreno Andreo
Il 03/08/2016 18:01, Jeff Janes ha scritto: On Thu, Jul 28, 2016 at 6:25 AM, Moreno Andreo wrote: Hi folks! :-) I'm about to bring up my brand new production server and I was wondering if it's possible to calculate (approx.) the WAL directory size. I have to choose

Re: [GENERAL] My Postgresql is inaccessible in Windows 8.1

2016-08-03 Thread Adrian Klaver
On 08/03/2016 10:15 AM, melvin6925 wrote: If Postgresql were running, then he would have not had the problem. Would he? Except the original post was about Postgres running, but having periods of slow down/inaccessibility. There was a later log entry showing the pid conflict. Since I am not

Re: [GENERAL] Problem with partitioning

2016-08-03 Thread David G. Johnston
On Wed, Aug 3, 2016 at 1:16 PM, Adrian Klaver wrote: > On 08/03/2016 10:12 AM, JotaComm wrote: > >> Hello, >> >> I'm working with partitioning and I have one trigger for insert and >> update on parent table, but my trigger is not working for update >> operations. The

Re: [GENERAL] Problem with partitioning

2016-08-03 Thread Adrian Klaver
On 08/03/2016 10:12 AM, JotaComm wrote: Hello, I'm working with partitioning and I have one trigger for insert and update on parent table, but my trigger is not working for update operations. The problem is: the trigger is not executed for update just for insert. I put a raise notice message in

Re: [GENERAL] My Postgresql is inaccessible in Windows 8.1

2016-08-03 Thread melvin6925
If Postgresql were running, then he would have not had the problem. Would he? Sent via the Samsung Galaxy S® 6, an AT 4G LTE smartphone Original message From: Adrian Klaver Date: 8/3/16 13:01 (GMT-05:00) To: Melvin Davidson

[GENERAL] Problem with partitioning

2016-08-03 Thread JotaComm
Hello, I'm working with partitioning and I have one trigger for insert and update on parent table, but my trigger is not working for update operations. The problem is: the trigger is not executed for update just for insert. I put a raise notice message in my function to verify the update

Re: [GENERAL] My Postgresql is inaccessible in Windows 8.1

2016-08-03 Thread Adrian Klaver
On 08/03/2016 08:47 AM, Melvin Davidson wrote: Well this looks like the Postgres log and it is showing that you are trying to start Postgres when there is already another instance of Postgres running. What does the Task Manager show is running? When I was talking

Re: [GENERAL] WAL directory size calculation

2016-08-03 Thread Jeff Janes
On Thu, Jul 28, 2016 at 6:25 AM, Moreno Andreo wrote: > Hi folks! :-) > I'm about to bring up my brand new production server and I was wondering if > it's possible to calculate (approx.) the WAL directory size. > I have to choose what's better in terms of cost vs.

Re: [GENERAL] WAL directory size calculation

2016-08-03 Thread Jeff Janes
On Thu, Jul 28, 2016 at 6:33 AM, David G. Johnston wrote: > On Thu, Jul 28, 2016 at 9:25 AM, Moreno Andreo > wrote: >> >> I've read somewhere that the formula should be 16 MB * 3 * >> checkpoint_segment in size. > > [...] > >> >> Using the

Re: [GENERAL] My Postgresql is inaccessible in Windows 8.1

2016-08-03 Thread Melvin Davidson
On Wed, Aug 3, 2016 at 11:23 AM, Adrian Klaver wrote: > On 08/03/2016 07:40 AM, Edson F. Lidorio wrote: > >> Em 2016-08-03 09:56, Adrian Klaver escreveu: >> >>> On 08/03/2016 04:40 AM, Edson F. Lidorio wrote: >>> Good Morning, Constantly my Postgresql is

Re: [GENERAL] My Postgresql is inaccessible in Windows 8.1

2016-08-03 Thread Adrian Klaver
On 08/03/2016 07:40 AM, Edson F. Lidorio wrote: Em 2016-08-03 09:56, Adrian Klaver escreveu: On 08/03/2016 04:40 AM, Edson F. Lidorio wrote: Good Morning, Constantly my Postgresql is inaccessible, recording the following message in the log. I'm using Windows 8.1 and PostgreSQL 9.5

Re: [GENERAL] My Postgresql is inaccessible in Windows 8.1

2016-08-03 Thread Edson F. Lidorio
Em 2016-08-03 09:56, Adrian Klaver escreveu: On 08/03/2016 04:40 AM, Edson F. Lidorio wrote: Good Morning, Constantly my Postgresql is inaccessible, recording the following message in the log. I'm using Windows 8.1 and PostgreSQL 9.5 2016-08-02 17:05:59 BRT FATAL: the database system is

Re: [GENERAL] Log all queries before migration ?

2016-08-03 Thread Melvin Davidson
On Wed, Aug 3, 2016 at 10:10 AM, Charles Clavadetscher < clavadetsc...@swisspug.org> wrote: > Hello > > > -Original Message- > > From: pgsql-general-ow...@postgresql.org [mailto: > pgsql-general-ow...@postgresql.org] On Behalf Of ben.play > > Sent: Mittwoch, 3. August 2016 15:29 > > To:

Re: [GENERAL] Log all queries before migration ?

2016-08-03 Thread Charles Clavadetscher
Hello > -Original Message- > From: pgsql-general-ow...@postgresql.org > [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of ben.play > Sent: Mittwoch, 3. August 2016 15:29 > To: pgsql-general@postgresql.org > Subject: Re: [GENERAL] Log all queries before migration ? > > Hi guys, >

Re: [GENERAL] Log all queries before migration ?

2016-08-03 Thread ben.play
Hi guys, In fact, I would like to copy a table and then, when everything is finish, execute all inserts and updates since the beginning of the copy. The biggest problem with the log at this time it's the query. All my queries are not runnable. When I log, I see this kind of queries :

Re: [GENERAL] My Postgresql is inaccessible in Windows 8.1

2016-08-03 Thread Kenneth Marshall
On Wed, Aug 03, 2016 at 08:40:26AM -0300, Edson F. Lidorio wrote: > Good Morning, > > Constantly my Postgresql is inaccessible, recording the following > message in the log. > I'm using Windows 8.1 and PostgreSQL 9.5 > > > 2016-08-02 17:05:59 BRT FATAL: the database system is starting up >

Re: [GENERAL] My Postgresql is inaccessible in Windows 8.1

2016-08-03 Thread Adrian Klaver
On 08/03/2016 04:40 AM, Edson F. Lidorio wrote: Good Morning, Constantly my Postgresql is inaccessible, recording the following message in the log. I'm using Windows 8.1 and PostgreSQL 9.5 2016-08-02 17:05:59 BRT FATAL: the database system is starting up 2016-08-02 17:05:59 BRT LOG:

Re: [SPAM] Re: [SPAM] Re: [SPAM] Re: [GENERAL] WAL directory size calculation

2016-08-03 Thread Moreno Andreo
Il 03/08/2016 14:12, Michael Paquier ha scritto: On Wed, Aug 3, 2016 at 8:07 PM, Moreno Andreo wrote: Should I keep fsync off? I'd think it would be better leaving it on, right? >From the docs:

Re: [SPAM] Re: [SPAM] Re: [GENERAL] WAL directory size calculation

2016-08-03 Thread Michael Paquier
On Wed, Aug 3, 2016 at 8:07 PM, Moreno Andreo wrote: > Should I keep fsync off? I'd think it would be better leaving it on, right? >From the docs: >https://www.postgresql.org/docs/9.6/static/runtime-config-wal.html#RUNTIME-CONFIG-WAL-SETTINGS While turning off fsync is

[GENERAL] Per-statement trigger in Foreign tables in Posgregsql 9.4 (through Foreign-data wrapper)

2016-08-03 Thread Andrea Martino
Hi everybody, Yesterday I noticed a strange behaviour, I wonder if it is a bug, a non-documented feature or just me. If this is the expected behaviour the documentation should be updated accordingly. This happens on Posgresql 9.4. Consider the following SQL script, where I insert 4 rows into a

[GENERAL] My Postgresql is inaccessible in Windows 8.1

2016-08-03 Thread Edson F. Lidorio
Good Morning, Constantly my Postgresql is inaccessible, recording the following message in the log. I'm using Windows 8.1 and PostgreSQL 9.5 2016-08-02 17:05:59 BRT FATAL: the database system is starting up 2016-08-02 17:05:59 BRT LOG: database system was not properly shut down; automatic

Re: [SPAM] Re: [SPAM] Re: [GENERAL] WAL directory size calculation

2016-08-03 Thread Moreno Andreo
Il 29/07/2016 17:26, Francisco Olarte ha scritto: Hi: On Fri, Jul 29, 2016 at 10:35 AM, Moreno Andreo wrote: After Andreas post and thinking about it a while, I went to the decision that it's better not to use RAM but another persistent disk, because there can be an