"load" command in tiger_import

13 views
Skip to first unread message

John L. Poole

unread,
Mar 24, 2010, 1:01:20 PM3/24/10
to GeoCommons Geocoder
The bin/tiger_import shell script has this line:

# Generate an SQL stream to feed into the sqlite3 binary.
# Start by loading the helper libs and initializing the temporary
tables
# that will hold the TIGER data before ETL.
(echo ".load $HELPER_LIB" && \

When I run it on my Gentoo system, I get:

Error: unknown command or invalid arguments: "load". Enter ".help"
for help
memory

"man load" does not return anything on my system; moreover, in the
Unix in a Nutshell book, there is not listed in the basic commands or
the index "load".

I've concurrently posted on the Gentoo Forum (http://forums.gentoo.org/
viewtopic-t-820663.html) my question, but it seems as though "load" is
not a common command and merits documentation.

Any suggestions on what command I should use, or is there a library I
need to add to my environment, to get the tiger_import script to not
fail on the above line?

John L. Poole

unread,
Mar 24, 2010, 3:05:40 PM3/24/10
to GeoCommons Geocoder
It was pointed out to me that ".load" is a sqlite command, not a shell
command. Thus, i've determined that the error message occurs because
my sqlite does not support ".load"; I'll have to go back and read the
installation instructions, I must have missed a point or there is a
version issue at play here.

hermes geocoder # sqlite3
SQLite version 3.6.22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .help
.backup ?DB? FILE Backup DB (default "main") to FILE
.bail ON|OFF Stop after hitting an error. Default OFF
.databases List names and files of attached databases
.dump ?TABLE? ... Dump the database in an SQL text format
If TABLE specified, only dump tables matching
LIKE pattern TABLE.
.echo ON|OFF Turn command echo on or off
.exit Exit this program
.explain ?ON|OFF? Turn output mode suitable for EXPLAIN on or
off.
With no args, it turns EXPLAIN on.
.genfkey ?OPTIONS? Options are:
--no-drop: Do not drop old fkey triggers.
--ignore-errors: Ignore tables with fkey
errors
--exec: Execute generated SQL immediately
See file tool/genfkey.README in the source
distribution for further information.
.header(s) ON|OFF Turn display of headers on or off
.help Show this message
.import FILE TABLE Import data from FILE into TABLE
.indices ?TABLE? Show names of all indices
If TABLE specified, only show indices for
tables
matching LIKE pattern TABLE.
.mode MODE ?TABLE? Set output mode where MODE is one of:
csv Comma-separated values
column Left-aligned columns. (See .width)
html HTML <table> code
insert SQL insert statements for TABLE
line One value per line
list Values delimited by .separator
string
tabs Tab-separated values
tcl TCL list elements
.nullvalue STRING Print STRING in place of NULL values
.output FILENAME Send output to FILENAME
.output stdout Send output to the screen
.prompt MAIN CONTINUE Replace the standard prompts
.quit Exit this program
.read FILENAME Execute SQL in FILENAME
.restore ?DB? FILE Restore content of DB (default "main") from
FILE
.schema ?TABLE? Show the CREATE statements
If TABLE specified, only show tables matching
LIKE pattern TABLE.
.separator STRING Change separator used by output mode
and .import
.show Show the current values for various settings
.tables ?TABLE? List names of tables
If TABLE specified, only list tables matching
LIKE pattern TABLE.
.timeout MS Try opening locked tables for MS milliseconds
.width NUM1 NUM2 ... Set column widths for "column" mode
.timer ON|OFF Turn the CPU timer measurement on or off
sqlite> .quit
hermes geocoder #

Kate Chapman

unread,
Mar 24, 2010, 3:15:58 PM3/24/10
to geocommon...@googlegroups.com
I suspect you do not have SQLite compiled enabling dynamic loading of
extensions.

Which version of SQLite are you running?

-Kate

> To unsubscribe from this group, send email to geocommons-geocode+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
>

John L. Poole

unread,
Mar 24, 2010, 3:37:12 PM3/24/10
to GeoCommons Geocoder
Yup, I did not heed the note:

NOTE: If you do not have /usr/include/sqlite3ext.h installed, then
your sqlite3 binaries are probably not configured to support dynamic
extension loading. If not, you must compile and install SQLite from
source, or rebuild your system packages. This is not believed to be a
problem on Debian/Ubuntu, but is known to be a problem with Red Hat/
CentOS.

I use Gentoo and had accepted the default when installing dev-db/
sqlite. I've re-installed dev-db/sqlite turning on the "extensions"
keyword (adding "dev-db/sqlite extensions" to my /etc/portage/
package.use file) and the error message "unknown command or invalid
options" disappeared.

Aside: now there's another error: Error: bin/../lib/geocoder/us/
sqlite3.so: undefined symbol: ceil
memory
and I'll revisit my installation to double check that I did not
overlook something else and then if I do not solve this issue, create
a new thread.

Reply all
Reply to author
Forward
0 new messages