Create Table Postgres
goravanis at gmail.com
Sat Jul 9 17:31:21 UTC 2022
To solve my insert problem I am trying to recreate my database table for customers.
I was assuming Omnis made the PK column SERIAL automatically, maybe I was wrong.
Now I am doing it myself, here is the start of my create table statement:
CREATE TABLE dtcustomers ("cust_id" NUMERIC(15,0) SERIAL PRIMARY KEY,"cust_firstname" VARCHAR(20),"cust_lastname" ….
Note the SERIAL keyword being used. Is that OK.. to state it right after the datatype, I thought I was doing it right.
But flag is false and the $nativeerrortext shows:
Syntax problem at or near "SERIAL"…
So I thought with postgres you can just put SERIAL after your PK field and it will auto increment NEXTVAL that field automatically if you don’t include it in your INSERT statements
Am I wrong somewhere?
More information about the omnisdev-en