[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
[mv] MV 4: Some notes on successfully setting up some SQL tables in MV 4.
****** message to minivend-users from Mark Stosberg <mark@summersault.com> ******
I just set up an empty SQL table with MV 4beta1. I had a few stumbling
blocks in the process, one potentially serious bug, so I'll post them
there so that they might help one of you, or that some of ideas might
make it to the official documention or code. :) First I'll paste in the
catalog.cfg definitions so that they are easier to talk about
<snip>
Database sheet_music sheet_music.tab dbi:Pg:dbname=music;host=my.host.com;port=5432
Database sheet_music LongReadLen 128
Database sheet_music USER music
Database sheet_music NUMERIC id,seller_id,price
Database sheet_music COLUMN_DEF id=serial
Database sheet_music COLUMN_DEF seller_id=int4
Database sheet_music COLUMN_DEF composer=varchar(64)
Database sheet_music COLUMN_DEF title=varchar(64)
Database sheet_music COLUMN_DEF ensemble=varchar(32)
Database sheet_music COLUMN_DEF publisher=varchar(64)
Database sheet_music COLUMN_DEF description=text
Database sheet_music COLUMN_DEF price=float
Database sheet_music COLUMN_DEF condition=char(4)
</snip>
I discovered that the 'LongReadLen' and USER declarations must come
_after_ the DSN connection line. Perhaps the docs or the error logs
could offer further hints about this. Here's what I saw in my error log
(which did help me debug it):
<log>
199.120.185.113 3qB3qUJa:199.120.185.113 - [17/February/2000:23:38:54
-0500] market-dev /market-dev.cgi/config/dbedit.html Runtime error:
Couldn't open '/home/music/catalogs/market-dev/products/USER'
read/write: No such file or directory>
199.120.185.113 3qB3qUJa:199.120.185.113 - [17/February/2000:23:41:07
-0500] market-dev /market-dev.cgi/config/dbedit.html Runtime error:
Couldn't open '/home/music/catalogs/market-dev/products/LongReadLen'
read/write: No such file or directory
</log>
Once I had those in the right place and restarted the server, Minived
paused at this catalog configuration and then eventually ran out of
memory. The problem was that I had not created a the 'sheet_music.tab'
file I had mentioned. Actually, I left this token out all together in
the beginning since I didn't actually want to import anything from a
text database. Then, I tried mentioning the file without it actually
existing. Minivend most of have gone into a loop trying to open it, thus
the memory crash. IMHO, Minivend should give up after 5 seconds or so
and report 'file not found'.
Once I guessed what was wrong, I created the file with just first line:
<file>
id seller_id composer title ensemble publisher description price condition
</file>
that satisfied minivend and my SQL table was created! (upon the next
server restart...)
-mark
<<-------------------------------------------------------------->>
personal website < Summersault Website Design
http://mark.stosberg.com/ > http://www.summersault.com/
-
To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list