[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua and Postgres
- From: Steve Litt <slitt@...>
- Date: Sun, 16 Jan 2011 02:17:02 -0500
On Saturday 15 January 2011 16:40:34 Matthew Wild wrote:
> On 15 January 2011 21:32, Steve Litt <slitt@troubleshooters.com> wrote:
> > Anyway, database testlua was one I had just created within psql and I
> > didn't give it a password. So I'm confused why LuaSQL.postgres's
> > connect() command fails. I spent a couple hours putting in various
> > combinations of stuff as its arguments, did a bunch of googling, and
> > absolutely nothing changed the symptom. I'm beginning to think there's a
> > basic fact that I'm missing.
>
> When you say you didn't give it a password, what do you mean? When I
> have issues with Postgres it's usually permissions. In particular
> databases don't have passwords, user accounts have passwords.
>
> Try setting up a user account with a password in postgres, and then
> connect with envv:connect("testlua", "username", "password",
> "localhost"). Check that you can connect to and query the DB with:
> psql --user username --host localhost
Hi Matthew,
While your exact suggestion failed just like everything else I tried, the
spirit of your suggestion got me off dead center and I eventually got
something to connect.
T H A N K Y O U ! ! !
Your suggestion reminded me that in the past I'd had trouble getting psql and
pgadminIII to agree with each other or work with data each other put in. Until
now I'd simply concluded that pgadminIII was buggy -- after all, some parts of
its interface don't exactly conform to the principle of least surprise. So
after you reminded me of that fact, I went into pgadminIII and by hook or by
crook got something to connect there. I then put that exact database, user,
password, host (127.0.0.1) and port (surprisingly 5433) into envv:connect(),
and bang, it worked! Now that I have one that works and some that don't, I can
exploit the differences and figure out exactly how everything works.
I'm still having lots of trouble, but it's now pretty clear it's a lack of
Postgres knowledge, not having anything to do with Lua or LuaSQL. And luckily,
I'm a member of the Orlando Postgres Group, so I'll get plenty of good advice.
When I get it all figured out I'll document it so the next newbie won't have
these troubles. Right now there's very little on the net in the way of
troubleshooting problems in a Lua/Postgres system.
And Matthew, thanks so much for your suggestion.
SteveT
Steve Litt
Recession Relief Package
http://www.recession-relief.US
Twitter: http://www.twitter.com/stevelitt