[GRASS-user] Postgres import on Windows = "ERROR: Unable to open data source"

When it try to run this in 6.4.3svn (last night’s build) or 6.4.2:
v.in.ogr -t -o dsn=C:\Users\Aren Cambre\Desktop\DEEM documents\TxDOT\grass connection.dsn output=crashes

…all I get this this:
ERROR: Unable to open data source <C:\Users\Aren Cambre\Desktop\DEEM documents\TxDOT\grass connection.dsn>

That error is vague.

The DSN was generated by v.in.ogr.qgis in Quantum GIS, and it does work in QGIS’s bundled GRASS 6.4.2. In the grass connection.dsn file is this:
PG:dbname=‘de’ host=localhost port=5432 user=‘development’ password=‘XXXXXXXX’ sslmode=disable
(of course, XXXXX is replaced with the actual password)

Through running process monitor, I see that GRASS has no problem accessing the DSN file. Also, through pgAdmin III’s Server Status utility, I can verify that GRASS is not attempting to connect to the database.

I’m at a loss on how to further diagnose this.

Aren

On Sat, Dec 29, 2012 at 7:14 PM, Aren Cambre <aren@arencambre.com> wrote:

When it try to run this in 6.4.3svn (last night's build) or 6.4.2:
v.in.ogr -t -o dsn=C:\Users\Aren Cambre\Desktop\DEEM documents\TxDOT\grass
connection.dsn output=crashes

...all I get this this:
ERROR: Unable to open data source <C:\Users\Aren Cambre\Desktop\DEEM
documents\TxDOT\grass connection.dsn>

I see two potential problems:
- white space in the path (could you as experiment try from a location without?)
- maybe the (internal) management of \ escaping is incorrect?

Please try without white space first and tell us if that helps.

thanks
Markus

On Sat, Dec 29, 2012 at 7:14 PM, Aren Cambre <aren@arencambre.com> wrote:

When it try to run this in 6.4.3svn (last night's build) or 6.4.2:
v.in.ogr -t -o dsn=C:\Users\Aren Cambre\Desktop\DEEM documents\TxDOT\grass
connection.dsn output=crashes

...all I get this this:
ERROR: Unable to open data source <C:\Users\Aren Cambre\Desktop\DEEM
documents\TxDOT\grass connection.dsn>

That error is vague.

The DSN was generated by v.in.ogr.qgis in Quantum GIS, and it does work in
QGIS's bundled GRASS 6.4.2. In the grass connection.dsn file is this:
PG:dbname='de' host=localhost port=5432 user='development'
password='XXXXXXXX' sslmode=disable
(of course, XXXXX is replaced with the actual password)

Does

v.in.ogr -t -o dsn="PG:dbname='de' host=localhost port=5432
user='development' password='XXXXXXXX' sslmode=disable" output=crashes

work? I.e. not using the file "grass connection.dsn" but its contents.

Markus M

Through running process monitor, I see that GRASS has no problem accessing
the DSN file. Also, through pgAdmin III's Server Status utility, I can
verify that GRASS is not attempting to connect to the database.

I'm at a loss on how to further diagnose this.

Aren

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

On Sat, Dec 29, 2012 at 3:19 PM, Markus Neteler <neteler@osgeo.org> wrote:

On Sat, Dec 29, 2012 at 7:14 PM, Aren Cambre <aren@arencambre.com> wrote:

When it try to run this in 6.4.3svn (last night’s build) or 6.4.2:
v.in.ogr -t -o dsn=C:\Users\Aren Cambre\Desktop\DEEM documents\TxDOT\grass
connection.dsn output=crashes

…all I get this this:
ERROR: Unable to open data source <C:\Users\Aren Cambre\Desktop\DEEM
documents\TxDOT\grass connection.dsn>

I see two potential problems:

  • white space in the path (could you as experiment try from a location without?)

Made no difference:
ERROR: Unable to open data source <C:\temp\grass.dsn>

Aren

On Sat, Dec 29, 2012 at 3:28 PM, Markus Metz <markus.metz.giswork@gmail.com> wrote:

On Sat, Dec 29, 2012 at 7:14 PM, Aren Cambre <aren@arencambre.com> wrote:

When it try to run this in 6.4.3svn (last night’s build) or 6.4.2:
v.in.ogr -t -o dsn=C:\Users\Aren Cambre\Desktop\DEEM documents\TxDOT\grass
connection.dsn output=crashes

…all I get this this:
ERROR: Unable to open data source <C:\Users\Aren Cambre\Desktop\DEEM
documents\TxDOT\grass connection.dsn>

That error is vague.

The DSN was generated by v.in.ogr.qgis in Quantum GIS, and it does work in
QGIS’s bundled GRASS 6.4.2. In the grass connection.dsn file is this:
PG:dbname=‘de’ host=localhost port=5432 user=‘development’
password=‘XXXXXXXX’ sslmode=disable
(of course, XXXXX is replaced with the actual password)

Does

v.in.ogr -t -o dsn=“PG:dbname=‘de’ host=localhost port=5432
user=‘development’ password=‘XXXXXXXX’ sslmode=disable” output=crashes

work? I.e. not using the file “grass connection.dsn” but its contents.

Here’s the command that I tried to run manually:
v.in.ogr dsn=“PG:dbname=‘de’ host=localhost port=5432 user=‘development’ password=‘XXXXXXXXX’ sslmode=disable” layer=“raw.TxDOT consolidated crashes” output=crashesX snap=-1 min_area=0.0001 -o

I get this dialog:

Inline image 1

In case the dialog doesn’t come through, the error is Unable to parse command, then it repeats my command encapsulated in single quote marks.

Aren