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

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/

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 >>

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

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

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

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

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

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 >

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

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 *

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.

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 < >

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

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

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: 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?

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

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_gid

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: 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

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

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: >

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

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

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