[Self-hosted : External-DB] NocoDB doesn't recognize edit of PK from Postgres

Hi!,

I’m struggling with Noco trying to use a text field as PK:

r/NocoDB - NocoDB doesn0t recognize text field as PK from Postgres|750xauto

I’m using Postgres as external DB. My problem is exactly this one:

https://community.nocodb.com/t/setting-primary-key-may-03/414/18?page=2

I tried what they discussed there:

- Syncing metadata

- Deleting the connection WITHIN the base, and re-adding it again

- Deleting the Postgres whole integration, rebooting Noco…, adding it back and, no luck!

Any suggestions?

Thanks

Could you please help describe what is the behaviour you see when you connect NocoDB to postgres with that table which has text primary key.

Thanks for answering! Sure thing:

I couldn’t upload that screenshot in my previous email (newbie limitations). Noco does not recognize the “id” field. So it creates a new PK field: “id1”.

Ah looks like you have ended up editing that primary key from autoincrement to text on a table that was natively created from NocoDB’s UI to begin with.

Here is a workaround, create the tables you need in postgres database with either SQL or clients like tablePlus or PgAdmin. Then after all done, connect NocoDB to it.

1 Like

Thanks, but I have already tried something similar:

  1. I edited the table fields in Postgress with PGadmin.

2. I removed the Postgress integration from Noco

  1. I Deleted the whole base/project

I rebooted the machine. Then I added the Postgress integration and connected to the database.

is it the same? Thanks

I

Thanks, I finally got it! I had to create a new table in Postgres and a new base in NocoDB.