Postgresql: LOG: autovacuum launcher started is hung (apparently)

Zeynel picture Zeynel · Oct 5, 2013 · Viewed 7.8k times · Source

I am working on this Heroku tutorial and I have a question about autovacuum process. There is still no tables or data and autovacuum launcher is hung for over half an hour now. Below is the cmd window.

I found a similar question here but could not find the answer. Does anyone know what is going on?

As a summary: After the last line LOG: autovacuum launcher started the cursor is blinking under the last line but nothing is happenning for over half an hour.

C:\Users\a>initdb pg
The files belonging to this database system will be owned by user "a".
This user must also own the server process.

The database cluster will be initialized with locale "English_United States.1252
".
The default database encoding has accordingly been set to "WIN1252".
The default text search configuration will be set to "english".

Data page checksums are disabled.

initdb: directory "pg" exists but is not empty
If you want to create a new database system, either remove or empty
the directory "pg" or run initdb
with an argument other than "pg".

C:\Users\a>postgres -D pg &
LOG:  database system was interrupted; last known up at 2013-10-05 13:46:39 EDT
LOG:  database system was not properly shut down; automatic recovery in progress

LOG:  record with zero length at 0/17704F8
LOG:  redo is not required
LOG:  database system is ready to accept connections
LOG:  autovacuum launcher started

EDIT

As suggested in bma's comments, I removed the pg directory and the project directory and I did the same steps again and I got the same result: LOG: autovacuum launcher started and it hangs. What am I going wrong?


EDIT

I opened a new command window and started the repl there and I was able to execute

C:\Users\a\CLOJURE\shouter>lein repl

user=> (require '[clojure.java.jdbc :as sql])
nil

But the next command gave the following error:

user=> (sql/with-connection (System/getenv "DATABASE_URL")
  #_=>          (sql/create-table :testing [:data :text]))


user=> IllegalArgumentException db-spec null is missing a required parameter  cl
ojure.java.jdbc/get-connection (jdbc.clj:192)

How can I fix this?


EDIT

It turned out that 'export' is for unix and in Windows I needed to use 'set'. See this related question.

Answer

Chris Travers picture Chris Travers · Nov 24, 2013

What is happening is that you are starting postgres directly, with the pg directory, and seeing log output. It would be better to install it as a service on Windows, and use the default data directory. This is what the normal installer does.

However your current approach is going to just run the db until you close the terminal window at which point it will die (hence the recovery at the beginning). You don't have hung processes. That's just log output.