[FWTools] Mapinfo > Postgres > Mapinfo conversion problems
tim mortimer
timortimer at googlemail.com
Sat Feb 20 07:54:44 EST 2010
Richard,
Thanks for this. The -launder option preserves the case. I'm resigned to
having to quote all my columns in my queries because I have to preserve the
schema as supplied to me.
Tim
On 19 February 2010 18:02, Richard Greenwood <richard.greenwood at gmail.com>wrote:
> On Fri, Feb 19, 2010 at 10:02 AM, tim mortimer
> <timortimer at googlemail.com> wrote:
> > I'm experiencing a few conversion problems between MapInfo and Postgres
> > using ogr2ogr on WIndows:
> >
> > The command ogr2ogr -f "PostgreSQL" "PG:host=xxx user=yyy dbname=db
> > password=zzz" table_name.tab works basically OK but I experience a
> number
> > of translation problems.
> >
> > Firstly, if the original windows file name has spaces or periods(.) these
> > seem to act as escape char's and result in a truncated table name in
> > Postgres. I've tried all the combination of "" and ' ' around the file
> name
> > without success. Is there a solution to this?
>
> You can define the new table name that is created with -nln
> "MyNewTable". Postgres tables can not have spaces, and if you want to
> avoid having to quote table names, you should make them all lower
> case.
>
> > Secondly, the uppercase attribute column titles are all translated to
> lower
> > case e.g. "FlowersMay" is created as "flowersmay". Is there a way of
> > preserving the case?
>
> I don't know a work around, but personally I find this to be a feature
> because postgres roll everything to lowercase. If your table has a
> column "FlowersMay" you can not do a:
> SELECT FlowersMay from mytable;
> because postgres would see that as:
> SELECT flowersmay from mytable;
> it would have to be:
> SELECT "FlowersMay" from mytable;
> so that postgres would honor the mixed case.
>
> Rich
> --
> Richard Greenwood
> richard.greenwood at gmail.com
> www.greenwoodmap.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/fwtools/attachments/20100220/36578302/attachment.htm
More information about the FWTools
mailing list