Re: PostgreSQL General Digest V1 #569

From: Tim Kientzle <kientzle(at)acm(dot)org>
To: PostgreSQL general mailing list <pgsql-general(at)postgresql(dot)org>
Subject: Re: PostgreSQL General Digest V1 #569
Date: 2000-09-11 18:23:21
Message-ID: 39BD2319.601AA9F8@acm.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

You can import any valid SQL that PostgreSQL supports
with the \i command. Unfortunately, CREATE TABLE
is quite different between MySQL and PostgreSQL.
You'll have to manually edit all of your CREATE TABLE
commands into PostgreSQL format.

The only big error I see here is the auto_increment flag on
line 2. In PostgreSQL, the equivalent is: pid_addresse SERIAL,

- Tim Kientzle

> When I try to import the SQL file into PostgreSQL with
> psql --> \i filename
>
> I get the following error:
>
> line 17:parser: parse error at or near "("
>
> My SQL statement:
>
> <schnipp>
>
> 1 CREATE TABLE Adresse (
> 2 pid_adresse int(11) DEFAULT '0' NOT NULL auto_increment,
> 3 id_person int(11) DEFAULT '0' NOT NULL,
> 4 PLZ varchar(50),
> 5 id_ort int(11) DEFAULT '0',
> 6 strasse varchar(50),
> 7 id_postcode int(11),
> 8 hausnummer int(11),
> 9 zusatz varchar(25),
> 10 postfach varchar(20),
> 11 leitcode varchar(18),
> 12 strassen_code char(3),
> 13 FZ char(3),
> 14 adresszusatz varchar(50),
> 15 PRIMARY KEY (pid_adresse),
> 16 KEY id_person (id_person)
> 17 );
>
> <schnapp>
>
> any suggestions ?
> I can't find a docu for the syntax of the textfiles, which
> I can import with the option \i !

Browse pgsql-general by date

  From Date Subject
Next Message K Parker 2000-09-11 18:23:43 Re race condition and currval
Previous Message Richard Poole 2000-09-11 17:27:53 "initdb -t" ate my baby