Thank you for your reply.  I think the reason may be because somehow I
had 2 different versions of PostgreSQL (7 & 8)   (doing pg_config
--version showed 8.1 but PG_VERSION file says I have 7.4).  So I
uninstalled and reinstalled everything and now it works just fine.
Thanks again!

> > When running the executable as any user other than postgres, I got an
> > exception:
>
> > Runtime error: FATAL:  user "test" does not exist
>
> This is definitely a generic problem in how the database is set up--AFAICS
> it's not specific to libpqxx, so the easiest way to debug the problem may
> be to run the command-line SQL client "psql" instead of your own program.
>
> My first guess would be that somehow you're performing different parts of
> your test under different postgres user identities or in different
> databases.
>
>
> > I already created an user 'test' and granted all priviledge.  By doing
> > "select * from pg_users;" from pgsql command line, I could see 2 users
> > in the table, 'test' and 'postgres'. Why did I still get the exception
> > "user does not exist"?
>
> How exactly did you create the user and grant all privileges?  Did you use
> the command-line program "createuser," or did you run "CREATE USER" in
> SQL, or what?
>
>
> > Now, if I logged in as postgres, then connection is established, but I
> > can't execute the "select * from test_tbl;"; it complains about not
> > seeing table test_tbl even though I already created one via command
> > line.
>
> Can you see that table (and in that same database) when using psql?
>
>
> > If in the test program itself, I call w.exec("CREATE TABLE
> > test_tbl....") and insert some data in, then the select call returns
> > the correct result.  But via command line, I can't see newly created
> > test_tbl at all.  Could anybody help me with this?
>
> Again, how exactly did you create that table?  Are you sure you did so in
> the same database?
>
>
> >         conn.activate();
>
> Side note: this is really not needed.  If your connection is ever
> deactivated, it will re-activate automatically when you resume using it.
> Also, no need in libpqxx to have trailing semicolons (";") at the end of
> your SQL statements.  They should work, but they're really not supposed to
> be there.
>
>
> Jeroen
>
>
>
_______________________________________________
Libpqxx-general mailing list
[email protected]
http://gborg.postgresql.org/mailman/listinfo/libpqxx-general

Reply via email to