On FreeBSD, or other BSDs, what directory is commonly used for data folder storing the content of a database such as Postgres

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I am wondering if there is a convention on where to store the data folder containing all the files for the tables and rows of a relational database system such as Postgres.










share|improve this question



























    up vote
    1
    down vote

    favorite












    I am wondering if there is a convention on where to store the data folder containing all the files for the tables and rows of a relational database system such as Postgres.










    share|improve this question

























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I am wondering if there is a convention on where to store the data folder containing all the files for the tables and rows of a relational database system such as Postgres.










      share|improve this question















      I am wondering if there is a convention on where to store the data folder containing all the files for the tables and rows of a relational database system such as Postgres.







      freebsd directory directory-structure postgresql bsd






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 26 at 8:00









      Rui F Ribeiro

      38.3k1477127




      38.3k1477127










      asked Nov 26 at 7:56









      Basil Bourque

      226212




      226212




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          3
          down vote



          accepted










          On OpenBSD, the (OpenBSD) postgresql-server package will be preconfigured to use /var/postgresql/data for its databases. It also adds a _postgresql service user with /var/postgresql as its home directory.



          Storing databases under /var makes sense as they generally contain variable data. If your /var partition is not big enough, you may consider changing this to some other location where you have more space, or mounting a separate filesystem at /var/postgresql. Unfortunately, I'm not a FreeBSD user and can not tell you how to do that in the most convenient way for PostgreSQL on FreeBSD.



          On OpenBSD, changing the location of the data directory would involve changing a datadir variable in the rc script /etc/rc.d/postgresql (this particular variable does not seem to be configurable through the native rcctl utility for whatever reason).




          From a comment by JdeBP: For FreeBSD, the default location for the databases is /var/db/postgres/data10 (presumably this is for PostgreSQL 10). This is configurable by changing/setting the value of the postgresql_data variable in /etc/rc.conf.






          share|improve this answer


















          • 1




            Mounting a filesystem with more space on /var/postgres is also an option. Also, relevant man page for filesystem hierarchy: man.openbsd.org/hier
            – Peschke
            Nov 26 at 8:22






          • 1




            /var/db/postgres/data10 and postgresql_data in /etc/rc.conf
            – JdeBP
            Nov 26 at 11:36










          • @JdeBP Check my addition. Correct?
            – Kusalananda
            Nov 26 at 11:40






          • 2




            I believe so.
            – JdeBP
            Nov 26 at 11:44










          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          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',
          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%2funix.stackexchange.com%2fquestions%2f484137%2fon-freebsd-or-other-bsds-what-directory-is-commonly-used-for-data-folder-stori%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








          up vote
          3
          down vote



          accepted










          On OpenBSD, the (OpenBSD) postgresql-server package will be preconfigured to use /var/postgresql/data for its databases. It also adds a _postgresql service user with /var/postgresql as its home directory.



          Storing databases under /var makes sense as they generally contain variable data. If your /var partition is not big enough, you may consider changing this to some other location where you have more space, or mounting a separate filesystem at /var/postgresql. Unfortunately, I'm not a FreeBSD user and can not tell you how to do that in the most convenient way for PostgreSQL on FreeBSD.



          On OpenBSD, changing the location of the data directory would involve changing a datadir variable in the rc script /etc/rc.d/postgresql (this particular variable does not seem to be configurable through the native rcctl utility for whatever reason).




          From a comment by JdeBP: For FreeBSD, the default location for the databases is /var/db/postgres/data10 (presumably this is for PostgreSQL 10). This is configurable by changing/setting the value of the postgresql_data variable in /etc/rc.conf.






          share|improve this answer


















          • 1




            Mounting a filesystem with more space on /var/postgres is also an option. Also, relevant man page for filesystem hierarchy: man.openbsd.org/hier
            – Peschke
            Nov 26 at 8:22






          • 1




            /var/db/postgres/data10 and postgresql_data in /etc/rc.conf
            – JdeBP
            Nov 26 at 11:36










          • @JdeBP Check my addition. Correct?
            – Kusalananda
            Nov 26 at 11:40






          • 2




            I believe so.
            – JdeBP
            Nov 26 at 11:44














          up vote
          3
          down vote



          accepted










          On OpenBSD, the (OpenBSD) postgresql-server package will be preconfigured to use /var/postgresql/data for its databases. It also adds a _postgresql service user with /var/postgresql as its home directory.



          Storing databases under /var makes sense as they generally contain variable data. If your /var partition is not big enough, you may consider changing this to some other location where you have more space, or mounting a separate filesystem at /var/postgresql. Unfortunately, I'm not a FreeBSD user and can not tell you how to do that in the most convenient way for PostgreSQL on FreeBSD.



          On OpenBSD, changing the location of the data directory would involve changing a datadir variable in the rc script /etc/rc.d/postgresql (this particular variable does not seem to be configurable through the native rcctl utility for whatever reason).




          From a comment by JdeBP: For FreeBSD, the default location for the databases is /var/db/postgres/data10 (presumably this is for PostgreSQL 10). This is configurable by changing/setting the value of the postgresql_data variable in /etc/rc.conf.






          share|improve this answer


















          • 1




            Mounting a filesystem with more space on /var/postgres is also an option. Also, relevant man page for filesystem hierarchy: man.openbsd.org/hier
            – Peschke
            Nov 26 at 8:22






          • 1




            /var/db/postgres/data10 and postgresql_data in /etc/rc.conf
            – JdeBP
            Nov 26 at 11:36










          • @JdeBP Check my addition. Correct?
            – Kusalananda
            Nov 26 at 11:40






          • 2




            I believe so.
            – JdeBP
            Nov 26 at 11:44












          up vote
          3
          down vote



          accepted







          up vote
          3
          down vote



          accepted






          On OpenBSD, the (OpenBSD) postgresql-server package will be preconfigured to use /var/postgresql/data for its databases. It also adds a _postgresql service user with /var/postgresql as its home directory.



          Storing databases under /var makes sense as they generally contain variable data. If your /var partition is not big enough, you may consider changing this to some other location where you have more space, or mounting a separate filesystem at /var/postgresql. Unfortunately, I'm not a FreeBSD user and can not tell you how to do that in the most convenient way for PostgreSQL on FreeBSD.



          On OpenBSD, changing the location of the data directory would involve changing a datadir variable in the rc script /etc/rc.d/postgresql (this particular variable does not seem to be configurable through the native rcctl utility for whatever reason).




          From a comment by JdeBP: For FreeBSD, the default location for the databases is /var/db/postgres/data10 (presumably this is for PostgreSQL 10). This is configurable by changing/setting the value of the postgresql_data variable in /etc/rc.conf.






          share|improve this answer














          On OpenBSD, the (OpenBSD) postgresql-server package will be preconfigured to use /var/postgresql/data for its databases. It also adds a _postgresql service user with /var/postgresql as its home directory.



          Storing databases under /var makes sense as they generally contain variable data. If your /var partition is not big enough, you may consider changing this to some other location where you have more space, or mounting a separate filesystem at /var/postgresql. Unfortunately, I'm not a FreeBSD user and can not tell you how to do that in the most convenient way for PostgreSQL on FreeBSD.



          On OpenBSD, changing the location of the data directory would involve changing a datadir variable in the rc script /etc/rc.d/postgresql (this particular variable does not seem to be configurable through the native rcctl utility for whatever reason).




          From a comment by JdeBP: For FreeBSD, the default location for the databases is /var/db/postgres/data10 (presumably this is for PostgreSQL 10). This is configurable by changing/setting the value of the postgresql_data variable in /etc/rc.conf.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 26 at 11:39

























          answered Nov 26 at 8:17









          Kusalananda

          118k16223362




          118k16223362







          • 1




            Mounting a filesystem with more space on /var/postgres is also an option. Also, relevant man page for filesystem hierarchy: man.openbsd.org/hier
            – Peschke
            Nov 26 at 8:22






          • 1




            /var/db/postgres/data10 and postgresql_data in /etc/rc.conf
            – JdeBP
            Nov 26 at 11:36










          • @JdeBP Check my addition. Correct?
            – Kusalananda
            Nov 26 at 11:40






          • 2




            I believe so.
            – JdeBP
            Nov 26 at 11:44












          • 1




            Mounting a filesystem with more space on /var/postgres is also an option. Also, relevant man page for filesystem hierarchy: man.openbsd.org/hier
            – Peschke
            Nov 26 at 8:22






          • 1




            /var/db/postgres/data10 and postgresql_data in /etc/rc.conf
            – JdeBP
            Nov 26 at 11:36










          • @JdeBP Check my addition. Correct?
            – Kusalananda
            Nov 26 at 11:40






          • 2




            I believe so.
            – JdeBP
            Nov 26 at 11:44







          1




          1




          Mounting a filesystem with more space on /var/postgres is also an option. Also, relevant man page for filesystem hierarchy: man.openbsd.org/hier
          – Peschke
          Nov 26 at 8:22




          Mounting a filesystem with more space on /var/postgres is also an option. Also, relevant man page for filesystem hierarchy: man.openbsd.org/hier
          – Peschke
          Nov 26 at 8:22




          1




          1




          /var/db/postgres/data10 and postgresql_data in /etc/rc.conf
          – JdeBP
          Nov 26 at 11:36




          /var/db/postgres/data10 and postgresql_data in /etc/rc.conf
          – JdeBP
          Nov 26 at 11:36












          @JdeBP Check my addition. Correct?
          – Kusalananda
          Nov 26 at 11:40




          @JdeBP Check my addition. Correct?
          – Kusalananda
          Nov 26 at 11:40




          2




          2




          I believe so.
          – JdeBP
          Nov 26 at 11:44




          I believe so.
          – JdeBP
          Nov 26 at 11:44

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Unix & Linux 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%2funix.stackexchange.com%2fquestions%2f484137%2fon-freebsd-or-other-bsds-what-directory-is-commonly-used-for-data-folder-stori%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

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay