There is an application which uses MSSQL as its back end. Now I am developing code so that it may use PostgreSQL. I have almost completed it except there is this one difference when executing:
When saving a new Application,
SQL Server code:
create table tower
(
npages integer,
ifnds integer,
ifnid integer,
name varchar(20),
towid integer not null IDENTITY
)
PostgreSQL code :
create table tower
(
npages integer,
ifnds integer,
ifnid integer,
name varchar(20)
)
Why doesn't the towid field (which is a default field) not get generated automatically when executing through PostgreSQL ?
Any possible reason? Triggers? Procedures?
PostgreSQL will create table exactly as you requested. It will not generate some column automatically (almost, but this is low level). You need add towid serial primary key
to your request.