1

Hello I have a database that has 12 tables. I can select everything from 11 of them but using the same query for the 12th doesn't work. But if i try that query from phpPgAdmin then it works. For example I have this query:

SELECT 
  "public"."products"."grupi",
  "public"."products"."kodartikulli",
  "public"."products"."kodifikimartikulli2",
  "public"."products"."pershkrimartikulli",
  "public"."cmime"."cmimi" 
FROM "public"."products" 
INNER JOIN "public"."cmime" ON ("public"."products"."kodartikulli"="public"."cmime"."idprodukti") 
WHERE "public"."products"."kodartikulli" = 'AS00008'

This works perfectly on phpPgAdmin but when i try it from my app it says:

error: relation "public.cmime" does not exist

Also all the tables have the same privileges. Has anyone encountered this problem? Thank You

tftd
  • 16,203
  • 11
  • 62
  • 106
Alfred
  • 59
  • 11
  • Could you try just `SELECT * FROM public.cmime LIMIT 1` and see what you get? You could also try `SELECT * FROM cmime LIMIT 1` and see if there's any difference. – joanolo Jan 28 '17 at 12:57
  • The same error again. error: relation "cmime" does not exist – Alfred Jan 28 '17 at 15:29
  • Do you have any easy way to check that phpPGAdmin is actually connecting to the same database and the same user role and credentials? – joanolo Jan 28 '17 at 16:30

1 Answers1

0

It seems you use different users to connect db. You can use query below to get list of all tables and owner info:

SELECT *
FROM pg_tables t
WHERE t.tableowner = current_user;
Valery Viktorovsky
  • 6,487
  • 3
  • 39
  • 47