From: Jim C. Nasby <decibel@decibel.org>
To: giuseppe.derossi@email.it
Cc: pgsql-admin@postgresql.org
Subject: Re: trobles in importing dbf file
Date: Thu, 11 May 2006 11:44:22 -0500
Message-ID: <20060511164421.GC99570@decibel.org> (raw)
In-Reply-To: <0dacdc79dc4a12f8ff5b8ac7a4d7566e@164.129.1.39>
References: <0dacdc79dc4a12f8ff5b8ac7a4d7566e@164.129.1.39>
BTW, your email almost got marked as spam:
X-Spam-Status: No, score=4.1 required=5.0 tests=BAYES_00,DNS_FROM_RFC_ABUSE,
NO_REAL_NAME,RCVD_HELO_IP_MISMATCH,RCVD_NUMERIC_HELO
autolearn=no version=3.1.0
On Thu, May 11, 2006 at 09:24:35AM +0200, giuseppe.derossi@email.it wrote:
> Hi Guys,
> I'm a newbie in Postgres and hope my mail is not off topic. Well, I'm
> migrating from Mysql to PostGree in order to use the postgis features. I've
It's Postgres or PostgreSQL, not Postgree.
> some dbf files I've to import, so I've used the utility dbf2pg.exe ( I've
> installed the version 8.1 in win xp env). Now is there a way to add
> automatically a primary key if no, how
> can I can add it after importing the table in postgres ? In mYsql an index
> (the number or row) is automatically added as first column.
> Sorry if the question is trivial, I didn't suspect this gap.
ALTER TABLE tablename ADD PRIMARY KEY (field1, field2);
or
ALTER TABLE tablename ADD UNIQUE (field1, field2);
--
Jim C. Nasby, Database Architect decibel@decibel.org
Give your computer some brain candy! www.distributed.net Team #1828
Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: decibel@decibel.org, giuseppe.derossi@email.it
Subject: Re: trobles in importing dbf file
In-Reply-To: <20060511164421.GC99570@decibel.org>
References: <0dacdc79dc4a12f8ff5b8ac7a4d7566e@164.129.1.39> <20060511164421.GC99570@decibel.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox