Type decimal is not correctly parsed

The postgres type DECIMAL is parsed as a string “decimal”, so you can’t generate an SQL script with dbmdl2sql

Hi Neven_DREAN,
Thanks for letting us know,
Can you give us the sql or dbml code that fails?
Thanks.

Table "contracts" {
  "id" bigserial [pk]
  "salary" "decimal(7, 2)" [not null]
  "movie_id" bigint [not null]
  "actor_id" uuid [not null]
  "character_id" bigint [not null]
  "inserted_at" timestamp(0) [not null]
  "updated_at" timestamp(0) [not null]
}

converted to

CREATE TABLE "contracts" (
  "id" bigserial PRIMARY KEY,
  "salary" "decimal(7, 2)" NOT NULL,
  "movie_id" bigint NOT NULL,
  "actor_id" uuid NOT NULL,
  "character_id" bigint NOT NULL,
  "inserted_at" timestamp(0) NOT NULL,
  "updated_at" timestamp(0) NOT NULL
);

Even if I remove “decimal” from dbml, the parsing is not done → SQL so I guess it is not defined and defaults. Did not find in your code where you did this, but was just a quick lookup :slight_smile: I also submitted an issue on github. Thks!

Thank you for providing us with the code,
Currently dbml does not support some data types of sql92 and sql3. You can change using some of the Postgres data types found here PostgreSQL: Documentation: 6.3: Data Types . We will try to improve it gradually in the future.
Thank you!

ok, but this is a very old doc. Here is the current doc

Thanks for letting us know,
It was my mistake, you can try with data type decimal, not decimal(7,2)