pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Undo Update
6+ messages / 5 participants
[nested] [flat]

* Undo Update
@ 2023-08-10 09:02  Rajesh Kumar <rajeshkumar.dba09@gmail.com>
  0 siblings, 2 replies; 6+ messages in thread

From: Rajesh Kumar @ 2023-08-10 09:02 UTC (permalink / raw)
  To: pgsql-admin@lists.postgresql.org

Hi friends

I was given a query to update the record in table A with where clause. But
I executed it in production mistakenly without where clause so it updated
incorrectly for all rows.

How do I resolve this?

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Undo Update
@ 2023-08-10 09:06  Holger Jakobs <holger@jakobs.com>
  parent: Rajesh Kumar <rajeshkumar.dba09@gmail.com>
  1 sibling, 1 reply; 6+ messages in thread

From: Holger Jakobs @ 2023-08-10 09:06 UTC (permalink / raw)
  To: pgsql-admin@lists.postgresql.org

I'm afraid you will have to execute the SQL statement undoing it. Of you don't know the previous values, you're out of luck.

Then a backup is your best friend.

Am 10. August 2023 11:02:26 MESZ schrieb Rajesh Kumar <rajeshkumar.dba09@gmail.com>:
>Hi friends
>
>I was given a query to update the record in table A with where clause. But
>I executed it in production mistakenly without where clause so it updated
>incorrectly for all rows.
>
>How do I resolve this?

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Undo Update
@ 2023-08-10 09:17  Rajesh Kumar <rajeshkumar.dba09@gmail.com>
  parent: Holger Jakobs <holger@jakobs.com>
  0 siblings, 2 replies; 6+ messages in thread

From: Rajesh Kumar @ 2023-08-10 09:17 UTC (permalink / raw)
  To: Holger Jakobs <holger@jakobs.com>; +Cc: pgsql-admin@lists.postgresql.org

In that case, how to take a backup specifically before that update and are
there any prequisites such as stopping the server when it happens? And then
backup like that?

On Thu, 10 Aug, 2023, 2:36 PM Holger Jakobs, <holger@jakobs.com> wrote:

> I'm afraid you will have to execute the SQL statement undoing it. Of you
> don't know the previous values, you're out of luck.
>
> Then a backup is your best friend.
>
>
> Am 10. August 2023 11:02:26 MESZ schrieb Rajesh Kumar <
> rajeshkumar.dba09@gmail.com>:
>
>> Hi friends
>>
>> I was given a query to update the record in table A with where clause.
>> But I executed it in production mistakenly without where clause so it
>> updated incorrectly for all rows.
>>
>> How do I resolve this?
>>
>

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Undo Update
@ 2023-08-10 09:20  Søren Laursen <sl@scrooge.dk>
  parent: Rajesh Kumar <rajeshkumar.dba09@gmail.com>
  1 sibling, 0 replies; 6+ messages in thread

From: Søren Laursen @ 2023-08-10 09:20 UTC (permalink / raw)
  To: ; +Cc: pgsql-admin@lists.postgresql.org

https://www.postgresql.org/docs/current/backup.html

Best regards

Den tors. 10. aug. 2023 kl. 11.18 skrev Rajesh Kumar <
rajeshkumar.dba09@gmail.com>:

> In that case, how to take a backup specifically before that update and are
> there any prequisites such as stopping the server when it happens? And then
> backup like that?
>
> On Thu, 10 Aug, 2023, 2:36 PM Holger Jakobs, <holger@jakobs.com> wrote:
>
>> I'm afraid you will have to execute the SQL statement undoing it. Of you
>> don't know the previous values, you're out of luck.
>>
>> Then a backup is your best friend.
>>
>>
>> Am 10. August 2023 11:02:26 MESZ schrieb Rajesh Kumar <
>> rajeshkumar.dba09@gmail.com>:
>>
>>> Hi friends
>>>
>>> I was given a query to update the record in table A with where clause.
>>> But I executed it in production mistakenly without where clause so it
>>> updated incorrectly for all rows.
>>>
>>> How do I resolve this?
>>>
>>

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Undo Update
@ 2023-08-10 12:01  jp.pozzi@izzop.net
  parent: Rajesh Kumar <rajeshkumar.dba09@gmail.com>
  1 sibling, 0 replies; 6+ messages in thread

From: jp.pozzi@izzop.net @ 2023-08-10 12:01 UTC (permalink / raw)
  To: Rajesh Kumar <rajeshkumar.dba09@gmail.com>; +Cc: pgsql-admin@lists.postgresql.org

Hello,

Restore the data ....

Regards

JP P

> Hi friends
> 
> I was given a query to update the record in table A with where clause.
> But I executed it in production mistakenly without where clause so it
> updated incorrectly for all rows.
> 
> How do I resolve this?





^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Undo Update
@ 2023-08-10 15:08  Ron <ronljohnsonjr@gmail.com>
  parent: Rajesh Kumar <rajeshkumar.dba09@gmail.com>
  1 sibling, 0 replies; 6+ messages in thread

From: Ron @ 2023-08-10 15:08 UTC (permalink / raw)
  To: pgsql-admin@lists.postgresql.org

Ask your database administrator about PITR (Point In Time Recovery).

On 8/10/23 04:17, Rajesh Kumar wrote:
> In that case, how to take a backup specifically before that update and are 
> there any prequisites such as stopping the server when it happens? And 
> then backup like that?
>
> On Thu, 10 Aug, 2023, 2:36 PM Holger Jakobs, <holger@jakobs.com> wrote:
>
>     I'm afraid you will have to execute the SQL statement undoing it. Of
>     you don't know the previous values, you're out of luck.
>
>     Then a backup is your best friend.
>
>
>     Am 10. August 2023 11:02:26 MESZ schrieb Rajesh Kumar
>     <rajeshkumar.dba09@gmail.com>:
>
>         Hi friends
>
>         I was given a query to update the record in table A with where
>         clause. But I executed it in production mistakenly without where
>         clause so it updated incorrectly for all rows.
>
>         How do I resolve this?
>

-- 
Born in Arizona, moved to Babylonia.

^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2023-08-10 15:08 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-08-10 09:02 Undo Update Rajesh Kumar <rajeshkumar.dba09@gmail.com>
2023-08-10 09:06 ` Holger Jakobs <holger@jakobs.com>
2023-08-10 09:17   ` Rajesh Kumar <rajeshkumar.dba09@gmail.com>
2023-08-10 09:20     ` Søren Laursen <sl@scrooge.dk>
2023-08-10 15:08     ` Ron <ronljohnsonjr@gmail.com>
2023-08-10 12:01 ` jp.pozzi@izzop.net

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox