Thread: Configuring pg on os x lion
Hi Everyone,
I am trying to get pg working on os x lion and getting some configuration errors. Wondering if anyone on this list faced these before.
I installed pg via homebrew and I get this error when trying to launch it via a local web server on my machine:
could not connect to server: No such file or directory
Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
So I go ahead and try to run postgres directly. When I do I get this:
larson:~ larson$ /usr/local/Cellar/postgresql/9.1.3/bin/postgres ; exit; postgres does not know where to find the server configuration file. You must specify the --config-file or -D invocation option or set the PGDATA environment variable. logout
So my thinking here is that the config files are missing. I searched for pg_hba.conf file and couldn't find it. Now I am unsure how to proceed, when I used pg on os x Snow Leopard I could go into a ~/Library/Developer/postgresql folder and all my config files would be there. There would also be logs I could read to get a better idea of what's going. Now those seem to be missing, does anyone know where I can find them?
Thanks in advance for your help,
Andrew
On Sat, Apr 28, 2012 at 12:52 AM, Andrew Barinov <andy.lauerbarinov@me.com> wrote:
Could you please share below information for troubleshooting this issue:Hi Everyone,I am trying to get pg working on os x lion and getting some configuration errors. Wondering if anyone on this list faced these before.I installed pg via homebrew and I get this error when trying to launch it via a local web server on my machine:could not connect to server: No such file or directory
Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
So I go ahead and try to run postgres directly. When I do I get this:larson:~ larson$ /usr/local/Cellar/postgresql/9.1.3/bin/postgres ; exit; postgres does not know where to find the server configuration file. You must specify the --config-file or -D invocation option or set the PGDATA environment variable. logout
So my thinking here is that the config files are missing. I searched for pg_hba.conf file and couldn't find it. Now I am unsure how to proceed, when I used pg on os x Snow Leopard I could go into a ~/Library/Developer/postgresql folder and all my config files would be there. There would also be logs I could read to get a better idea of what's going. Now those seem to be missing, does anyone know where I can find them?Thanks in advance for your help,Andrew
/usr/local/Cellar/postgresql/9.1.3/bin/pg_config
/usr/local/Cellar/postgresql/9.1.3/bin/pg_ctl -D <data Directory Path> status
Hi,
Sure, here are the results from the two commands:
larson:~ larson$ /usr/local/Cellar/postgresql/9.1.3/bin/pg_config
BINDIR = /usr/local/Cellar/postgresql/9.1.3/bin
DOCDIR = /usr/local/Cellar/postgresql/9.1.3/share/doc/postgresql
HTMLDIR = /usr/local/Cellar/postgresql/9.1.3/share/doc/postgresql
INCLUDEDIR = /usr/local/Cellar/postgresql/9.1.3/include
PKGINCLUDEDIR = /usr/local/Cellar/postgresql/9.1.3/include
INCLUDEDIR-SERVER = /usr/local/Cellar/postgresql/9.1.3/include/server
LIBDIR = /usr/local/Cellar/postgresql/9.1.3/lib
PKGLIBDIR = /usr/local/Cellar/postgresql/9.1.3/lib
LOCALEDIR = /usr/local/Cellar/postgresql/9.1.3/share/locale
MANDIR = /usr/local/Cellar/postgresql/9.1.3/share/man
SHAREDIR = /usr/local/Cellar/postgresql/9.1.3/share/postgresql
SYSCONFDIR = /usr/local/Cellar/postgresql/9.1.3/etc
PGXS = /usr/local/Cellar/postgresql/9.1.3/lib/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--disable-debug' '--prefix=/usr/local/Cellar/postgresql/9.1.3' '--datadir=/usr/local/Cellar/postgresql/9.1.3/share/postgresql' '--docdir=/usr/local/Cellar/postgresql/9.1.3/share/doc/postgresql' '--enable-thread-safety' '--with-bonjour' '--with-gssapi' '--with-krb5' '--with-openssl' '--with-libxml' '--with-libxslt' '--with-ossp-uuid' '--with-python' '--with-perl' 'ARCHFLAGS='''-arch x86_64'''' 'CC=/usr/bin/llvm-gcc' 'CFLAGS=-Os -w -pipe -march=core2 -msse4 -I/usr/local/Cellar/ossp-uuid/1.6.2/include' 'LDFLAGS=-L/usr/local/Cellar/readline/6.2.2/lib -L/usr/local/Cellar/ossp-uuid/1.6.2/lib' 'LIBS=-luuid' 'CPPFLAGS=-I/usr/local/Cellar/readline/6.2.2/include -I/usr/include/libxml2'
CC = /usr/bin/llvm-gcc
CPPFLAGS = -I/usr/local/Cellar/readline/6.2.2/include -I/usr/include/libxml2 -I/usr/local/include/libxml2
CFLAGS = -Os -w -pipe -march=core2 -msse4 -I/usr/local/Cellar/ossp-uuid/1.6.2/include -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapv
CFLAGS_SL =
LDFLAGS = -L/usr/local/Cellar/readline/6.2.2/lib -L/usr/local/Cellar/ossp-uuid/1.6.2/lib -L/usr/local/lib -Wl,-dead_strip_dylibs
LDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgport -lxslt -lxml2 -lssl -lcrypto -lgssapi_krb5 -lz -lreadline -lm -luuid
VERSION = PostgreSQL 9.1.3
larson:~ larson$ /usr/local/Cellar/postgresql/9.1.3/bin/pg_ctl -D /user/local/var/postgres status
pg_ctl: no server running
Even though the result above is "no server running", I am do have a postgres server running.
larson:~ larson$ ps -a | grep postgres
17476 ttys001 0:00.12 postgres -D /usr/local/var/postgres
17543 ttys002 0:00.00 grep postgres
On a final note when I try to run psql I get the following result:
larson:~ larson$ psql
psql: FATAL: database "larson" does not exist
Thanks,
Andrew
On Apr 27, 2012, at 09:51 PM, raghu ram <raghuchennuru@gmail.com> wrote:
On Sat, Apr 28, 2012 at 12:52 AM, Andrew Barinov <andy.lauerbarinov@me.com> wrote:Could you please share below information for troubleshooting this issue:Hi Everyone,I am trying to get pg working on os x lion and getting some configuration errors. Wondering if anyone on this list faced these before.I installed pg via homebrew and I get this error when trying to launch it via a local web server on my machine:could not connect to server: No such file or directory
Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
So I go ahead and try to run postgres directly. When I do I get this:larson:~ larson$ /usr/local/Cellar/postgresql/9.1.3/bin/postgres ; exit; postgres does not know where to find the server configuration file. You must specify the --config-file or -D invocation option or set the PGDATA environment variable. logout
So my thinking here is that the config files are missing. I searched for pg_hba.conf file and couldn't find it. Now I am unsure how to proceed, when I used pg on os x Snow Leopard I could go into a ~/Library/Developer/postgresql folder and all my config files would be there. There would also be logs I could read to get a better idea of what's going. Now those seem to be missing, does anyone know where I can find them?Thanks in advance for your help,Andrew
/usr/local/Cellar/postgresql/9.1.3/bin/pg_config/usr/local/Cellar/postgresql/9.1.3/bin/pg_ctl -D <data Directory Path> status
Hi,
I'd just like to say that I resolved my issue.
Thanks!
Andrew
On Apr 28, 2012, at 12:58 PM, Andrew Barinov <andy.lauerbarinov@me.com> wrote:
Hi,Sure, here are the results from the two commands:larson:~ larson$ /usr/local/Cellar/postgresql/9.1.3/bin/pg_configBINDIR = /usr/local/Cellar/postgresql/9.1.3/binDOCDIR = /usr/local/Cellar/postgresql/9.1.3/share/doc/postgresqlHTMLDIR = /usr/local/Cellar/postgresql/9.1.3/share/doc/postgresqlINCLUDEDIR = /usr/local/Cellar/postgresql/9.1.3/includePKGINCLUDEDIR = /usr/local/Cellar/postgresql/9.1.3/includeINCLUDEDIR-SERVER = /usr/local/Cellar/postgresql/9.1.3/include/serverLIBDIR = /usr/local/Cellar/postgresql/9.1.3/libPKGLIBDIR = /usr/local/Cellar/postgresql/9.1.3/libLOCALEDIR = /usr/local/Cellar/postgresql/9.1.3/share/localeMANDIR = /usr/local/Cellar/postgresql/9.1.3/share/manSHAREDIR = /usr/local/Cellar/postgresql/9.1.3/share/postgresqlSYSCONFDIR = /usr/local/Cellar/postgresql/9.1.3/etcPGXS = /usr/local/Cellar/postgresql/9.1.3/lib/pgxs/src/makefiles/pgxs.mkCONFIGURE = '--disable-debug' '--prefix=/usr/local/Cellar/postgresql/9.1.3' '--datadir=/usr/local/Cellar/postgresql/9.1.3/share/postgresql' '--docdir=/usr/local/Cellar/postgresql/9.1.3/share/doc/postgresql' '--enable-thread-safety' '--with-bonjour' '--with-gssapi' '--with-krb5' '--with-openssl' '--with-libxml' '--with-libxslt' '--with-ossp-uuid' '--with-python' '--with-perl' 'ARCHFLAGS='''-arch x86_64'''' 'CC=/usr/bin/llvm-gcc' 'CFLAGS=-Os -w -pipe -march=core2 -msse4 -I/usr/local/Cellar/ossp-uuid/1.6.2/include' 'LDFLAGS=-L/usr/local/Cellar/readline/6.2.2/lib -L/usr/local/Cellar/ossp-uuid/1.6.2/lib' 'LIBS=-luuid' 'CPPFLAGS=-I/usr/local/Cellar/readline/6.2.2/include -I/usr/include/libxml2'CC = /usr/bin/llvm-gccCPPFLAGS = -I/usr/local/Cellar/readline/6.2.2/include -I/usr/include/libxml2 -I/usr/local/include/libxml2CFLAGS = -Os -w -pipe -march=core2 -msse4 -I/usr/local/Cellar/ossp-uuid/1.6.2/include -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapvCFLAGS_SL =LDFLAGS = -L/usr/local/Cellar/readline/6.2.2/lib -L/usr/local/Cellar/ossp-uuid/1.6.2/lib -L/usr/local/lib -Wl,-dead_strip_dylibsLDFLAGS_EX =LDFLAGS_SL =LIBS = -lpgport -lxslt -lxml2 -lssl -lcrypto -lgssapi_krb5 -lz -lreadline -lm -luuidVERSION = PostgreSQL 9.1.3larson:~ larson$ /usr/local/Cellar/postgresql/9.1.3/bin/pg_ctl -D /user/local/var/postgres statuspg_ctl: no server runningEven though the result above is "no server running", I am do have a postgres server running.larson:~ larson$ ps -a | grep postgres17476 ttys001 0:00.12 postgres -D /usr/local/var/postgres17543 ttys002 0:00.00 grep postgresOn a final note when I try to run psql I get the following result:larson:~ larson$ psqlpsql: FATAL: database "larson" does not existThanks,AndrewOn Apr 27, 2012, at 09:51 PM, raghu ram <raghuchennuru@gmail.com> wrote:On Sat, Apr 28, 2012 at 12:52 AM, Andrew Barinov <andy.lauerbarinov@me.com> wrote:Could you please share below information for troubleshooting this issue:Hi Everyone,I am trying to get pg working on os x lion and getting some configuration errors. Wondering if anyone on this list faced these before.I installed pg via homebrew and I get this error when trying to launch it via a local web server on my machine:could not connect to server: No such file or directory
Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
So I go ahead and try to run postgres directly. When I do I get this:larson:~ larson$ /usr/local/Cellar/postgresql/9.1.3/bin/postgres ; exit; postgres does not know where to find the server configuration file. You must specify the --config-file or -D invocation option or set the PGDATA environment variable. logout
So my thinking here is that the config files are missing. I searched for pg_hba.conf file and couldn't find it. Now I am unsure how to proceed, when I used pg on os x Snow Leopard I could go into a ~/Library/Developer/postgresql folder and all my config files would be there. There would also be logs I could read to get a better idea of what's going. Now those seem to be missing, does anyone know where I can find them?Thanks in advance for your help,Andrew
/usr/local/Cellar/postgresql/9.1.3/bin/pg_config/usr/local/Cellar/postgresql/9.1.3/bin/pg_ctl -D <data Directory Path> status