Skip to main content
Solved

can a primary key be a timestamp value

  • March 2, 2020
  • 3 replies
  • 404 views

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.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

Forum|alt.badge.img
  • Author
  • 18 replies
  • 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
  • 8392 replies
  • 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
  • 18 replies
  • March 9, 2020

Thank you David