|
|
Choosing A Webhost: |
Re: Help - user/relation does not exist: msg#00029db.postgresql.lipqxx
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 > > >
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Help - user/relation does not exist, Jeroen T. Vermeulen |
|---|---|
| Next by Date: | New stable release; security warning, Jeroen T. Vermeulen |
| Previous by Thread: | Re: Help - user/relation does not exist, Jeroen T. Vermeulen |
| Next by Thread: | New stable release; security warning, Jeroen T. Vermeulen |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |