<div dir="auto"><div>Rikesh and list,<br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Feb 15, 2024, 18:40 Rikesh Lad via QGIS-User <<a href="mailto:qgis-user@lists.osgeo.org" target="_blank" rel="noreferrer">qgis-user@lists.osgeo.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello, <div><br></div><div>Please see attached. Does anyone know how to add a primary key and spatial index to a large layer without the software crashing? </div><div><br></div><img src="https://mail.google.com/mail/?ui=2&ik=af9e177f7b&attid=0.1&th=18db07aee46fd170&view=fimg&fur=ip&rm=18db07aee46fd170&sz=w1600-h1000&attbid=ANGjdJ_Ez1Ldj6C1TYhV1PJY6MhqT3y1q7o_1_vT737A2vbyYK6Irsljt1_ktuAgpsgfDFPr0UJ0QrYgk0RYFHj7Ov-HRzU2BODw_FL-QGwy939LettPS_bFxUH81Vg&disp=emb&realattid=ii_lso1iv9s0&zw" alt="image.png" width="501" height="461"></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">Here is some reference info about adding a primary key to a PostgreSQL table</div><div dir="auto"><br></div><div dir="auto"><a href="https://www.postgresqltutorial.com/postgresql-tutorial/postgresql-primary-key/#:~:text=To%20add%20a%20primary%20key%20to%20an%20existing%20table%2C%20you,to%20the%20primary%20key%20constraint">https://www.postgresqltutorial.com/postgresql-tutorial/postgresql-primary-key/#:~:text=To%20add%20a%20primary%20key%20to%20an%20existing%20table%2C%20you,to%20the%20primary%20key%20constraint</a>.</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div></div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Here is some reference info that explains how to add a spatial index</div><div dir="auto"><br></div><div dir="auto"><a href="https://postgis.net/workshops/postgis-intro/indexing.html" target="_blank" rel="noreferrer">https://postgis.net/workshops/postgis-intro/indexing.html</a></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div></div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Both require the use of a PostgreSQL client for example "psql".</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div></div>
</blockquote></div></div></div>