Re: ERROR: found multixact from before relminmxid

2018-04-10 Thread Andres Freund
On April 10, 2018 11:51:40 PM PDT, Pavan Deolasee wrote: >On Wed, Apr 11, 2018 at 8:31 AM, Alexandre Arruda >wrote: > >> 2018-04-10 19:09 GMT-03:00 Peter Geoghegan : >> > On Tue, Apr 10, 2018 at 4:31 AM, Alexandre Arruda > >> wrote: >> >> Actualy, I first notice the problem in logs by autovacu

Re: ERROR: found multixact from before relminmxid

2018-04-10 Thread Pavan Deolasee
On Wed, Apr 11, 2018 at 8:31 AM, Alexandre Arruda wrote: > 2018-04-10 19:09 GMT-03:00 Peter Geoghegan : > > On Tue, Apr 10, 2018 at 4:31 AM, Alexandre Arruda > wrote: > >> Actualy, I first notice the problem in logs by autovacuum: > >> > >> 2018-04-10 08:22:15.385 -03 [55477] CONTEXT: automatic

psql variable to plpgsql?

2018-04-10 Thread Thiemo Kellner
Hi all Is there a way to pass the value of a psql variable into function code? I create a schema with help of psql variable \set SCHEMA_NAME LOGGER create schema :SCHEMA_NAME; I would like to create a function that has the Schema hard coded like declare V_SCHEMA_NAME text

dblink: give search_path

2018-04-10 Thread Thiemo Kellner
Hi all I try to execute a function not in the Schema I connect to with dblink. Is there way to tell dblink to set search_path in a specific way? I have not found a solution in the documentation. I tried with the set search_path definition in the function declarations to no avail. Function

Re: difference between checkpoint_segments and wal_keep_segments in postgres configuration file

2018-04-10 Thread Michael Paquier
On Tue, Apr 10, 2018 at 11:06:54PM +0530, Raghavendra Rao J S V wrote: > I am not clear the difference between checkpoint_segments and > wal_keep_segments . > > I would like to now below things. Please explain.Thanks in advance. > >- Difference between *checkpoint_segments *and *wal_keep_seg

Re: ERROR: found multixact from before relminmxid

2018-04-10 Thread Alexandre Arruda
2018-04-10 19:09 GMT-03:00 Peter Geoghegan : > On Tue, Apr 10, 2018 at 4:31 AM, Alexandre Arruda wrote: >> Actualy, I first notice the problem in logs by autovacuum: >> >> 2018-04-10 08:22:15.385 -03 [55477] CONTEXT: automatic vacuum of >> table "production.public.fn06t" >> 2018-04-10 08:22:16.81

Re: ERROR: found multixact from before relminmxid

2018-04-10 Thread Peter Geoghegan
On Tue, Apr 10, 2018 at 7:54 PM, Alexandre Arruda wrote: > pg_control version number:1002 Andres was also asking about his check_rel() function, from https://www.postgresql.org/message-id/20180319181723.ugaf7hfkluqyo...@alap3.anarazel.de. Can you check that out as well, please? You'll

Re: ERROR: found multixact from before relminmxid

2018-04-10 Thread Alexandre Arruda
2018-04-10 19:53 GMT-03:00 Andres Freund : > On 2018-04-10 08:31:20 -0300, Alexandre Arruda wrote: >> 2018-04-09 23:51 GMT-03:00 Peter Geoghegan : >> > On Mon, Apr 9, 2018 at 6:56 PM, Alexandre Arruda >> > wrote: >> >> (... and all other indexes returns null too) >> >> >> >> I tried with bt_index

Re: ERROR: found multixact from before relminmxid

2018-04-10 Thread Andres Freund
On 2018-04-10 08:31:20 -0300, Alexandre Arruda wrote: > 2018-04-09 23:51 GMT-03:00 Peter Geoghegan : > > On Mon, Apr 9, 2018 at 6:56 PM, Alexandre Arruda wrote: > >> (... and all other indexes returns null too) > >> > >> I tried with bt_index_check too. Same results. > > > > That's interesting, be

Re: Using enum instead of join tables

2018-04-10 Thread PT
On Tue, 10 Apr 2018 11:24:49 +0100 hmidi slim wrote: > Hi, > Is it a good thing to use enum type such a column in a table instead of > making a foreign key which references to another table? > I found these links talking about enum and when I will use them: > http://komlenic.com/244/8-reasons-why

Re: ERROR: found multixact from before relminmxid

2018-04-10 Thread Peter Geoghegan
On Tue, Apr 10, 2018 at 4:31 AM, Alexandre Arruda wrote: > Actualy, I first notice the problem in logs by autovacuum: > > 2018-04-10 08:22:15.385 -03 [55477] CONTEXT: automatic vacuum of > table "production.public.fn06t" > 2018-04-10 08:22:16.815 -03 [55477] ERROR: found multixact 68834765 > fro

Re: Postgresql Split Brain: Which one is latest

2018-04-10 Thread Jehan-Guillaume (ioguix) de Rorthais
On Tue, 10 Apr 2018 17:02:39 + Vikas Sharma wrote: > Max count is one way (vague I agree), before confirming I will ask the > application owner to have a look on data in tables as well. Maybe you could compare your tables on both sides using a tool like pg_comparator? See: https://cri.ens

Re: best way to write large data-streams quickly?

2018-04-10 Thread Jerry Sievers
Mark Moellering writes: > > How long can you run COPY?  I have been looking at it more closely.  > In some ways, it would be simple just to take data from stdin and > send it to postgres but can I do that literally 24/7?  I am > monitoring data feeds that will never stop and I don't know if tha

Planning to change autovacuum_vacuum_scale_factor value to zero. Please suggest me if any negative impact.

2018-04-10 Thread Raghavendra Rao J S V
We are using postgres *9.2* version on *Centos *operating system. We have around 1300+ tables. We have following auto vacuum settings are enables. Still few of the tables which are always busy are not vacuumed. Due to that tables are bloating and observed few areas has performance degradation.

difference between checkpoint_segments and wal_keep_segments in postgres configuration file

2018-04-10 Thread Raghavendra Rao J S V
I am not clear the difference between checkpoint_segments and wal_keep_segments . I would like to now below things. Please explain.Thanks in advance. - Difference between *checkpoint_segments *and *wal_keep_segments * value - Role of *checkpoint_segments *and *wal_keep_segments *

Suggest the best values for the postgres configuration parameters

2018-04-10 Thread Raghavendra Rao J S V
We are using postgres *9.2* version on *Centos *operating system. Total ram available is *80GB *. At present we don't have any connection pool mechanisiam. Max number of connections are allowed is 1000. Could you please suggest the best values for the below configuration parameters? - sha

Re: Postgresql Split Brain: Which one is latest

2018-04-10 Thread Adrian Klaver
On 04/10/2018 10:02 AM, Vikas Sharma wrote: Max count is one way (vague I agree), before confirming I will ask the application owner to have a look on data in tables as well. Along that line and dependent on the size of the database and individual tables you might try: 1) Do a plain text dum

Re: Postgresql Split Brain: Which one is latest

2018-04-10 Thread Vikas Sharma
Max count is one way (vague I agree), before confirming I will ask the application owner to have a look on data in tables as well. Regards On Tue, Apr 10, 2018, 17:55 Adrian Klaver wrote: > On 04/10/2018 09:47 AM, Vikas Sharma wrote: > > Thanks Adrian and Edison, I also think so. At the moment

Re: Postgresql Split Brain: Which one is latest

2018-04-10 Thread Adrian Klaver
On 04/10/2018 09:47 AM, Vikas Sharma wrote: Thanks Adrian and Edison, I also think so. At the moment I have 2 masters, as soon as slave is promoted to master it starts its own timeline and application might have added data to either of them or both, only way to find out correct master now is th

Re: Postgresql Split Brain: Which one is latest

2018-04-10 Thread Ron
You need to find out when the split happened, and whether each new master have records since then. On 04/10/2018 11:47 AM, Vikas Sharma wrote: Thanks Adrian and Edison, I also think so. At the moment I have 2 masters, as soon as slave is promoted to master it starts its own timeline and applic

Re: Postgresql Split Brain: Which one is latest

2018-04-10 Thread Vikas Sharma
Thanks Adrian and Edison, I also think so. At the moment I have 2 masters, as soon as slave is promoted to master it starts its own timeline and application might have added data to either of them or both, only way to find out correct master now is the instance with max count of data in tables whic

Re: Postgresql Split Brain: Which one is latest

2018-04-10 Thread Adrian Klaver
On 04/10/2018 08:04 AM, Vikas Sharma wrote: Hi Adrian, This can be a good example: Application server e.g. tomcat having two entries to connect to databases, one for master and 2nd for Slave (ideally used when slave becomes master). If application is not able to connect to first, it will try

Re: Multiple records returned by a JOIN

2018-04-10 Thread Alexander Farber
Or actually I can not use SELECT UNION here, because then I only get 10 records of the condition uid = player1 and then nothing would be left for the other condition uid = player2

Re: Multiple records returned by a JOIN

2018-04-10 Thread Alexander Farber
Ok thanks, I guess I should switch to a SELECT UNION (first on uid = player1 and the uid = player2) and that will fix the CASE ... END for me. On Tue, Apr 10, 2018 at 6:01 PM, David G. Johnston < david.g.johns...@gmail.com> wrote: > On Tue, Apr 10, 2018 at 8:44 AM, Alexander Farber < > alexander.

Re: Multiple records returned by a JOIN

2018-04-10 Thread David G. Johnston
On Tue, Apr 10, 2018 at 8:44 AM, Alexander Farber < alexander.far...@gmail.com> wrote: > Unfortunately, it returns multiple records and with wrong values too: > > # select * from words_stat_games(1, '10999844041575271'); > out_gid | out_reason | out_state1 | out_score1 | out_score2 > ---

Multiple records returned by a JOIN

2018-04-10 Thread Alexander Farber
Good evening, in PostgreSQL 10.3 I have written the following custom function (trying to fetch 10 latest games played by a user): CREATE OR REPLACE FUNCTION words_stat_games( in_social integer, in_sidtext ) RETURNS TABLE ( out_gidint

Re: Postgresql Split Brain: Which one is latest

2018-04-10 Thread Edson Carlos Ericksson Richter
Em 10/04/2018 12:28, Melvin Davidson escreveu: On Tue, Apr 10, 2018 at 11:04 AM, Vikas Sharma > wrote: Hi Adrian, This can be a good example: Application server e.g. tomcat having two entries to connect to databases, one for master and 2nd for Slav

Re: Postgresql Split Brain: Which one is latest

2018-04-10 Thread Melvin Davidson
On Tue, Apr 10, 2018 at 11:04 AM, Vikas Sharma wrote: > Hi Adrian, > > This can be a good example: Application server e.g. tomcat having two > entries to connect to databases, one for master and 2nd for Slave (ideally > used when slave becomes master). If application is not able to connect to > f

Re: Postgresql Split Brain: Which one is latest

2018-04-10 Thread Vikas Sharma
Hi Adrian, This can be a good example: Application server e.g. tomcat having two entries to connect to databases, one for master and 2nd for Slave (ideally used when slave becomes master). If application is not able to connect to first, it will try to connect to 2nd. Regards Vikas On 10 April 20

Re: Postgresql Split Brain: Which one is latest

2018-04-10 Thread Adrian Klaver
On 04/10/2018 06:50 AM, Vikas Sharma wrote: Hi, We have postgresql 9.5 with streaming replication(Master-slave) and automatic failover. Due to network glitch we are in master-master situation for quite some time. Please, could you advise best way to confirm which node is latest in terms of up

Re: Postgresql Split Brain: Which one is latest

2018-04-10 Thread Achilleas Mantzios
On 10/04/2018 16:50, Vikas Sharma wrote: Hi, We have postgresql 9.5 with streaming replication(Master-slave) and automatic failover. Due to network glitch we are in master-master situation for quite some time. Please, could you advise best way to confirm which node is latest in terms of updates

Re: best way to write large data-streams quickly?

2018-04-10 Thread Mark Moellering
On Mon, Apr 9, 2018 at 12:01 PM, Steve Atkins wrote: > > > On Apr 9, 2018, at 8:49 AM, Mark Moellering com> wrote: > > > > Everyone, > > > > We are trying to architect a new system, which will have to take several > large datastreams (total of ~200,000 parsed files per second) and place > them i

Postgresql Split Brain: Which one is latest

2018-04-10 Thread Vikas Sharma
Hi, We have postgresql 9.5 with streaming replication(Master-slave) and automatic failover. Due to network glitch we are in master-master situation for quite some time. Please, could you advise best way to confirm which node is latest in terms of updates to the postgres databases. Regards Vikas S

Re: ERROR: unexpected chunk number 0 (expected 1) for toast value 76753264 in pg_toast_10920100

2018-04-10 Thread Adam Sjøgren
Pavan writes: >> FWIW one of our support customers reported a very similar TOAST table >> corruption issue last week which nearly caused an outage. After a lot of >> analysis, I think I've now fully understood the reasons behind the >> corruption, the underlying bug(s) and possible remedy. I am cu

Re: ERROR: found multixact from before relminmxid

2018-04-10 Thread Alexandre Arruda
2018-04-09 23:51 GMT-03:00 Peter Geoghegan : > On Mon, Apr 9, 2018 at 6:56 PM, Alexandre Arruda wrote: >> (... and all other indexes returns null too) >> >> I tried with bt_index_check too. Same results. > > That's interesting, because it tells me that you have a table that > appears to not be cor

Re: ERROR: unexpected chunk number 0 (expected 1) for toast value 76753264 in pg_toast_10920100

2018-04-10 Thread Pavan Deolasee
On Fri, Apr 6, 2018 at 8:55 AM, Pavan Deolasee wrote: > > > On Fri, Apr 6, 2018 at 2:34 AM, Tom Lane wrote: > >> a...@novozymes.com (Adam =?utf-8?Q?Sj=C3=B8gren?=) writes: >> >> [... still waiting for the result, I will return with what it said >> >> when the server does ...] >> >> > It did even

Using enum instead of join tables

2018-04-10 Thread hmidi slim
Hi, Is it a good thing to use enum type such a column in a table instead of making a foreign key which references to another table? I found these links talking about enum and when I will use them: http://komlenic.com/244/8-reasons-why-mysqls-enum-data-type-is-evil/ https://www.percona.com/blog/2008

Grant to a group defined in Windows AD

2018-04-10 Thread Hans Schou
Hi Can I have a advise on how to handle groups? In my Windows AD (Active Directory) I have two groups named: readers writers In Postgresql I have these databases: d1 d2 The "writers" should have NOCREATEDB etc but ALL PRIVILEGES to d1 and d2. The "readers" should have SELECT to all tab