in Education by
I run a number of queries for adhoc analysis against a postgres database. Many times I will leave the connection open through the day instead of ending after each query. I receive a postgres dump over scp through a shell script every five minutes and I would like to restore the database without cutting the connections. Is this possible? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
One of the few activities that you cannot perform while a user is connected is dropping the database. So – if that is what you are doing during restore – you'll have to change your approach. Don't drop the database (don't use the -C option in pg_dump or pg_restore), but rather drop and recreate the schemas and objects that don't depend on a schema (like large objects). You can use the -c flag of pg_dump or pg_restore for that. The other problem you might run into is connections with open transactions (state “idle in transaction”). Such connections can hold locks that keep you from dropping and recreating objects, and you'll have to use pg_terminate_backend() to get rid of them.

Related questions

0 votes
    I want to load Google fonts in the head-section of my page using a php-function. My -area looks like this: ... ... Now ... I do this, there will be a "1" displayed (because of the...
asked Jun 2, 2022 in Education by JackTerrance
0 votes
    I want to load Google fonts in the head-section of my page using a php-function. My -area looks like this: ... ... Now ... I do this, there will be a "1" displayed (because of the...
asked May 30, 2022 in Education by JackTerrance
0 votes
    I want to load Google fonts in the head-section of my page using a php-function. My -area looks like this: ... ... Now ... I do this, there will be a "1" displayed (because of the...
asked May 26, 2022 in Education by JackTerrance
0 votes
    I want to load Google fonts in the head-section of my page using a php-function. My -area looks like this: ... ... Now ... I do this, there will be a "1" displayed (because of the...
asked May 17, 2022 in Education by JackTerrance
0 votes
    If I have a table with results like this: 0001400OL 0578400OL 354085OL 48679OL and if I wanted to replace ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 26, 2022 in Education by JackTerrance
0 votes
    What is the square roots of a three digit number ending with one? (a) 1 (b) 11 (c) 121 (d) 9 I ... Square Roots topic in section Squares and Square Roots of Mathematics - Class 8...
asked Oct 10, 2021 in Education by JackTerrance
0 votes
    If a perfect square ends with 1 then the square root can be ending with ___ & ___ (a) 9 & 2 (b) 9 & ... Roots topic in portion Squares and Square Roots of Mathematics - Class 8...
asked Oct 10, 2021 in Education by JackTerrance
0 votes
    I'm doing a simple dotnet restoreon my mac. I'm using the (for now) latest dotnet CLI version 2. ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 24, 2022 in Education by JackTerrance
0 votes
    I created a sample web application with ASP.NET Core to test the storage and retrieval of the cookie. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 26, 2022 in Education by JackTerrance
0 votes
    I have a database in dev (SQL Server 2005 on Windows Server 2008) that I need to move to prod ( ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 27, 2022 in Education by JackTerrance
0 votes
    Say I'm in a Git repository. I delete a file and commit that change. I continue working and make some ... my original project checkout. Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    I've created a BACPAC backup of my Azure SQZ database using the option "Export" in Azure management console. I ... written it already . Select the correct answer from above options...
asked Jan 20, 2022 in Education by JackTerrance
0 votes
    I'm working on a rather big project with my team and after a while, we struck into a big problem ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jan 16, 2022 in Education by JackTerrance
0 votes
    Explain the restore window .? [Good morning guys…have a nice day] Select the correct answer from above options...
asked Dec 24, 2021 in Education by JackTerrance
0 votes
    ______________ is competent to restore corrupted Exchange Server Database files as well as recovering unapproachable mails in ... and answers pdf, mcq on Cyber Security pdf,...
asked Nov 3, 2021 in Education by JackTerrance
...