hasura / hasura/graphql-engine

Postgres sql_error_code = 42622 - Truncate identifiers

Open
#7,269 4 comments 14 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

**Version:** 2.0.1
**Database:** Postgres 12.6
**Version:** Self-hosted

Postgres can only have identifiers with a max of 64 characters, however Hasura auto-generates longer names which then causes postgres to throw notice errors and truncate.

In the last 24 hours, we received 23,442 errors. Basically on every request.

I don't believe this actually causes an error as Postgres automatically truncates, but it would be better if Hasura took this limitation into account. This would stop the error messages from appear and avoid the potential issue of identifier clash.

Examples:
```
[JADE] [89-1] sql_error_code = 42622 NOTICE: identifier "_39_root.or.account.ar.account.people.cf.current_contract.or.role" will be truncated to "_39_root.or.account.ar.account.people.cf.current_contract.or.ro"

[JADE] [17-1] sql_error_code = 42622 NOTICE: identifier "_40_root.or.account.ar.account.people.ar.people.assignments.base" will be truncated to "_40_root.or.account.ar.account.people.ar.people.assignments.bas"

[JADE] [32-1] sql_error_code = 42622 NOTICE: identifier "_65_root.or.account.ar.account.rate_cards.ar.rate_cards.role_charge_out_rates.base" will be truncated to "_65_root.or.account.ar.account.rate_cards.ar.rate_cards.role_ch"

[JADE] [78-1] sql_error_code = 42622 NOTICE: identifier "_128_root.or.account.ar.account.projects.cf.schedule_totals_roles.base" will be truncated to "_128_root.or.account.ar.account.projects.cf.schedule_totals_rol"
```

Related issue: #6410

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.