Hi, this used to work at the end of November, but I just found out that exporting SQL to PostgreSQL ignores the primary keyword.
DBML
id UUID [primary key, default: `gen_random_uuid()`]
November 19, 2023
CREATE TABLE "locations" (
"id" UUID PRIMARY KEY DEFAULT (gen_random_uuid()),
Today
CREATE TABLE "locations" (
"id" UUID DEFAULT (gen_random_uuid()),
Hi @Joseph_Pollone
We just released an update that should fix the primary key problem. Please let us know if you still have any issues.
Thanks.
Thank you! I appreciate the work you do and really enjoy the product.
1 Like
Has this fix from last year become broken now? DBML containing default: gen_random_uuid()
generates invalid PostgreSQL SQL output.
Hi @Mike_Scott,
I tried your syntax and the generated PostgreSQL commands still work correctly.
Could you provide a sample DBML that would generate broken PostgreSQL commands?
Also, could you provide the PostgreSQL version you are using? Some of the exported commands may not be compatible with older PostgreSQL versions.
Hi @Tho_Nguyen,
Thanks for the rapid response. I was just coming back now to reply to my own comment and found that you’d beat me to it 
Sorry, my bad. I just realised that the gen_random_uuid() function needs to be surrounded by backticks and I was using single quotes. I’ve changed the definitions to backticks and everything works correctly now.
P.S. I can’t find any way to create a new topic, so I can’t report bugs or ask questions. There’s no “New topic” button. I’ve looked in the FAQ but can’t find any explanation. Can you help?
Sorry for asking this here as it’s off-topic but since I can’t create a new topic, I can’t actually ask this anywhere else on the community forum.
Hi Mike,
It is due to Discourse’s trust_level, which only allows level 1 users (who must read at least 5 topics) to create new topics. But I’ve upgraded you to level 1. Feel free to create a new post right now.