I have a local postgres db, and some query is executed ok on it, but the query does not work on production db. So I get the production db settings to reproduce the error. The settings looks like this:
INSERT INTO pg_settings
("name",setting,unit,category,short_desc,extra_desc,context,vartype,"source",min_val,max_val,enumvals,boot_val,reset_val,sourcefile,sourceline,pending_restart)
VALUES
('debug_assertions', 'off', NULL, 'Preset Options', 'Shows whether the running server has assertion checks enabled.' ,NULL, 'internal', 'bool', 'default', NULL, NULL, NULL, 'off' ,'off' ,NULL, NULL, false),
...
etc
When I'm trying to execute the script, I'm getting
SQL Error [55000]: ERROR: cannot insert into view "pg_settings"
Detail: Views that do not select from a single table or view are not automatically updatable.
Hint: To enable inserting into the view, provide an INSTEAD OF INSERT trigger or an unconditional ON INSERT DO INSTEAD rule.
What I need is either apply this settings to existing local db or create a new one using this settings. How can I do it? Sorry for lame question :(
... but the query does not work on production db.
Please define doesn't work. Why do you think that turnig on assertions would solve your problem? And: I really don't think that assertions are turned on on production. [this appears to be an XY-problem]