<div dir="ltr"><div>Hi,</div><div><br></div><div>A few years ago, I developed a plugin : <a href="https://plugins.qgis.org/plugins/db-style-manager/">https://plugins.qgis.org/plugins/db-style-manager/</a> to help using styles in database.<br></div><div>I have used it, but feel free to try it and see if it works.<br></div><div><br></div><div>I see now there is a new one : <a href="https://plugins.qgis.org/plugins/db_style_reloader/">https://plugins.qgis.org/plugins/db_style_reloader/</a></div><div><br></div><div>Side note, I would have happily managed a pull request on the plugin to fit the needs of this "new" plugin.</div><div><br></div><div>Regards,</div><div><br></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">Le lun. 7 avr. 2025 à 12:41, Bo Victor Thomsen via QGIS-User <<a href="mailto:qgis-user@lists.osgeo.org">qgis-user@lists.osgeo.org</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>

  
    
  
  <div>
    <p>Hi Peter -</p>
    <p>I'm not sure if you're aware of the "Save style as default"
      function - So here comes for a Postgres layer</p>
    <ol>
      <li>Load the layer from Postgres <br>
      </li>
      <li>Style the layer <br>
      </li>
      <li>Right-click on the layer name in the "Layers" panel<br>
      </li>
      <li>Click on "Options" -> Button "Style" in the lower leftmost
        corner of the dialog</li>
      <li>Click on "Save as Default" option</li>
      <li>This will show a small dialog "Load default style from" and 3
        buttons</li>
      <li>Click the button name "Datasource Database"</li>
    </ol>
    <p>From now on, every time you load the specific table from Postgres
      as a QGIS layer, it will automatically gets the saved style.</p>
    <p>It not only the style - It's every information associated to the
      layer: Field definition, attribute form and more.  <br>
    </p>
    <pre cols="72">Med venlig hilsen / Best regards

Bo Victor Thomsen</pre>
    <div>On 07/04/2025 08.45, peter.berger---
      via QGIS-User wrote:<br>
    </div>
    <blockquote type="cite">
      
      
      
      <div>
        <p class="MsoNormal">There are serveral steps necessary to store
          from QGIS a vector layer with his style in a postgres DB. For
          a big amout of layers this is impracticaI.<u></u><u></u></p>
        <p class="MsoNormal"><u></u> <u></u></p>
        <p class="MsoNormal">Therfore I would do this in one step from
          QGIS. <span lang="FR-CH">Is this in any way possible?<u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="FR-CH"><u></u> <u></u></span></p>
        <p class="MsoNormal"><b><span style="font-size:8pt;font-family:"Trebuchet MS",sans-serif">Peter
              Berger<u></u><u></u></span></b></p>
        <p class="MsoNormal"><span style="font-size:8pt;font-family:"Trebuchet MS",sans-serif">Brunnwiesenstrasse
            62<u></u><u></u></span></p>
        <p class="MsoNormal"><span style="font-size:8pt;font-family:"Trebuchet MS",sans-serif">8049
            Zürich<u></u><u></u></span></p>
        <p class="MsoNormal"><span style="font-size:8pt;font-family:"Trebuchet MS",sans-serif">Schweiz<u></u><u></u></span></p>
        <p class="MsoNormal"><span style="font-size:8pt;font-family:"Trebuchet MS",sans-serif">mobile
            +41 79 301 71 54<u></u><u></u></span></p>
        <p class="MsoNormal"><span style="font-size:8pt;font-family:"Trebuchet MS",sans-serif"><u></u> <u></u></span></p>
        <p class="MsoNormal"><span style="font-size:8pt;font-family:"Trebuchet MS",sans-serif">The
            several step procedure:<u></u><u></u></span></p>
        <p><span style="font-family:Symbol">·</span><span lang="FR-CH"> 
          </span><strong><span lang="FR-CH" style="font-family:"Calibri",sans-serif">Load
              the layer</span></strong><span lang="FR-CH">: Import the
            layer from a vector file into QGIS.<u></u><u></u></span></p>
        <p><span style="font-family:Symbol">·</span><span lang="FR-CH"> 
          </span><strong><span lang="FR-CH" style="font-family:"Calibri",sans-serif">Rename
              (if necessary)</span></strong><span lang="FR-CH">: Give
            the layer an appropriate name.<u></u><u></u></span></p>
        <p><span style="font-family:Symbol">·</span>  <strong><span style="font-family:"Calibri",sans-serif">Transfer
              the layer to Postgres</span></strong>: Drag the layer into
          the PostgreSQL database. You will find it there with the
          specific name.<u></u><u></u></p>
        <p><span style="font-family:Symbol">·</span>  <strong><span style="font-family:"Calibri",sans-serif">Load
              the layer from Postgres</span></strong>: Import it back
          from the PostgreSQL database into QGIS.<u></u><u></u></p>
        <p><span style="font-family:Symbol">·</span>  <strong><span style="font-family:"Calibri",sans-serif">Assign
              the style</span></strong>: Copy the style from the
          original layer and assign it to the Postgres layer loaded in
          QGIS.<u></u><u></u></p>
        <p><span style="font-family:Symbol">·</span>  <strong><span style="font-family:"Calibri",sans-serif">Export
              the style</span></strong>: Export the style of the
          Postgres layer. You will now find an option to save the style
          with the exact name of the layer in the PostgreSQL database.<u></u><u></u></p>
        <p><span style="font-family:Symbol">·</span>  <strong><span style="font-family:"Calibri",sans-serif">Delete
              old layers and reload</span></strong>: Delete all
          associated layers and reload the layer from the PostgreSQL
          database.<u></u><u></u></p>
        <p class="MsoNormal"><span style="font-size:8pt;font-family:"Trebuchet MS",sans-serif"><u></u> <u></u></span></p>
        <p class="MsoNormal"><u></u> <u></u></p>
      </div>
      <br>
      <fieldset></fieldset>
      <pre>_______________________________________________
QGIS-User mailing list
<a href="mailto:QGIS-User@lists.osgeo.org" target="_blank">QGIS-User@lists.osgeo.org</a>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
</pre>
    </blockquote>
  </div>

_______________________________________________<br>
QGIS-User mailing list<br>
<a href="mailto:QGIS-User@lists.osgeo.org" target="_blank">QGIS-User@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
</blockquote></div>