Set up a node.js app with postgreSQL db, all works in production environment.
I have used the CLI heroku pg:pull ...
which was successful. Am running postgres 9.4.X locally, but on starting my application locally (foreman start) I am getting an error: "Error error: relation "test_table" does not exist". I have followed instructions here: https://devcenter.heroku.com/articles/heroku-postgresql#local-setup but still I cannot seem to access my DB when running locally.
bash_profile:
export PATH="/usr/local/heroku/bin:$PATH"
export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.4/bin
export PATH="/Applications/Postgres93.app/Contents/MacOS/bin:$PATH:$PATH"
Console error log:
15:39:48 web.1 | started with pid 18779
15:39:48 web.1 | Node app is running on port 5000
15:39:52 web.1 | { [error: relation "test_table" does not exist]
15:39:52 web.1 | name: 'error',
15:39:52 web.1 | length: 101,
15:39:52 web.1 | severity: 'ERROR',
15:39:52 web.1 | code: '42P01',
15:39:52 web.1 | detail: undefined,
15:39:52 web.1 | hint: undefined,
15:39:52 web.1 | position: '15',
15:39:52 web.1 | internalPosition: undefined,
15:39:52 web.1 | internalQuery: undefined,
15:39:52 web.1 | where: undefined,
15:39:52 web.1 | schema: undefined,
15:39:52 web.1 | table: undefined,
15:39:52 web.1 | column: undefined,
15:39:52 web.1 | dataType: undefined,
15:39:52 web.1 | constraint: undefined,
15:39:52 web.1 | file: 'parse_relation.c',
15:39:52 web.1 | line: '986',
15:39:52 web.1 | routine: 'parserOpenTable' }
test_table
? How is the database being seeded/imported/setup with a schema? – jm_____ Jul 31 '15 at 21:49pg.connect(process.env.DATABASE_URL, function(err, client, done){.....
I cant remember the exact pg:pull I used, but what should I use to ensure that this works? Locally psql \conninfo isYou are connected to database "Oliver" as user "Oliver" via socket in "/tmp" at port "5432".
– OliverJ90 Jul 31 '15 at 23:30