Re: [GENERAL] CORRUPTION on TOAST table

2016-04-02 Thread Soni M
Sorry, miss that info. Master 9.1.13, replica1 9.1.13, replica2 9.1.19. Master Red Hat Enterprise Linux Server release 6.5 (Santiago), replica1 Red Hat Enterprise Linux Server release 6.5 (Santiago), replica2 Red Hat Enterprise Linux Server release 6.7 (Santiago). On Sun, Apr 3, 2016 at 10:43 AM,

Re: [GENERAL] CORRUPTION on TOAST table

2016-04-02 Thread Joshua D. Drake
What version of PostgreSQL and which OS? On 04/02/2016 08:38 PM, Soni M wrote: How can the corruption occurs ? and how can I resolve them ? Thank so much for the help. Cheers \o/ -- Regards, Soni Maula Harriz -- Command Prompt, Inc. http://the.postgres.company/

[GENERAL] CORRUPTION on TOAST table

2016-04-02 Thread Soni M
Hello Everyone, We face TOAST table corruption. One master and two streaming replicas. The corruption happen only on both streaming replicas. We did found the corrupted rows. Selecting on this row, return (on both replica) : unexpected chunk number 0 (expected 1) for toast value 1100613112 in

[GENERAL] plpgsql update row from record variable

2016-04-02 Thread Seamus Abshere
hi, I want to write a function that updates arbitrary columns and here's my pseudocode: CREATE OR REPLACE FUNCTION update_pet(id int, raw_data jsonb) RETURNS VOID AS $$ DECLARE data record; BEGIN SELECT jsonb_populate_record(null::pets, raw_data) INTO data; UPDATE pets [... from data ...]