Using different schema other than public in Postgres

Started by ravi2904, October 17, 2019, 04:14:48 PM

Previous topic - Next topic

ravi2904

Hi Victor,

How can set the configuration to use different schema in the database. Currently, all the tables are created in the public schema. Since it creates lot of tables with idata and tdata, the public schema gets cluttered. I am using Postgres.

Please let me know how can I achieve this ?

Thanks and best regards,

ravi

Filipp Sudanov

Currently NetXMS does not support this. In Postgres terms the thing you need is called search path - it defines in which schemas Postgres will search for a database with a give name.
One (complicated) way could be to add -csearch_path option to the connection function in /src/db/dbdrv/pgsql/pgsql.cpp

But it looks like it's possible to specify default search path in Postgres for each user - some information could be found here: https://stackoverflow.com/a/49930672

ravi2904

Hi Filipp,

Great !! The problem is solved. I created a user in Postgres with ownership to the required schema. I configured this user in system DNS as well as in server configuration of netXMS while installing. It created all the tables in the specified schema instead of public schema. The problem is solved.

Thanks you so much.

Best regards,
Ravi