Skip to content

'Error: There is not enough information to infer relation' with PostgresAdapter #9694

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Asterohobit opened this issue Dec 3, 2024 · 2 comments
Labels

Comments

@Asterohobit
Copy link

Asterohobit commented Dec 3, 2024

Link to reproduction

No response

Describe the Bug

With nested blocks, Postgres/Drizzle cannot create implicit tables. For example, my collection GlobalElements (elements that are the same for all pages) holds a Block called FooterBlock, which can contain a FooterLinksBlock. When trying to access the collection GlobalElements via the Admin Panel, an Error is thrown:
ERROR (payload): Error: There is not enough information to infer relation "global_elements._blocks_footerLinksBlock"

Have you encountered this error before? A quick internet search suggested is has to do with defining relations one-sided, but this is not the case here as everything happens implicitly.

To Reproduce

  1. Create a collection with a field like this: { name: "footer", type: "blocks", required: true, blocks: [FooterBlock], },
  2. Create the FooterBlock that contains a field like this: { name: "content", type: "blocks", blocks: [FooterLinksBlock, GridBlock], required: true, },
  3. Access the collection via the Admin Panel, the error is thrown in the local terminal.

Payload Version

2.0.0

Adapters and Plugins

db-postgres

@Asterohobit Asterohobit added status: needs-triage Possible bug which hasn't been reproduced yet v2 labels Dec 3, 2024
@github-actions github-actions bot added the stale label Jan 3, 2025
@DanRibbens
Copy link
Contributor

Those won't be fixed in v2 because it would require changes that could be considered breaking. It was resolved in v3. Our recommendation is to update to the latest v3 version.

@github-actions github-actions bot removed status: needs-triage Possible bug which hasn't been reproduced yet stale labels May 1, 2025
Copy link
Contributor

github-actions bot commented May 9, 2025

This issue has been automatically locked.
Please open a new issue if this issue persists with any additional detail.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants