dataface icon indicating copy to clipboard operation
dataface copied to clipboard

Discussion: Use CTIDs instead of primary keys

Open timwis opened this issue 8 years ago • 1 comments

@begriffs suggested that perhaps we can use the ctid value of a row to make changes to it, obviating the need for a primary key to be set.

For example:

  • GET /foo?select=*,cid
  • PATCH /foo?ctid=eq.(0,3)

The nice thing about this is that end-users wouldn't need to know what primary keys are. Are there trade offs? If you're using it against a table that does have a primary key field(s), it should still work, I imagine...

timwis avatar May 07 '17 22:05 timwis

Another thing to keep in mind is that once we add the concept of "linked tables" (foreign key columns), we'll need the foreign table to have a primary key. So we may not be able to get around having primary keys in dataface after all.

timwis avatar May 09 '17 09:05 timwis