Postgres node: id is required, but is increment

Why do I have to set an id, even if it’s an increment? :thinking:
This will be handled automatically by the database.

Version: 1.65.2

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hey @renetheastronaut , I suspect this is because you chose “Map each column manually” mode. If you switch to “Map Automatically”, you are not required to use the id. Surely that also implies you have to make sure the property names in you input matches the column names.

There is an old github issue that was marked as solved regarding this. But it’s not solved, I have the same thing.

You can get around it by using the upsert node, or by using Map Automatically as ihortom says.

1 Like

Yes, please fix this issue when using “Map columns manually” :pray:

Hi @ihortom , do you hav any status on the Git Issue fix(Postgres Node): Stop marking autogenerated columns as required by elsmr · Pull Request #8230 · n8n-io/n8n which seems to be closed, but actually is still an issue?

Hi @Joejoe

The issue mentions the PR that fixed it as 🚀 Release 1.24.0 by github-actions[bot] · Pull Request #8290 · n8n-io/n8n · GitHub

Is this issue happening again on the latest version you say? How did you replicate this?

Thanks!

Yes it’s happening for me as well with a required ‘id’ column that has an auto number. The postgres node is requiring it still for inserts, which is annoying. I’m using v1.79.3.

Found the issue, make sure the Identity setting for the column is ALWAYS and not BY DEFAULT, otherwise it will be required in n8n because the column is marked as required, so no default will be used. It works now as expected, as ALWAYS will make sure an identity is always generated.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.