<div dir="ltr">Hi Adria,<div><br></div><div>Thanks for the feedback.</div><div><br></div><div>Some comments inline:</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Aug 21, 2013 at 1:54 PM, Adrią Mercader <span dir="ltr"><<a href="mailto:adria.mercader@okfn.org" target="_blank">adria.mercader@okfn.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
I've been playing around trying to set up pycsw with Postgres +<br>
PostGIS as backend, with mixed results. Here are a list of things I<br>
found:<br>
<br>
<br>
* If I understood the docs correctly [1], if you are using PostGIS<br>
(which the script will autodetect), the native PostGIS functions will<br>
be used and there is no need for the plpythonu functions. But if you<br>
call setup_db with create_plpythonu_functions=False, the geometry<br>
column and the trigger are not created, as they are in the same code<br>
block as the plpythonu functions creation.</blockquote><div><br></div><div>I usually create plpythonu functions even if PostGIS is present. This way if for some reason postgis gets unavailable in the future, pycsw will continue to work.</div>
<div>But yes, you understood correctly, thanks for the fix.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> It looks like this commit<br>
moved the indentation one level down [2].<br>
<br>
The rest of issues that followed assumed that this was fixed (ie I can<br>
use PostGIS without plpythonu), but please correct me if wrong.<br>
<br>
* After setting up the wkb_geometry in this way I always got an<br>
IntegrityError exception when trying to load a document which has a<br>
bbox defined. This was easy to spot, there was a typo in the srid on<br>
AddGeometryColumn.<br>
<br>
This PR fixes both issues:<br>
<br>
<a href="https://github.com/geopython/pycsw/pull/177" target="_blank">https://github.com/geopython/pycsw/pull/177</a><br>
<br></blockquote><div><br></div><div>good catch, thanks</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
* On several documents I tried I got exceptions because the fields<br>
defined were too short:<br>
<br>
DataError('(DataError) value too long for type character varying(256)\n',)<br>
<br>
See eg the abstract field in [3][4] or conditionapplyingtoaccessanduse<br>
in [5] (you find this with much more fields once you start importing<br>
large numbers of records).<br>
I'm not a DB expert, and I certainly can't talk for sqlite, but I<br>
would imagine that changing the column definitions to character<br>
varying(x) to text would have no effect on performance while removing<br>
all kind of text length limit problems. This is a good resource [6]<br></blockquote><div><br></div><div>+1</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
* As a really minor general comment, the exceptions raised while<br>
loading documents [8] are a bit too noisy, as they output the whole<br>
document, making difficult to know what actually went wrong.<br></blockquote><div><br></div><div>Yes this is true.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
Hope this helps,<br>
<br>
Adrią<br>
<br></blockquote><div><br></div><div>Best,</div><div>Angelos</div><div><br></div><div><br></div></div><br clear="all"><div><br></div>-- <br><span style="border-collapse:separate;color:rgb(0,0,0);font-family:'Times New Roman';font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"><span style="font-family:arial;font-size:small"><div>
Angelos Tzotsos</div><div>Remote Sensing Laboratory</div><div>National Technical University of Athens</div><div><a href="http://users.ntua.gr/tzotsos" target="_blank">http://users.ntua.gr/tzotsos</a></div></span></span>
</div></div>