Menu

#1034 Create Scripts PostgreSQL

None
open
5
2018-12-22
2012-07-03
Timm
No

Incorrect syntax, at least not accepted by postgreSQL 9.1.4:

CASE 1:
exported by "create table" scipt
colum_name timestamp DEFAULT '2012-07-01 00:00:00'::timestamp without time zone NOT NULL
should be
colum_name timestamp without time zone DEFAULT '2012-07-01 00:00:00' NOT NULL

CASE 2:
exported by "create table" scipt
colum_name numeric(19) DEFAULT NULL::numeric
should be
colum_name numeric(19) DEFAULT NULL

CASE 3:
exported by "create table" scipt
colum_name varchar(255) DEFAULT ''::character varying NOT NULL
should be
colum_name CHARACTER VARYING(255) DEFAULT '' NOT NULL

CASE 4 (doubled combined PK):
When you create a table script (of a number of tables), while choosing the default "Constraints and indexes at the end of the script" combined PK are exported twice, one time within the table script itself and one time at the end among the constraints/indexes.

an example of "create table" scipt
line within the table script:
CONSTRAINT pk_comp_prj_adr1 PRIMARY KEY (adr_id,comp_prj_id)

and line among the constraints/indexes section:
CREATE UNIQUE INDEX pk_comp_prj_adr1 ON "public"."comp_prj_adr"
(
adr_id,
comp_prj_id
)
;

Thanks a lot for your work!!! Olaf

Discussion


Log in to post a comment.