How to connect or set a specifig schema in LIBGDA database browser?

1

I've here a PostgreSQL based database, with a schema and some tables inside it. When I use psql I must put the schema name in front of every statement:

SELECT * FROM schemahere.tablehere;

Or is set the search path like this:

SET search_path = webmka;

That works both. But within the database-browser of LIBGDA I can't see the schema itself (why?) and I can't fire the SET command. Can I use the connection options?

Peter Weber

Posted 2012-11-22T18:21:49.913

Reputation: 237

Answers

0

If LIBGDA doesn't understand schemas, you can work around this with one of the following:

  • ALTER DATABASE the_database SET search_path = webmka, public;
  • ALTER USER libgda_user SET search_path = webmka, public;

to make the search_path persistently associated with either the database of interest (1st option) or a user dedicated to libgda (2nd option).

Craig Ringer

Posted 2012-11-22T18:21:49.913

Reputation: 2 630

Thank you. It seems libgda UI itself can handle schemas (set the search_path in connection properties), the problem was the following missing statement "GRANT USAGE ON SCHEMA schemahere TO userhere;" + sufficient rights on tables itselt. Hint "fetch metadata" in libgda database browser can maybe help – Peter Weber – 2012-11-23T09:27:00.797

@PeterWeber Thankyou for following up. It sounds like you were probably connecting with a different user via libgda than when testing in psql, right? Otherwise the rights should've been the same for both. – Craig Ringer – 2012-11-23T09:35:03.043

You're right (psql = postgres, libgda = userforspecialpurpose). – Peter Weber – 2012-11-23T11:56:13.610

Yep, so your psql test wasn't really the same as your libgda test, which is why you didn't get the same results testing manually. Glad to confirm that. – Craig Ringer – 2012-11-23T12:02:47.273