2

When I researched this I found that the tutorial here is missing crucial information and there are several questions here and complaints online about something about this tutorial. I am wondering if someone here successfully connected to Heroku local Postgresql in Windows and can help me. Presently I am stuck with this command

c:\>export DATABASE_URL=postgresql://localhost:5432/shouter
'export' is not recognized as an internal or external command,
operable program or batch file.

Is there a solution to this?

Zeynel
  • 13,145
  • 31
  • 100
  • 145
  • 2
    The `export` command from *nix is `SET` in Windows, so you should try `SET DATABASE_URL=postgresql://localhost:5432/shouter`. Maybe this help a bit, though probably the solution won't be as simple as that :P. – juan.facorro Oct 06 '13 at 12:33
  • @juan.facorro: Thanks so much! This worked. Can you please create an answer so that I can accept it? And also, is there a documentation for Windows commands that I can refer to for similar problems? – Zeynel Oct 06 '13 at 16:42

2 Answers2

4

The export command from *nix is SET in Windows, so you should try:

SET DATABASE_URL=postgresql://localhost:5432/shouter

Here's a Windows commands reference page An A-Z Index of the Windows CMD command line.

juan.facorro
  • 9,791
  • 2
  • 33
  • 41
  • Thanks, I also found unix to windows equivalent commands but strangely `export` is not included: http://www.lemoda.net/windows/windows2unix/windows2unix.html. But happy that this worked. – Zeynel Oct 07 '13 at 23:13
0

You should add postgresql to your environment variables in windows. See this tutorial: http://www.computerhope.com/issues/ch000549.htm

The Heroku article does mention this in passing, but you should add something like "c:\postgresql\bin" to the environment variable. Restart the command line, and see if the command works. (don't copy/paste my path, as you have to find your own path to /bin)

Although not strictly required, you ought to check out PgAdmin, as it is very helpful to visualize and manage your database, including where you are exporting your database.

dizzystar
  • 1,055
  • 12
  • 22
  • Thanks. But postresql bin was already included in PATH: `C:\Program Files\PostgreSQL\9.3\bin`. It's added to both user and system PATH. I restarted command line and tried again and I got the same error. – Zeynel Oct 06 '13 at 09:37
  • 1
    Although someone else has the answer, I'd still suggest using PgAdmin, especially if you are developing on Windows. Command-line PostgreSQL and Clojure development on Windows is incredibly painful, plus, all the tutorials on the languages assume you are running on Linux or perhaps Cgwin. Imagine how many more commands change. As someone who went through the Windows dev thing, I'd strongly suggest using Linux on a VM for your Clojure development. – dizzystar Oct 06 '13 at 21:55
  • Ok, I just looked at PgAdmin looks very nice. At this point I am just starting, eventually I want to move to Apple for better programming experience, I think working with Apple is same as using Linux, correct? – Zeynel Oct 06 '13 at 22:26
  • I wouldn't know, since I don't use Apple. With all due respect, Clojure is a terrible language to begin your programming career with. – dizzystar Oct 07 '13 at 00:38
  • I am curious to know why you say that. Before clojure I played with Python and GAE but Clojure seems interesting in its philosophy. – Zeynel Oct 07 '13 at 01:15
  • pgAdmin doesn't look very nice for me. It's just a blank white square :( – Ian Grainger Oct 27 '16 at 19:05