[postgis-devel] loader incompatibility
strk at refractions.net
strk at refractions.net
Tue Apr 5 12:50:46 PDT 2005
On Tue, Apr 05, 2005 at 08:55:21PM +0200, Markus Schaber wrote:
> Hi, Strk,
>
> strk at refractions.net schrieb:
>
> > That's not what I had in mind.
> > Are num_entitities, j and trans needed by outside code ?
>
> I just had a closer look at the code, it seems that some general
> clean-up would be good. :-)
>
> j is needed by outside code as it is the row count that is used to
> update the SQL SERIAL / Sequence in -c / -d mode. From looking at the
> code, I think that this might be replaced by num_entities directly.
j is a tipical "local" variable.
> num_entities is set outside (by SHPGetInfo) and needed both outside and
> inside the new function, so it makes sense to pass it in as parameter or
> keep it as global.
Maybe SHPGetInfo should be called directly inside and load_data should
return number of rows inserter for use by the SERIAL updater ?
> trans is initialized to 0 outside, but then only accessed inside. It
> thus can be a local variable.
>
>
> The attached patch cleans this up. I initially wanted to keep the patch
> as simple as possible, but maybe it is better to keep the code as simple
> as possible.
As I wrote about the -w flag I tried NOT to touch other things to
make RC6-final transition less dangerous. There are other cleanups
as well that needs to be done.
--strk;
More information about the postgis-devel
mailing list