question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hasura Console "Relation does not exist"

See original GitHub issue

I am running a Hasura locally using docker compose with a hasura container and a postgres container.

I am using migrations and making changes to my local container with hasura console. I am trying to run SQL in order to insert data into my database. Any query that references public.placeTypes gives an error along these lines:

{
    "statement": "SELECT * FROM public.placeTypes",
    "prepared": false,
    "error": {
        "exec_status": "FatalError",
        "hint": null,
        "message": "relation \"public.placetypes\" does not exist",
        "status_code": "42P01",
        "description": null
    },
    "arguments": []
}

The console shows the table public.placeTypes, and when I connect to the postgres container, I also see the table there as well.

I am able to insert data using the console, but not using SQL

I commented here since I was seeing some issues with my migrations: https://github.com/hasura/graphql-engine/issues/1211#issuecomment-541475896, but I don’t know if that is at all related to this issue

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

7reactions
shahidhkcommented, Oct 14, 2019

@afreix I took a quick look. The table name is placeTypes and whenever you have capital letters in a relation name, you should use double quotes (") around it. Otherwise, Postgres just lower cases everything.

Try SELECT * FROM "public"."placeTypes"

2reactions
littlepeacommented, Jul 14, 2020

I’ve had the same issue, and manually moving functions to the bottom of the migration script helped

Read more comments on GitHub >

github_iconTop Results From Across the Web

Postgres: Creating Relationships | Hasura GraphQL Docs
A relationship from one table/view to another can be created by defining a link between a column of the table/view to a column...
Read more >
Troubleshooting Hasura GraphQL engine errors
Should there be any error coming from the Hasura console UI, they will show up in the Browser dev tools. Remote service logs​....
Read more >
Setting Up a GraphQL Schema Using an Existing Postgres ...
When you have an existing database with a schema already present, you don't need to create tables or views or run DDL queries...
Read more >
Managing Metadata | Hasura GraphQL Docs
If you are only using the Hasura Console from the Hasura CLI then it will be kept fully updated as you make changes....
Read more >
Relationships with Hasura | Hasura GraphQL Tutorial
This is achievable using nested queries if a relationship exists between the two. ... Hasura Console automatically suggests relationships based on these ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found