"memory" output when running tiger_import script

15 views
Skip to first unread message

John L. Poole

unread,
Mar 28, 2010, 6:19:22 PM3/28/10
to GeoCommons Geocoder
When you run the tiger_import script, the word "memory" and nothing
more appears on its own line right after the command.

I've determined what causes this output. It is the line in the sql
script fed into sqlite:
--
-- Below "journal_mode=MEMORY;" causes the word "memory" to output to
error
--
PRAGMA journal_mode=MEMORY;

I created a simple script representing the initializing command sent
to sqlite by the tiger_import script:

(Note below contains my additional libsdqlitefunctions.so library, see
my previous posts as to why this additional library is necessary on a
Gentoo system):

.load bin/../lib/geocoder/us/libsqlitefunctions.so
.load bin/../lib/geocoder/us/sqlite3.so
-- create temporary tables to hold the TIGER/Line data before it's
-- transformed and loaded into the permanent tables.
--
-- this file was made by running 'shp2pgsql -p' on each of the
-- TIGER/Line shapefiles and then massaging the result by hand.
--
PRAGMA temp_store=MEMORY;
--
-- Below "journal_mode=MEMORY;" causes the word "memory" to output to
error
--
PRAGMA journal_mode=MEMORY;
PRAGMA synchronous=OFF;
PRAGMA cache_size=500000;
PRAGMA count_changes=0;

If the "PRAGMA journal_mode=MEMORY;" is removed or its value changed
to "DEFAULT" then the mysterious "memory" output does not appear.
What further confuses me is that if the pragma is activated and I try
to redirect STDOUT and STDERR to a log file, the value "memory" still
appears in the console and is not written out to STDOUT or STDERR:

hermes geocoder # &>error.log && cat /tmp/
debug_tiger_import_subset2.sql |sqlite3 debug.db
memory
hermes geocoder # cat error.log
hermes geocoder #

Hopefully this post will explain to someon wondering why there is an
output line "memory" when running their tiger_import script.

Reply all
Reply to author
Forward
0 new messages