[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: String to use in luasql env:connect()????
- From: Steve Litt <slitt@...>
- Date: Sat, 15 Jan 2011 19:07:49 -0500
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
this:
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', "127.0.0.1",
5432))
or even subbing in the machine's network address 192.168.100.2, 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?
Thanks
Steve
Steve Litt
Recession Relief Package
http://www.recession-relief.US
Twitter: http://www.twitter.com/stevelitt