Windows support

Issue #4 new
Former user created an issue

Is there a way of using this with Windows? I tried installing the required modules, but it still doesn't want to play nice. I got up to step 3, and I'm getting something along the lines of

Traceback (most recent call last):
  File "C:\Users\Mauve\Downloads\mbslave\mbslave-psql.py", line 30, in <module>
    os.execvp("psql", args)
  File "C:\Python27\lib\os.py", line 344, in execvp
    _execvpe(file, args)
  File "C:\Python27\lib\os.py", line 380, in _execvpe
    func(fullname, *argrest)
OSError: [Errno 22] Invalid argument

Comments (9)

  1. Lukáš Lalinský repo owner

    I'm sorry, but I have never used mbslave from Windows and I don't know for sure what the problem is. You probably need psql in %PATH%, but that might not be it.

    Technically you don't need this script though. It's just a wrapper to let you re-use login credentials from the config file. You can still run the SQL scripts manually using any PostgreSQL client. The only script you really need to work is mbslave-import.py.

    Anyway, if you figure out what is the problem, it would be great to get a pull request with the change.

  2. RangerMauve

    Yeah, sorry after looking into the error I was getting, I realized my path wasn't set up properly. After figuring that out, I had trouble with it requiring a password, and after I set a password and updated the config I've got some minor thing again. I'll try executing the SQL parts manually and tell you if the rest works as expected. Also, may I ask what version of python this would be aiming for? I have 2.7 at the moment.

  3. RangerMauve

    Oh goodie, I think the only real problem with the guide is that windows' cmd has slightly different syntax than sh. So far my fix has been to replace all the apostrophes with quotation marks, and get rid of the ./'s. Might also need to see if the pipes differ.

  4. RangerMauve

    I'll add a "for windows users" blurb to the end of the readme after I figure this out, if that's OK.

  5. Lukáš Lalinský repo owner

    Yes, that would be great. It would also update the general guide to be as compatible as possible. For example, I think there is no need to use apostrophes instead of quotes.

  6. RangerMauve

    Hey, when running mbslave-remap-schema.py <sql/statistics/CreateTables.sql | mbslave-psql.py, I get an error saying that "no schema has ben selected to create in". Any idea what I might be doing wrong?

  7. Lukáš Lalinský repo owner

    My guess is that you have something wrong in the configuration regarding the schemas. Have a look at the generated file and check what the "SET search_path" line says. It should point to some schema and I guess in your case it's set to an empty string.

  8. Log in to comment