Skip to main content
Solved

can a primary key be a timestamp value


Forum|alt.badge.img

I am reading from a postgresql database. Attribute [publication_time] has a primary key and type timestamp. In the postgresql database this attribute has values, but FME 2018.1 inspector shows no (blank) values.

Can timestamp as primarykey be the cause?

 

Kind regards

 

Kees

 

Best answer by david_r

I know it doesn't answer your question, but I would argue that for almost all use cases it's not a great idea to use a timestamp as a primary key.

Some arguments: https://dba.stackexchange.com/questions/168356/is-using-timestamp-as-primary-key-good-idea-mysql-mariadb

For efficiency and ease of use, it's difficult to beat an integer primary key generated from a sequence defined in your database. If you dabble with synchronization or distributed datasets, I would recommend using a GUID primary key.

View original
Did this help you find an answer to your question?

3 replies

Forum|alt.badge.img
  • Author
  • March 2, 2020

It seems that the problem is caused by the potgresql database. There is a combined primarykey of 2 attributes. Can FME solve that problem?

 

Kind regards


david_r
Celebrity
  • Best Answer
  • March 5, 2020

I know it doesn't answer your question, but I would argue that for almost all use cases it's not a great idea to use a timestamp as a primary key.

Some arguments: https://dba.stackexchange.com/questions/168356/is-using-timestamp-as-primary-key-good-idea-mysql-mariadb

For efficiency and ease of use, it's difficult to beat an integer primary key generated from a sequence defined in your database. If you dabble with synchronization or distributed datasets, I would recommend using a GUID primary key.


Forum|alt.badge.img
  • Author
  • March 9, 2020

Thank you David


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings