lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi all,

I managed to get luasql installed on my Ubuntu box (the box at the meeting was 
gentoo). Using psql (the CLI tool that comes with Postgres), I created 
database testlua, user slitt. Within testlua I created table testt with 
columns fname and lname, both type text.

Then I ran the following program:
=================================
#!/usr/bin/lua

-- load driver
require "luasql.postgres"
-- create environment object
envv = assert (luasql.postgres())
-- connect to data source
con = assert (envv:connect("testlua", "slitt", nil))
=================================

Which produced the following output:

=================================
slitt@mydesk:~$ ./junk.lua
/usr/bin/lua: ./junk.lua:8: LuaSQL: Error connecting to database.
stack traceback:
        [C]: in function 'assert'
        ./junk.lua:8: in main chunk
        [C]: ?
slitt@mydesk:~$
=================================

So it looks to me like it accepted the require statement, and 
luasql.postgres() didn't return nil, but the envv:connect() failed. I ran this 
program as user slitt, same as the owner of database testlua. I tried all 
sorts of combinations as arguments to the connect(), but they all produced the 
identical symptom.

Does anyone know a diagnostic test I can do to narrow down this problem? Does 
anyone know of documentation of the connect() function better than the docs at 

Thanks

SteveT

Steve Litt
Recession Relief Package
http://www.recession-relief.US
Twitter: http://www.twitter.com/stevelitt