How does the recovery strategy of PostgreSQL exactly work?












2














I'm testing and trying to figure out how the backup and recovery strategy in PostgreSQL 11 works but it does not work as expected. When I recover the backup, I don't get the correct state. I get any state after a given timestamp. In detail:



I have this setup in database:



wal_level = replica 
max_wal_senders = 10
archive_mode = on


I have executed the following commands:



postgres=# select pg_create_physical_replication_slot('slot1');
pg_basebackup -D /media/extern/postgresql_basebackup/
pg_receivewal -D /media/extern/postgresql_archive -S slot1 -v


pg_receivewal is writing into postgresql_archive, this seems to work.




  • then I insert something into the database, let's say at 16:21.

  • I wait some minutes, let's say until 16:27 and delete all the insert.


Then I want to recover the inserts by doing...



service postgresql stop


(do I need to stop pg_receivewal as well)?



# mv main main.before_recovery
# cp -rp /media/extern/postgresql_basebackup main

nano /var/lib/postgresql/11/main/recovery.conf


I add the following content



restore_command = 'cp -r /media/extern/postgresql_archive/%f %p'
recovery_target_time='2018-01-06 16:22:00'


Then I execute



# chown postgres:postgres recovery.conf 
# chmod 700 recovery.conf

service postgresql start


After startup, the file changes to recovery.done, but the state in database is wrong. It didn't restore the data. The database is still empty, so the PITR didn't work, why?



What should I do In case if everything was successful after recovery?. I'm unsure about these questions:




  • Creating a new slot2 by executing pg_create_physical_replication_slot('slot2'); and streaming from this slot by pg_receivewal -D /media/extern/postgresql_archive -S slot2 -v?

  • Doing a pg_receivewal -D /media/extern/postgresql_archive -S slot1 -v again?

  • Do I have to delete anywhen any data in postgresql_archive? (-> Probably not)

  • When do I have to create another base backup?

  • When and why do I execute select pg_switch_wal(); in this recovery concept?

  • How do I deal with new 'timelines' after recovery? I understand the concept of the timelines, but I'm unsure how I should proceed with it after recovery.


[UPDATE]

jjanes pointed out, that the date is wrong. I corrected it, but I still get an empty database after recovery. I tried these steps after I recovered the database, which is now empty:




2019-01-08, 18:50: create a new base backup from this empty database
to have a good starting point.



2019-01-08, 18:55 created slot1



pg_receivewal -D /media/extern/postgresql_archive -S slot1 -v



2019-01-08, 18:57 insert



2019-01-08, 19:38 delete




service postgresql stop



# mv main main.before_recovery
# cp -rp /media/extern/postgresql_basebackup main
# chmod 700 main

# nano /var/lib/postgresql/11/main/recovery.conf

restore_command = 'cp -r /media/extern/postgresql_archive/%f %p'
recovery_target_time='2019-01-08 19:20:00'

# chown postgres:postgres recovery.conf
# chmod 700 recovery.conf

# service postgresql start


(btw: I saw that it starts by itself new timelimes after recovery.)



[UPDATE]

I activated in postgresql.conf



checkpoint_flush_after = 256kB 
checkpoint_timeout = 30s


I tried to restore the database by using the previous method but without recovery_target_time and without any DELETE statement. I just wanted to look if the current full state can be rebuilt at all. Additionally I renamed the current wal file 00000007000000000000002D.partial to 00000007000000000000002D after stopping the database and before recovering the data.



I'm currently not sure which of these things worked, but at least, the non-PITR recovery seem to work, because I was able to restore the latest data by installing the (empty) base backup and the wal files. At least a step into the right direction, but this only works when you don't miss any shipped wal files. Here, question 2 comes into play: What is the correct workflow to handle the "next shipping iteration".
At first, you can't start pg_receivewal -D /media/extern/postgresql_archive -S slot1 -v
again without deleting the shipped WALs in the external folder. Otherwise it would not start shipping the logs and it would abort with connection errors. This means that you can throw away your old base backup, because when you try the recover again with the old base backup, you would miss all the wal logs between base backup and last recovery point (because you deleted them). That also means that you have to create a new base backup immediately from the recovery point state. When you start log shipping again, you have no "gap" then between the new base backup and the wal files.



The next step is to get PITR running...










share|improve this question

















This question has an open bounty worth +50
reputation from Bevor ending in 6 days.


The current answers do not contain enough detail.


I will give a bounty to the one who can give me clarification about the given questions.
















  • How can he possibly give you more detail?
    – Evan Carroll
    yesterday










  • @EvanCarroll The first part of the question is to understand, why the recovery does not restore the data. The second part of the question is, how should I proceed after the data has been restored (successfully). Do I have to make something 'special' according to the concept of timelines or slots, or whatever or do I let the database just run. I know this is no a very specific question, but I'm satisfied with a good overview of the concept.
    – Bevor
    yesterday


















2














I'm testing and trying to figure out how the backup and recovery strategy in PostgreSQL 11 works but it does not work as expected. When I recover the backup, I don't get the correct state. I get any state after a given timestamp. In detail:



I have this setup in database:



wal_level = replica 
max_wal_senders = 10
archive_mode = on


I have executed the following commands:



postgres=# select pg_create_physical_replication_slot('slot1');
pg_basebackup -D /media/extern/postgresql_basebackup/
pg_receivewal -D /media/extern/postgresql_archive -S slot1 -v


pg_receivewal is writing into postgresql_archive, this seems to work.




  • then I insert something into the database, let's say at 16:21.

  • I wait some minutes, let's say until 16:27 and delete all the insert.


Then I want to recover the inserts by doing...



service postgresql stop


(do I need to stop pg_receivewal as well)?



# mv main main.before_recovery
# cp -rp /media/extern/postgresql_basebackup main

nano /var/lib/postgresql/11/main/recovery.conf


I add the following content



restore_command = 'cp -r /media/extern/postgresql_archive/%f %p'
recovery_target_time='2018-01-06 16:22:00'


Then I execute



# chown postgres:postgres recovery.conf 
# chmod 700 recovery.conf

service postgresql start


After startup, the file changes to recovery.done, but the state in database is wrong. It didn't restore the data. The database is still empty, so the PITR didn't work, why?



What should I do In case if everything was successful after recovery?. I'm unsure about these questions:




  • Creating a new slot2 by executing pg_create_physical_replication_slot('slot2'); and streaming from this slot by pg_receivewal -D /media/extern/postgresql_archive -S slot2 -v?

  • Doing a pg_receivewal -D /media/extern/postgresql_archive -S slot1 -v again?

  • Do I have to delete anywhen any data in postgresql_archive? (-> Probably not)

  • When do I have to create another base backup?

  • When and why do I execute select pg_switch_wal(); in this recovery concept?

  • How do I deal with new 'timelines' after recovery? I understand the concept of the timelines, but I'm unsure how I should proceed with it after recovery.


[UPDATE]

jjanes pointed out, that the date is wrong. I corrected it, but I still get an empty database after recovery. I tried these steps after I recovered the database, which is now empty:




2019-01-08, 18:50: create a new base backup from this empty database
to have a good starting point.



2019-01-08, 18:55 created slot1



pg_receivewal -D /media/extern/postgresql_archive -S slot1 -v



2019-01-08, 18:57 insert



2019-01-08, 19:38 delete




service postgresql stop



# mv main main.before_recovery
# cp -rp /media/extern/postgresql_basebackup main
# chmod 700 main

# nano /var/lib/postgresql/11/main/recovery.conf

restore_command = 'cp -r /media/extern/postgresql_archive/%f %p'
recovery_target_time='2019-01-08 19:20:00'

# chown postgres:postgres recovery.conf
# chmod 700 recovery.conf

# service postgresql start


(btw: I saw that it starts by itself new timelimes after recovery.)



[UPDATE]

I activated in postgresql.conf



checkpoint_flush_after = 256kB 
checkpoint_timeout = 30s


I tried to restore the database by using the previous method but without recovery_target_time and without any DELETE statement. I just wanted to look if the current full state can be rebuilt at all. Additionally I renamed the current wal file 00000007000000000000002D.partial to 00000007000000000000002D after stopping the database and before recovering the data.



I'm currently not sure which of these things worked, but at least, the non-PITR recovery seem to work, because I was able to restore the latest data by installing the (empty) base backup and the wal files. At least a step into the right direction, but this only works when you don't miss any shipped wal files. Here, question 2 comes into play: What is the correct workflow to handle the "next shipping iteration".
At first, you can't start pg_receivewal -D /media/extern/postgresql_archive -S slot1 -v
again without deleting the shipped WALs in the external folder. Otherwise it would not start shipping the logs and it would abort with connection errors. This means that you can throw away your old base backup, because when you try the recover again with the old base backup, you would miss all the wal logs between base backup and last recovery point (because you deleted them). That also means that you have to create a new base backup immediately from the recovery point state. When you start log shipping again, you have no "gap" then between the new base backup and the wal files.



The next step is to get PITR running...










share|improve this question

















This question has an open bounty worth +50
reputation from Bevor ending in 6 days.


The current answers do not contain enough detail.


I will give a bounty to the one who can give me clarification about the given questions.
















  • How can he possibly give you more detail?
    – Evan Carroll
    yesterday










  • @EvanCarroll The first part of the question is to understand, why the recovery does not restore the data. The second part of the question is, how should I proceed after the data has been restored (successfully). Do I have to make something 'special' according to the concept of timelines or slots, or whatever or do I let the database just run. I know this is no a very specific question, but I'm satisfied with a good overview of the concept.
    – Bevor
    yesterday
















2












2








2







I'm testing and trying to figure out how the backup and recovery strategy in PostgreSQL 11 works but it does not work as expected. When I recover the backup, I don't get the correct state. I get any state after a given timestamp. In detail:



I have this setup in database:



wal_level = replica 
max_wal_senders = 10
archive_mode = on


I have executed the following commands:



postgres=# select pg_create_physical_replication_slot('slot1');
pg_basebackup -D /media/extern/postgresql_basebackup/
pg_receivewal -D /media/extern/postgresql_archive -S slot1 -v


pg_receivewal is writing into postgresql_archive, this seems to work.




  • then I insert something into the database, let's say at 16:21.

  • I wait some minutes, let's say until 16:27 and delete all the insert.


Then I want to recover the inserts by doing...



service postgresql stop


(do I need to stop pg_receivewal as well)?



# mv main main.before_recovery
# cp -rp /media/extern/postgresql_basebackup main

nano /var/lib/postgresql/11/main/recovery.conf


I add the following content



restore_command = 'cp -r /media/extern/postgresql_archive/%f %p'
recovery_target_time='2018-01-06 16:22:00'


Then I execute



# chown postgres:postgres recovery.conf 
# chmod 700 recovery.conf

service postgresql start


After startup, the file changes to recovery.done, but the state in database is wrong. It didn't restore the data. The database is still empty, so the PITR didn't work, why?



What should I do In case if everything was successful after recovery?. I'm unsure about these questions:




  • Creating a new slot2 by executing pg_create_physical_replication_slot('slot2'); and streaming from this slot by pg_receivewal -D /media/extern/postgresql_archive -S slot2 -v?

  • Doing a pg_receivewal -D /media/extern/postgresql_archive -S slot1 -v again?

  • Do I have to delete anywhen any data in postgresql_archive? (-> Probably not)

  • When do I have to create another base backup?

  • When and why do I execute select pg_switch_wal(); in this recovery concept?

  • How do I deal with new 'timelines' after recovery? I understand the concept of the timelines, but I'm unsure how I should proceed with it after recovery.


[UPDATE]

jjanes pointed out, that the date is wrong. I corrected it, but I still get an empty database after recovery. I tried these steps after I recovered the database, which is now empty:




2019-01-08, 18:50: create a new base backup from this empty database
to have a good starting point.



2019-01-08, 18:55 created slot1



pg_receivewal -D /media/extern/postgresql_archive -S slot1 -v



2019-01-08, 18:57 insert



2019-01-08, 19:38 delete




service postgresql stop



# mv main main.before_recovery
# cp -rp /media/extern/postgresql_basebackup main
# chmod 700 main

# nano /var/lib/postgresql/11/main/recovery.conf

restore_command = 'cp -r /media/extern/postgresql_archive/%f %p'
recovery_target_time='2019-01-08 19:20:00'

# chown postgres:postgres recovery.conf
# chmod 700 recovery.conf

# service postgresql start


(btw: I saw that it starts by itself new timelimes after recovery.)



[UPDATE]

I activated in postgresql.conf



checkpoint_flush_after = 256kB 
checkpoint_timeout = 30s


I tried to restore the database by using the previous method but without recovery_target_time and without any DELETE statement. I just wanted to look if the current full state can be rebuilt at all. Additionally I renamed the current wal file 00000007000000000000002D.partial to 00000007000000000000002D after stopping the database and before recovering the data.



I'm currently not sure which of these things worked, but at least, the non-PITR recovery seem to work, because I was able to restore the latest data by installing the (empty) base backup and the wal files. At least a step into the right direction, but this only works when you don't miss any shipped wal files. Here, question 2 comes into play: What is the correct workflow to handle the "next shipping iteration".
At first, you can't start pg_receivewal -D /media/extern/postgresql_archive -S slot1 -v
again without deleting the shipped WALs in the external folder. Otherwise it would not start shipping the logs and it would abort with connection errors. This means that you can throw away your old base backup, because when you try the recover again with the old base backup, you would miss all the wal logs between base backup and last recovery point (because you deleted them). That also means that you have to create a new base backup immediately from the recovery point state. When you start log shipping again, you have no "gap" then between the new base backup and the wal files.



The next step is to get PITR running...










share|improve this question















I'm testing and trying to figure out how the backup and recovery strategy in PostgreSQL 11 works but it does not work as expected. When I recover the backup, I don't get the correct state. I get any state after a given timestamp. In detail:



I have this setup in database:



wal_level = replica 
max_wal_senders = 10
archive_mode = on


I have executed the following commands:



postgres=# select pg_create_physical_replication_slot('slot1');
pg_basebackup -D /media/extern/postgresql_basebackup/
pg_receivewal -D /media/extern/postgresql_archive -S slot1 -v


pg_receivewal is writing into postgresql_archive, this seems to work.




  • then I insert something into the database, let's say at 16:21.

  • I wait some minutes, let's say until 16:27 and delete all the insert.


Then I want to recover the inserts by doing...



service postgresql stop


(do I need to stop pg_receivewal as well)?



# mv main main.before_recovery
# cp -rp /media/extern/postgresql_basebackup main

nano /var/lib/postgresql/11/main/recovery.conf


I add the following content



restore_command = 'cp -r /media/extern/postgresql_archive/%f %p'
recovery_target_time='2018-01-06 16:22:00'


Then I execute



# chown postgres:postgres recovery.conf 
# chmod 700 recovery.conf

service postgresql start


After startup, the file changes to recovery.done, but the state in database is wrong. It didn't restore the data. The database is still empty, so the PITR didn't work, why?



What should I do In case if everything was successful after recovery?. I'm unsure about these questions:




  • Creating a new slot2 by executing pg_create_physical_replication_slot('slot2'); and streaming from this slot by pg_receivewal -D /media/extern/postgresql_archive -S slot2 -v?

  • Doing a pg_receivewal -D /media/extern/postgresql_archive -S slot1 -v again?

  • Do I have to delete anywhen any data in postgresql_archive? (-> Probably not)

  • When do I have to create another base backup?

  • When and why do I execute select pg_switch_wal(); in this recovery concept?

  • How do I deal with new 'timelines' after recovery? I understand the concept of the timelines, but I'm unsure how I should proceed with it after recovery.


[UPDATE]

jjanes pointed out, that the date is wrong. I corrected it, but I still get an empty database after recovery. I tried these steps after I recovered the database, which is now empty:




2019-01-08, 18:50: create a new base backup from this empty database
to have a good starting point.



2019-01-08, 18:55 created slot1



pg_receivewal -D /media/extern/postgresql_archive -S slot1 -v



2019-01-08, 18:57 insert



2019-01-08, 19:38 delete




service postgresql stop



# mv main main.before_recovery
# cp -rp /media/extern/postgresql_basebackup main
# chmod 700 main

# nano /var/lib/postgresql/11/main/recovery.conf

restore_command = 'cp -r /media/extern/postgresql_archive/%f %p'
recovery_target_time='2019-01-08 19:20:00'

# chown postgres:postgres recovery.conf
# chmod 700 recovery.conf

# service postgresql start


(btw: I saw that it starts by itself new timelimes after recovery.)



[UPDATE]

I activated in postgresql.conf



checkpoint_flush_after = 256kB 
checkpoint_timeout = 30s


I tried to restore the database by using the previous method but without recovery_target_time and without any DELETE statement. I just wanted to look if the current full state can be rebuilt at all. Additionally I renamed the current wal file 00000007000000000000002D.partial to 00000007000000000000002D after stopping the database and before recovering the data.



I'm currently not sure which of these things worked, but at least, the non-PITR recovery seem to work, because I was able to restore the latest data by installing the (empty) base backup and the wal files. At least a step into the right direction, but this only works when you don't miss any shipped wal files. Here, question 2 comes into play: What is the correct workflow to handle the "next shipping iteration".
At first, you can't start pg_receivewal -D /media/extern/postgresql_archive -S slot1 -v
again without deleting the shipped WALs in the external folder. Otherwise it would not start shipping the logs and it would abort with connection errors. This means that you can throw away your old base backup, because when you try the recover again with the old base backup, you would miss all the wal logs between base backup and last recovery point (because you deleted them). That also means that you have to create a new base backup immediately from the recovery point state. When you start log shipping again, you have no "gap" then between the new base backup and the wal files.



The next step is to get PITR running...







postgresql recovery postgresql-11






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 1 hour ago







Bevor

















asked Jan 6 at 16:05









BevorBevor

685




685






This question has an open bounty worth +50
reputation from Bevor ending in 6 days.


The current answers do not contain enough detail.


I will give a bounty to the one who can give me clarification about the given questions.








This question has an open bounty worth +50
reputation from Bevor ending in 6 days.


The current answers do not contain enough detail.


I will give a bounty to the one who can give me clarification about the given questions.














  • How can he possibly give you more detail?
    – Evan Carroll
    yesterday










  • @EvanCarroll The first part of the question is to understand, why the recovery does not restore the data. The second part of the question is, how should I proceed after the data has been restored (successfully). Do I have to make something 'special' according to the concept of timelines or slots, or whatever or do I let the database just run. I know this is no a very specific question, but I'm satisfied with a good overview of the concept.
    – Bevor
    yesterday




















  • How can he possibly give you more detail?
    – Evan Carroll
    yesterday










  • @EvanCarroll The first part of the question is to understand, why the recovery does not restore the data. The second part of the question is, how should I proceed after the data has been restored (successfully). Do I have to make something 'special' according to the concept of timelines or slots, or whatever or do I let the database just run. I know this is no a very specific question, but I'm satisfied with a good overview of the concept.
    – Bevor
    yesterday


















How can he possibly give you more detail?
– Evan Carroll
yesterday




How can he possibly give you more detail?
– Evan Carroll
yesterday












@EvanCarroll The first part of the question is to understand, why the recovery does not restore the data. The second part of the question is, how should I proceed after the data has been restored (successfully). Do I have to make something 'special' according to the concept of timelines or slots, or whatever or do I let the database just run. I know this is no a very specific question, but I'm satisfied with a good overview of the concept.
– Bevor
yesterday






@EvanCarroll The first part of the question is to understand, why the recovery does not restore the data. The second part of the question is, how should I proceed after the data has been restored (successfully). Do I have to make something 'special' according to the concept of timelines or slots, or whatever or do I let the database just run. I know this is no a very specific question, but I'm satisfied with a good overview of the concept.
– Bevor
yesterday












1 Answer
1






active

oldest

votes


















2















recovery_target_time='2018-01-06 16:22:00'




This 2019, not 2018. If you look in the server log file, you will probably find the recovery stopped as soon as it could (as soon as it reached a consistent state), because it could not stop as soon as you told it to, being a year late for that.






share|improve this answer























  • It was one error, you are right. But it still does not work. See my update.
    – Bevor
    yesterday










  • I think we got mixed up by the date. There is no database or data from 2018. I installed a complete new empty database yesterday and tried to figure out how the recovery concept works before I make a setup for going live. When I have a base backup from 19:00 (2019-01-08), I add data at 19:15, I delete data at 19:30 and I recover data with `recovery_target_time='2019-01-08 19:20:00' then I expect the delete from 19:30 is gone and I have the inserts back. But this does not seem to work.
    – Bevor
    yesterday












  • The contents of the server log file probably still holds the answer. What time does it report that it actually recovered to?
    – jjanes
    23 hours ago











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "182"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f226449%2fhow-does-the-recovery-strategy-of-postgresql-exactly-work%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2















recovery_target_time='2018-01-06 16:22:00'




This 2019, not 2018. If you look in the server log file, you will probably find the recovery stopped as soon as it could (as soon as it reached a consistent state), because it could not stop as soon as you told it to, being a year late for that.






share|improve this answer























  • It was one error, you are right. But it still does not work. See my update.
    – Bevor
    yesterday










  • I think we got mixed up by the date. There is no database or data from 2018. I installed a complete new empty database yesterday and tried to figure out how the recovery concept works before I make a setup for going live. When I have a base backup from 19:00 (2019-01-08), I add data at 19:15, I delete data at 19:30 and I recover data with `recovery_target_time='2019-01-08 19:20:00' then I expect the delete from 19:30 is gone and I have the inserts back. But this does not seem to work.
    – Bevor
    yesterday












  • The contents of the server log file probably still holds the answer. What time does it report that it actually recovered to?
    – jjanes
    23 hours ago
















2















recovery_target_time='2018-01-06 16:22:00'




This 2019, not 2018. If you look in the server log file, you will probably find the recovery stopped as soon as it could (as soon as it reached a consistent state), because it could not stop as soon as you told it to, being a year late for that.






share|improve this answer























  • It was one error, you are right. But it still does not work. See my update.
    – Bevor
    yesterday










  • I think we got mixed up by the date. There is no database or data from 2018. I installed a complete new empty database yesterday and tried to figure out how the recovery concept works before I make a setup for going live. When I have a base backup from 19:00 (2019-01-08), I add data at 19:15, I delete data at 19:30 and I recover data with `recovery_target_time='2019-01-08 19:20:00' then I expect the delete from 19:30 is gone and I have the inserts back. But this does not seem to work.
    – Bevor
    yesterday












  • The contents of the server log file probably still holds the answer. What time does it report that it actually recovered to?
    – jjanes
    23 hours ago














2












2








2







recovery_target_time='2018-01-06 16:22:00'




This 2019, not 2018. If you look in the server log file, you will probably find the recovery stopped as soon as it could (as soon as it reached a consistent state), because it could not stop as soon as you told it to, being a year late for that.






share|improve this answer















recovery_target_time='2018-01-06 16:22:00'




This 2019, not 2018. If you look in the server log file, you will probably find the recovery stopped as soon as it could (as soon as it reached a consistent state), because it could not stop as soon as you told it to, being a year late for that.







share|improve this answer














share|improve this answer



share|improve this answer








edited yesterday









Evan Carroll

31.2k865206




31.2k865206










answered yesterday









jjanesjjanes

12.6k816




12.6k816












  • It was one error, you are right. But it still does not work. See my update.
    – Bevor
    yesterday










  • I think we got mixed up by the date. There is no database or data from 2018. I installed a complete new empty database yesterday and tried to figure out how the recovery concept works before I make a setup for going live. When I have a base backup from 19:00 (2019-01-08), I add data at 19:15, I delete data at 19:30 and I recover data with `recovery_target_time='2019-01-08 19:20:00' then I expect the delete from 19:30 is gone and I have the inserts back. But this does not seem to work.
    – Bevor
    yesterday












  • The contents of the server log file probably still holds the answer. What time does it report that it actually recovered to?
    – jjanes
    23 hours ago


















  • It was one error, you are right. But it still does not work. See my update.
    – Bevor
    yesterday










  • I think we got mixed up by the date. There is no database or data from 2018. I installed a complete new empty database yesterday and tried to figure out how the recovery concept works before I make a setup for going live. When I have a base backup from 19:00 (2019-01-08), I add data at 19:15, I delete data at 19:30 and I recover data with `recovery_target_time='2019-01-08 19:20:00' then I expect the delete from 19:30 is gone and I have the inserts back. But this does not seem to work.
    – Bevor
    yesterday












  • The contents of the server log file probably still holds the answer. What time does it report that it actually recovered to?
    – jjanes
    23 hours ago
















It was one error, you are right. But it still does not work. See my update.
– Bevor
yesterday




It was one error, you are right. But it still does not work. See my update.
– Bevor
yesterday












I think we got mixed up by the date. There is no database or data from 2018. I installed a complete new empty database yesterday and tried to figure out how the recovery concept works before I make a setup for going live. When I have a base backup from 19:00 (2019-01-08), I add data at 19:15, I delete data at 19:30 and I recover data with `recovery_target_time='2019-01-08 19:20:00' then I expect the delete from 19:30 is gone and I have the inserts back. But this does not seem to work.
– Bevor
yesterday






I think we got mixed up by the date. There is no database or data from 2018. I installed a complete new empty database yesterday and tried to figure out how the recovery concept works before I make a setup for going live. When I have a base backup from 19:00 (2019-01-08), I add data at 19:15, I delete data at 19:30 and I recover data with `recovery_target_time='2019-01-08 19:20:00' then I expect the delete from 19:30 is gone and I have the inserts back. But this does not seem to work.
– Bevor
yesterday














The contents of the server log file probably still holds the answer. What time does it report that it actually recovered to?
– jjanes
23 hours ago




The contents of the server log file probably still holds the answer. What time does it report that it actually recovered to?
– jjanes
23 hours ago


















draft saved

draft discarded




















































Thanks for contributing an answer to Database Administrators Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f226449%2fhow-does-the-recovery-strategy-of-postgresql-exactly-work%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Liste der Baudenkmale in Friedland (Mecklenburg)

Single-Malt-Whisky

Czorneboh