<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Il 08/02/2013 07:34, Stefan Schwarzer
ha scritto:<br>
</div>
<blockquote cite="mid:24EEDB64-FBCC-40A5-BEB2-AF6D09548268@unep.org"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<span class="Apple-style-span" style="border-collapse: collapse;
font-family: Arial, 'Liberation Sans', 'DejaVu Sans',
sans-serif; font-size: 14px; line-height: 18px; ">
<p style="margin-top: 0px; margin-right: 0px; margin-bottom:
1em; margin-left: 0px; padding-top: 0px; padding-right: 0px;
padding-bottom: 0px; padding-left: 0px; border-top-width: 0px;
border-right-width: 0px; border-bottom-width: 0px;
border-left-width: 0px; border-style: initial; border-color:
initial; font-size: 14px; vertical-align: baseline;
background-image: initial; background-attachment: initial;
background-origin: initial; background-clip: initial;
background-color: transparent; clear: both; word-wrap:
break-word; background-position: initial initial;
background-repeat: initial initial; ">Hi there,</p>
</span><span class="Apple-style-span" style="border-collapse:
collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans',
sans-serif; font-size: 14px; line-height: 18px; ">I would like
to "update" a "countries of the world"-postgis-table, by
replacing it with another one which comes in form of a shapefile
(dumped from a Postgis database) from my development server.</span>
<div><font class="Apple-style-span" face="Arial, 'Liberation
Sans', 'DejaVu Sans', sans-serif"><br>
<span class="Apple-style-span" style="border-collapse:
collapse; font-size: 14px; line-height: 18px; ">Now, I can't
just do a "pgsql2shp", as this would throw an error as the
table already exists. And renaming the existing table into
something like "xx_original" doesn't work either
("xx_geom_gist already exists", is then the error message).</span></font></div>
<div><font class="Apple-style-span" face="Arial, 'Liberation
Sans', 'DejaVu Sans', sans-serif"><span
class="Apple-style-span" style="border-collapse: collapse;
line-height: 18px;"><br>
</span></font><span class="Apple-style-span"
style="border-collapse: collapse; font-family: Arial,
'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px;
line-height: 18px; ">I don't want to delete the (old) table
directly, as I would like to keep it as a backup.</span></div>
<div><span class="Apple-style-span" style="border-collapse:
collapse; font-family: Arial, 'Liberation Sans', 'DejaVu
Sans', sans-serif; font-size: 14px; line-height: 18px; "><br>
</span></div>
<div><span class="Apple-style-span" style="border-collapse:
collapse; font-family: Arial, 'Liberation Sans', 'DejaVu
Sans', sans-serif; font-size: 14px; line-height: 18px; "></span><span
class="Apple-style-span" style="border-collapse: collapse;
font-family: Arial, 'Liberation Sans', 'DejaVu Sans',
sans-serif; font-size: 14px; line-height: 18px; ">So, what is
the "right" way to solve this? Thanks for any hints!</span></div>
<div><span class="Apple-style-span" style="border-collapse:
collapse; font-family: Arial, 'Liberation Sans', 'DejaVu
Sans', sans-serif; font-size: 14px; line-height: 18px; "><br>
</span></div>
<div><font class="Apple-style-span" face="Arial, 'Liberation
Sans', 'DejaVu Sans', sans-serif"><span
class="Apple-style-span" style="border-collapse: collapse;
line-height: 18px;">Stef</span></font></div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
postgis-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a>
</pre>
</blockquote>
Hi,<br>
<br>
I think the best way to solve the issue would be to version the
table and refer to it by a synonim.<br>
Let's say your table name is world_countries, rename it to
world_countries_2012 and create a synonim to it, like<br>
CREATE SYNONIM TABLE world_countries ON world_countries_2012<br>
<br>
Then load the new one with a name like world_countries_2013, and to
switch to it simply change the synonim.<br>
<br>
This way you can keep the same name on the queries and update tables
keeping the previous ones.<br>
<br>
Regards,<br>
<br>
Paolo<br>
<br>
<pre class="moz-signature" cols="72">--
Paolo Crosato
</pre>
</body>
</html>