X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 89F8D9FA2C3 for ; Thu, 11 May 2006 13:44:41 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 37403-10 for ; Thu, 11 May 2006 13:44:28 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id BC1A49FA278 for ; Thu, 11 May 2006 13:44:28 -0300 (ADT) Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by svr4.postgresql.org (Postfix) with ESMTP id 8E54D5B7321 for ; Thu, 11 May 2006 16:44:26 +0000 (GMT) Received: by noel.decibel.org (Postfix, from userid 1001) id 6E9F556427; Thu, 11 May 2006 11:44:22 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Thu, 11 May 2006 11:44:22 -0500 Date: Thu, 11 May 2006 11:44:22 -0500 From: "Jim C. Nasby" To: giuseppe.derossi@email.it Cc: pgsql-admin@postgresql.org Subject: Re: trobles in importing dbf file Message-ID: <20060511164421.GC99570@decibel.org> References: <0dacdc79dc4a12f8ff5b8ac7a4d7566e@164.129.1.39> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0dacdc79dc4a12f8ff5b8ac7a4d7566e@164.129.1.39> X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.11 X-Hashcash: 1:20:060511:giuseppe.derossi@email.it::5Jo8XCL02Wy341BL:000000000000 0000000000000000000000000VOT X-Hashcash: 1:20:060511:pgsql-admin@postgresql.org::R9Zs1ZwPPw79/HHG:00000000000 00000000000000000000000004NB X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/145 X-Sequence-Number: 21677 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?"