PostgreSQL – Is there a way to know the last submission value in the table?

I am using Postgres 9.5. If I update some values ​​of a row and submit them, is there a way to get the old values ​​later? I was wondering if there is something like flashback? But this will be a selective flashback. I don’t want to roll back the entire database. I only need to restore one line.
short Answer-it is impossible.

But for future readers, you can create an array field containing historical data as follows:

Column | Type | 
----------------+--------------------- -----+------
value | integer |
value_history | integer[] |

For more information, please read the docs about arrays

p>

I am using Postgres 9.5. If I update some values ​​of a row and submit them, is there a way to get the old values ​​later? I was wondering if there is something like flashback? But this will be a selective flashback. I don’t want to roll back the entire database. I only need to restore one line.

Short answer – it’s impossible.

But for future readers, you can create an array field containing historical data as follows:

Column | Type | 
----------------+--------------------------+------
value | integer |
value_history | integer[] |

For more information, please read the docs about arrays

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 722 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.