When I have created a query in the DBManager window of QGIS I want to save it as a view. When I click on the Create a view button, I'm then prompted for a name.

This is all fine, but I want to create my view in a schema - so I type general.view_1 in the name box. This doesn't create a view called view_ in the general schema but a view called general.view_1 in the public schema.

Is this a bug? a feature? or am I missing something obvious?

  • You can try putting general as the 1st schema in your PG user search path.
    – JGH
    Aug 3 at 14:23

1 Answer 1

  1. You can manually move the view using Menu Table > Move to Schema ...


  2. Create the view directy in the correct schema defining it in the query like create view general.view1 as SELECT ...

  • I know I can fix it after, but I'd like it to go to my prefered location directly from the create view button
    – Ian Turton
    Aug 3 at 13:48
  • Well, then probably the second option to directly create the view with the query seems to be the only option. The Create a view button indeed does not allow to enter a schema, just a name for the view which is then saved by default to the public schema.
    – Babel
    Aug 3 at 14:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.