[GRASS-user] db.out.ogr: Syntax Correction [UPDATED]

Rich Shepard rshepard at appl-ecosys.com
Tue Mar 15 11:07:16 EDT 2011


On Mon, 14 Mar 2011, Micha Silver wrote:

> # Copy to postgres
> GRASS 6.4.0RC6 (ITM):~ > db.copy from_dri=dbf to_dri=pg to_data="host=localhost,dbname=geodata"
> from_tab=idan_catchments to_tab=idan_catchments

   Here's more insight with DEBUG=5:

GRASS 6.5.svn (Nevada-aea):~/grassdata > db.copy from_dri=dbf to_dri=pg
to_data="host=localhost,dbname=nevada" from_tab=huc8 to_tab=huc8
D2/5: dbDbmscap(): opendir [/usr/local/grass-6.5.svn/driver/db/]
D2/5: dbDbmscap(): opendir [/usr/local/grass-6.5.svn/driver/db/]
D3/5: db_copy_table():
   from driver = dbf, db = host=localhost,dbname=nevada, table = huc8
   to driver = pg, db = host=localhost,dbname=nevada, table = huc8, where =
(null), select = (null)
D2/5: dbDbmscap(): opendir [/usr/local/grass-6.5.svn/driver/db/]
D2/5: DBF: db__driver_open_database() name = 'host=localhost,dbname=nevada'
D2/5: db.name = host=localhost,dbname=nevada
D2/5: dbDbmscap(): opendir [/usr/local/grass-6.5.svn/driver/db/]
D3/5: db_driver_open_database() driver=pg database definition =
'host=localhost,dbname=nevada'
D3/5: parse_conn : host=localhost,dbname=nevada
D3/5: token 0 : host=localhost
D3/5: token 1 : dbname=nevada
D3/5: host = localhost, port = (null), options = (null), tty = (null),
dbname = nevada, user = (null), password = (null), schema = (null)
D3/5: db_get_login(): drv=[pg] db=[host=localhost,dbname=nevada]
D3/5: DB login file = </home/rshepard/.grasslogin64>
D3/5: login file does not exist
D3/5: pgtype = 16,      name = bool ->  type = 17
D3/5: pgtype = 18,      name = char ->  type = 10
D3/5: pgtype = 20,      name = int8 ->  type = 4
D3/5: pgtype = 21,      name = int2 ->  type = 2
D3/5: pgtype = 23,      name = int4 ->  type = 3
D3/5: pgtype = 25,      name = text ->  type = 13
D3/5: pgtype = 26,      name = oid ->   type = 6
D3/5: pgtype = 700,     name = float4 ->        type = 7
D3/5: pgtype = 701,     name = float8 ->        type = 8
D3/5: pgtype = 1042,    name = bpchar ->        type = 11
D3/5: pgtype = 1043,    name = varchar ->       type = 12
D3/5: pgtype = 1082,    name = date ->  type = 14
D3/5: pgtype = 1083,    name = time ->  type = 15
D3/5: pgtype = 1114,    name = timestamp ->     type = 16
D3/5: pgtype = 1560,    name = bit ->   type = 1
D3/5: pgtype = 1700,    name = numeric ->       type = 9
D2/5: pg : BEGIN
D3/5: select * from huc8 where 0 = 1
D3/5: SQL statement parsed successfully: select * from huc8 where 0 = 1
D2/5: find_table(): table = huc8
DBMI-DBF driver error:
Table 'huc8' doesn't exist.
Error in db_open_select_cursor()

WARNING: Unable to open select cursor: 'select * from huc8 where 0 = 1'
D2/5: db_close_database() result: 0  (0 means success)
D2/5: db_shutdown_driver() failed
D2/5: db_close_database() result: 0  (0 means success)
D2/5: db_shutdown_driver() failed
WARNING: Copy table failed

   Why is grass65 looking for a login file named grasslogin64? When is this
file created and/or updated? If that's the reason db.copy is not working,
how do I create that hidden file and move on?

Rich


More information about the grass-user mailing list