I' trying to run PostgreSQL for RoR on my new mac (i'm a newbie). I followed the installation guide however i can't get it to work properly. I've found similar questions but those didn't help. I get the following error on 'postgres' cmd.
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.
however when I set my -D invocation through
postgres -D /usr/local/var/postgres
I get another error
FATAL: lock file "postmaster.pid" already exists HINT: Is another postmaster (PID 6621) running in data directory "/usr/local/var/postgres"?
I've tried to use 'kill 6621' but then it just seems to startup another postmaster on a different PID. I've also tried removing PID and running
postgres -D /usr/local/var/postgres
I get the following errors:
LOG: could not bind IPv6 socket: Address already in use HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry. LOG: could not bind IPv4 socket: Address already in use HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry. WARNING: could not create listen socket for "localhost" FATAL: could not create any TCP/IP sockets
Does anyone know what i'm doing wrong?
PostgreSQL configuration files are stored in the /etc/postgresql/<version>/main directory. For example, if you install PostgreSQL 12, the configuration files are stored in the /etc/postgresql/12/main directory. To configure IDENT authentication, add entries to the /etc/postgresql/12/main/pg_ident. conf file.
When connecting to Postgres you might see this error: psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket <some socket> . This happens most often when Postgres' server daemon process is not running.
Check Postgres Version from SQL Shell Type the following SQL statement within the prompt to check the current version: SELECT version(); The resulting output provides the full version and system information for the PostgreSQL server.
Usually, when postgres is installed a service/daemon is created in the system so, there is no need to launch the server by hand. You are getting the error because the service is already running.
Try to connect to the database using psql
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With