views:

30

answers:

2

I'm more a mysql person, but I have to do a db in pg and the following CREATE TABLE keeps generating syntax errors... I just get an error: ERROR: syntax error at or near "(" and error: ERROR: syntax error at or near ")" Googling around didn't give me much help... I'm sure that I'm doing something mysql-esque and that's causing problems... (Note: I did already create the mfseq successfully...)

CREATE TABLE master_file (
    mfid INTEGER NOT NULL PRIMARY KEY DEFAULT nextval('mfseq'),
    prefix VARCHAR(4),
    fname VARCHAR(30) NOT NULL,
    lname VARCHAR(80) NOT NULL,
    MI varchar(1) NULL,
    address1 VARCHAR(200) NOT NULL,
    address2 VARCHAR(200),
    city VARCHAR(28),
    state VARCHAR(2),
    zip INT(5),
    zip_plus4 INT(4),
    mrn VARCHAR(30),
    aID INT,
    iID INT,
    gID VARCHAR(1),
    pphone VARCHAR(10);
);
A: 

Maybe int -> integer and without size (or numeric) and delete the delimiter at pphone field.

silent
Thanks, it was indeed a combo of the semicolon and the INT(x)...
phpN00b
+1  A: 

It should not be a semi-colon here: pphone VARCHAR(10);

Jimmy Stenke