lua-users home
lua-l archive

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

On Saturday 15 January 2011 17:59:09 Tomas Guisasola Gorham wrote:
>  	Hi Steve
> > 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.
>  	Didn't you provide a password to psql and forgot to do the same
> with the connect() method?  This kind of error occurs when there is no
> access to the database, but the driver is working properly...
>  	Regards,
>  		Tomás

Thanks Tomás,

I'm not sure what you mean by providing a password to psql. To get into psql, 
I have to do:

psql databasename

If the database is owned by slitt, same as my Linux username, then I just go 
straight in. Otherwise, it asks for a password or not, depending. If I do 

psql template1

it goes straight in. But when my last line of my program is this:

con = assert (envv:connect('template1'))

or this:
con = assert (envv:connect('template1', 'postgres'))

all the way down to this:

con = assert (envv:connect('template1', 'postgres', 'mypass', "", 

or even subbing in the machine's network address, it's always 
the same error.

If I could just get ONE thing to connect, I could exploit the differences and 
figure out the variables, but seemingly every single string I put in 
envv.connect() comes back with " LuaSQL: Error connecting to database".

I'll tell you one funny thing though, now that you mention it. Work I do in 
psql and work I do in pgadmin3 seem to not know about each other. Could that 
have something to do with it?


Steve Litt
Recession Relief Package