Обсуждение: Default data directory
Hello, We're building a test box for our webmaster to play in. It needs to have the same config as his production box. The postgres default data directory doesn't match the location of the data directory location on the production box. The postgresql.conf file has the line that says that it changes the default data location commented out. Is there somewhere else that postgres can get this information? I can't figure out how the Postgres that's running on the production web server knows where to look for its data. Thanks, Carol
Carol Walter <walterc@indiana.edu> writes: > I can't figure out how the Postgres that's running on the production > web server knows where to look for its data. Generally the location of the data directory is determined by a -D switch on the postmaster command line, or by setting the PGDATA environment variable in the script that launches the postmaster. Setting it in the configuration file would be circular logic, except in the uncommon sort of configuration where the config file doesn't live in the data directory (in which case the -D switch only indicates where the config files are). regards, tom lane
On Fri, Sep 5, 2008 at 12:44 PM, Carol Walter <walterc@indiana.edu> wrote: > Hello, > > We're building a test box for our webmaster to play in. It needs to have > the same config as his production box. The postgres default data directory > doesn't match the location of the data directory location on the production > box. The postgresql.conf file has the line that says that it changes the > default data location commented out. Is there somewhere else that postgres > can get this information? > > I can't figure out how the Postgres that's running on the production web > server knows where to look for its data. We don't quite have enough information to really troubleshoot this. What OS, and how was pg installed in each if they're different. If the webmaster needs a sandbox like production, then I would assume the two OSes are the same, right?
> Is there somewhere else that postgres can get this information? > I can't figure out how the Postgres that's running on the production web > server knows where to look for its data. Could it be the compile time setting? I guess you can try # pg_config --configure and the --prefix=... will likely be where the "data" sits? Regards, Ben Kim