How unique PK value in Postgres?

Das Goravani goravanis at gmail.com
Tue Feb 1 20:45:45 UTC 2022


Hello,

When inserting, how do you get Postgres to assign a new, unique, value in the PK column?

In SQLite you just pass a #NULL in that column and SQLite assigns a value.

I was importing data into postgres very recently and no matter what I put in the PK column it would not accept it as cause for assigning a value. I tried 0, and NULL and of course a value. It used the values I passed.. they were from SQLite and they were in order, unique, so it worked out OK. 

But in general new work when inserting how do you get it to assign the value?

Do you use $excludefrominserts ?  That didn’t seem to work on a Smartlist with $doinserts(). I tried it, it came up with errors for the PK field anyway, even though I excluded it. 

???

Thanks

Das Goravani




More information about the omnisdev-en mailing list