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

**URL:** https://community.nocodb.com/t/self-hosted-external-db-nocodb-doesnt-recognize-edit-of-pk-from-postgres/2114
**Category:** Self-Host
**Created:** [October 20, 2025, 1:52pm UTC](https://community.nocodb.com/t/self-hosted-external-db-nocodb-doesnt-recognize-edit-of-pk-from-postgres/2114 "2025-10-20T13:52:36Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![traste](https://avatars.discourse-cdn.com/v4/letter/t/e36b37/32.png) [@traste](https://community.nocodb.com/u/traste)
#### Post date: [October 20, 2025, 1:52pm UTC](https://community.nocodb.com/t/self-hosted-external-db-nocodb-doesnt-recognize-edit-of-pk-from-postgres/2114/1 "2025-10-20T13:52:36Z")

</div>

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](https://canada1.discourse-cdn.com/flex011/uploads/nocodb/original/1X/0192626f030461b4912c43284fd7e06085866e03.png)](https://preview.redd.it/nocodb-doesn0t-recognize-text-field-as-pk-from-postgres-v0-i8lspkgio9wf1.png?width=2886&format=png&auto=webp&s=d7c2d4885aadb8d5cc9f46719645e06c7780ab2c "Image from r/NocoDB - NocoDB doesn0t recognize text field as PK from Postgres")

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](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

---

<div class="post-metadata">

### Author: ![Navi](https://avatars.discourse-cdn.com/v4/letter/n/3be4f8/32.png) [@Navi](https://community.nocodb.com/u/Navi)
#### Post date: [October 20, 2025, 2:00pm UTC](https://community.nocodb.com/t/self-hosted-external-db-nocodb-doesnt-recognize-edit-of-pk-from-postgres/2114/2 "2025-10-20T14:00:12Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![traste](https://avatars.discourse-cdn.com/v4/letter/t/e36b37/32.png) [@traste](https://community.nocodb.com/u/traste)
#### Post date: [October 20, 2025, 2:30pm UTC](https://community.nocodb.com/t/self-hosted-external-db-nocodb-doesnt-recognize-edit-of-pk-from-postgres/2114/3 "2025-10-20T14:30:23Z")

</div>

Thanks for answering! Sure thing:

 ![image](https://canada1.discourse-cdn.com/flex011/uploads/nocodb/original/1X/f14be23674a5d27dbfd841a02d03bc74cfb62673.png)

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”.

---

<div class="post-metadata">

### Author: ![Navi](https://avatars.discourse-cdn.com/v4/letter/n/3be4f8/32.png) [@Navi](https://community.nocodb.com/u/Navi)
#### Post date: [October 20, 2025, 2:42pm UTC](https://community.nocodb.com/t/self-hosted-external-db-nocodb-doesnt-recognize-edit-of-pk-from-postgres/2114/4 "2025-10-20T14:42:30Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![traste](https://avatars.discourse-cdn.com/v4/letter/t/e36b37/32.png) [@traste](https://community.nocodb.com/u/traste)
#### Post date: [October 20, 2025, 8:14pm UTC](https://community.nocodb.com/t/self-hosted-external-db-nocodb-doesnt-recognize-edit-of-pk-from-postgres/2114/5 "2025-10-20T20:14:04Z")

</div>

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

---

<div class="post-metadata">

### Author: ![traste](https://avatars.discourse-cdn.com/v4/letter/t/e36b37/32.png) [@traste](https://community.nocodb.com/u/traste)
#### Post date: [October 21, 2025, 11:08am UTC](https://community.nocodb.com/t/self-hosted-external-db-nocodb-doesnt-recognize-edit-of-pk-from-postgres/2114/6 "2025-10-21T11:08:16Z")

</div>

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

 ![image](https://canada1.discourse-cdn.com/flex011/uploads/nocodb/original/1X/656986e46c586ddebdc0df6d844086aaf207a998.png)
