7

On windows 7, I want to push my local PostgreSQL database(9.4.0) to remote PostgreSQL server on Heroku(9.3.3), I followed the Heroku PostgreSQL Document to push:

>heroku pg:push postgres HEROKU_POSTGRESQL_NAVY_URL --app salty-atoll-4222

Your version of git is 1.9.5.. Which has serious security vulnerabilities.
More information here: https://blog.heroku.com/archives/2014/12/23/update_your_git_clients_on_windows_and_os_x
'env' is not recognized as an internal or external command,
operable program or batch file.
Password:
 !    WARNING: Extensions in newly created target database differ from existing source database.
 !
 !    Target extensions:
 !     extname
 !    ---------
 !     plpgsql
 !    (1 row)
 !
 !
 !    Source extensions:
 !      extname
 !    -----------
 !     adminpack
 !     plpgsql
 !    (2 rows)
 !
 !
 !    HINT: You should review output to ensure that any errors
 !    ignored are acceptable - entire tables may have been missed, where a dependency
 !    could not be resolved. You may need to to install a postgresql-contrib package
 !    and retry.

My local database server URL is localhost:5432. Both the username and database name are postgres, and I've add PGUSER and PGPASSWORD to my system variable, also, my DATABASE_URL system variable is postgres://postgres:password@localhost:5432/postgres.

Also, since it says 'env' is not recognized as an internal or external command, operable program or batch file., I guess set command can be use to replace env, so I also added a alias env.bat in C:\Windows\System32\env.bat:

@ECHO OFF
set

But it still can't recognized env command and my PGPASSWORD variable, asks me to type my password by hand, shows the same warning and my database can't be pushed to this remote server. What's the problem here?

3
  • I don't know what the problem is, but I too am having almost exactly the same problems, and am also on Windows 7. Sure wish someone had an answer ... Commented May 19, 2015 at 1:48
  • I could see that heroku-toolbelt.exe adds to list of system environment variables the variable HerokuPath with value C:\Program Files (x86)\Heroku and appends to system environment variable PATH the folder paths C:\Program Files (x86)\Heroku\bin;C:\Program Files (x86)\git\cmd on installation of Heroku. This modification on system environment variables is not undone on uninstalling Heroku. Are the environment variables HerokuPath and PATH defined on your machine in same way with correct paths? Commented Jul 16, 2015 at 9:07
  • I don't think you need the remote URL, just the name; heroku should resolve that for you. Additionally, can you confirm that the push didn't work? I.e., missing tables/data in the target. It's not clear from the question that the issue is whether the data is missing, or if you are confused by the messages (which indicate a warning, but not an error, by my reading). Commented Jul 17, 2015 at 15:53

1 Answer 1

2
+25

On Windows, the ENV variables need to be configured differently on Heroku, I don't see in your question if you tried this already:

heroku config:set GITHUB_USERNAME=joesmith
Adding config vars and restarting myapp... done, v12
GITHUB_USERNAME: joesmith

$ heroku config
GITHUB_USERNAME: joesmith
OTHER_VAR:    production

$ heroku config:get GITHUB_USERNAME
joesmith

$ heroku config:unset GITHUB_USERNAME
Unsetting GITHUB_USERNAME and restarting myapp... done, v13

More related documentation can be found here.

Sign up to request clarification or add additional context in comments.

1 Comment

@user3684014 did you tried this, and does the error stays the same? Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.