NetXMS Support Forum

English Support => General Support => Topic started by: ravi2904 on October 17, 2019, 04:14:48 PM

Title: Using different schema other than public in Postgres
Post by: ravi2904 on October 17, 2019, 04:14:48 PM
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
Title: Re: Using different schema other than public in Postgres
Post by: Filipp Sudanov on October 18, 2019, 12:29:13 AM
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
Title: Re: Using different schema other than public in Postgres
Post by: ravi2904 on October 18, 2019, 08:20:35 AM
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