Recommended procedure to remove old files after major version PostgreSQL database cluster upgradeHow do I...

Why is Shelob considered evil?

In a post apocalypse world, with no power and few survivors, would Satnav still work?

How to wrap a figure in exam document?

Is it possible to methodically find the total of ways to read a given phrase making a stack?

Are all power cords made equal?

Is practicing on a digital piano harmful to an experienced piano player?

Crack the bank account's password!

What is wrong with my use of "find -print0"?

How can guns be countered by melee combat without raw-ability or exceptional explanations?

In the Lost in Space intro why was Dr. Smith actor listed as a special guest star?

Is it possible to have the same planeswalker from different editions in a Commander deck?

What could cause an entire planet of humans to become aphasic?

filecontents: select rows of group to display

Can you prevent a man in the middle from reading the message?

Why is Acetic acid (pKa = 4.76) stronger than carbonic acid (pKa = 6.36)?

How unreachable are Jupiter's moons from Mars with the technology developed for going to Mars?

Is it possible to narrate a novel in a faux-historical style without alienating the reader?

Expression for "unconsciously using words (or accents) used by a person you often talk with or listen to"?

Is the Maximum Use License for Everybody (MULE) a FOSS license?

How can I keep my gold safe from other PCs?

Disk space full during insert, what happens?

Is it possible to detect 100% of SQLi with a simple regex?

Limits of Rolle theorem

Is there a way to pause a running process on Linux systems and resume later?



Recommended procedure to remove old files after major version PostgreSQL database cluster upgrade


How do I uninstall the old version of Postgres on CentOS 7?PostgreSQL pg_upgrade --link mode performance issue after upgradePoint PostgreSQL on Ubuntu to a new datadircannot find -lpq after upgrading PostgreSQL 8 to 9 on CentOS 5Will PostgreSQL server work if I install the service in mounted partitionUpgrade from Postgres 9.3 to 9.5PostgreSQL migrating from 9.2 to 9.5 with data dir on different volumeWhat is the recommended way to autostart a Postgres cluster using a nonstandard data directory?How to uninstall PostgreSQL (and pgAdmin3) from OSX Sierra?pg_ctl won't start postgresUnable to Restart PostgreSQL after attempting to move pg_xlog to different partition













0















I (successfully) followed the upgrade procedure in §18.6.1 of the PostgreSQL Manual to upgrade a PostgreSQL database cluster from 10.7 to 11.2 (running Fedora 29). I would like to remove the old tablepaces (some of which are user-defined tablespaces) and other legacy files to reclaim space not needed from the old cluster.



There are two approaches I’ve considered:




  1. Connect to the old database cluster as postgres and run queries against the pg_catalog system table to DROP tables, tablespaces, databases, etc.

  2. Run find -L /path/to/tablespace/root -type d -user postgres -iname “PG_10_*” exec rm -rf {} ; to remove directories in the tablespace locations (note the new tablespaces share the same root directory as the old ones)


After either (1) or (2), I’d remove the old PGDATA directory.



Is there a preferred approach (including any methods not mentioned)?



Note, this is distinct from the following post: How do I uninstall the old version of Postgres on CentOS 7









share



























    0















    I (successfully) followed the upgrade procedure in §18.6.1 of the PostgreSQL Manual to upgrade a PostgreSQL database cluster from 10.7 to 11.2 (running Fedora 29). I would like to remove the old tablepaces (some of which are user-defined tablespaces) and other legacy files to reclaim space not needed from the old cluster.



    There are two approaches I’ve considered:




    1. Connect to the old database cluster as postgres and run queries against the pg_catalog system table to DROP tables, tablespaces, databases, etc.

    2. Run find -L /path/to/tablespace/root -type d -user postgres -iname “PG_10_*” exec rm -rf {} ; to remove directories in the tablespace locations (note the new tablespaces share the same root directory as the old ones)


    After either (1) or (2), I’d remove the old PGDATA directory.



    Is there a preferred approach (including any methods not mentioned)?



    Note, this is distinct from the following post: How do I uninstall the old version of Postgres on CentOS 7









    share

























      0












      0








      0








      I (successfully) followed the upgrade procedure in §18.6.1 of the PostgreSQL Manual to upgrade a PostgreSQL database cluster from 10.7 to 11.2 (running Fedora 29). I would like to remove the old tablepaces (some of which are user-defined tablespaces) and other legacy files to reclaim space not needed from the old cluster.



      There are two approaches I’ve considered:




      1. Connect to the old database cluster as postgres and run queries against the pg_catalog system table to DROP tables, tablespaces, databases, etc.

      2. Run find -L /path/to/tablespace/root -type d -user postgres -iname “PG_10_*” exec rm -rf {} ; to remove directories in the tablespace locations (note the new tablespaces share the same root directory as the old ones)


      After either (1) or (2), I’d remove the old PGDATA directory.



      Is there a preferred approach (including any methods not mentioned)?



      Note, this is distinct from the following post: How do I uninstall the old version of Postgres on CentOS 7









      share














      I (successfully) followed the upgrade procedure in §18.6.1 of the PostgreSQL Manual to upgrade a PostgreSQL database cluster from 10.7 to 11.2 (running Fedora 29). I would like to remove the old tablepaces (some of which are user-defined tablespaces) and other legacy files to reclaim space not needed from the old cluster.



      There are two approaches I’ve considered:




      1. Connect to the old database cluster as postgres and run queries against the pg_catalog system table to DROP tables, tablespaces, databases, etc.

      2. Run find -L /path/to/tablespace/root -type d -user postgres -iname “PG_10_*” exec rm -rf {} ; to remove directories in the tablespace locations (note the new tablespaces share the same root directory as the old ones)


      After either (1) or (2), I’d remove the old PGDATA directory.



      Is there a preferred approach (including any methods not mentioned)?



      Note, this is distinct from the following post: How do I uninstall the old version of Postgres on CentOS 7







      postgresql postgresql-10 postgresql-11





      share












      share










      share



      share










      asked 1 min ago









      WheeWhee

      557




      557






















          0






          active

          oldest

          votes











          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%2f230574%2frecommended-procedure-to-remove-old-files-after-major-version-postgresql-databas%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          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.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f230574%2frecommended-procedure-to-remove-old-files-after-major-version-postgresql-databas%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

          Szabolcs (Ungheria) Altri progetti | Menu di navigazione48°10′14.56″N 21°29′33.14″E /...

          Discografia di Klaus Schulze Indice Album in studio | Album dal vivo | Singoli | Antologie | Colonne...

          How to make inet_server_addr() return localhost in spite of ::1/128RETURN NEXT in Postgres FunctionConnect to...