Creating relationship failed. table not exists when creating manual relation
See original GitHub issueI have a table of users and a table followers with user_id and follower_id
I’m trying to create a view so I can see from a user who users he/she follows and also who follows him/her?
Table users
id
email
Table users_followers
id
user_id FK --> users
follower_id FK --> users
To see the followers of a user, I created an array relationship followers on users table
users_followers . user_id → users . id
and then to be able to see who is following a user, I created the following view
CREATE VIEW following_me AS
SELECT u.id as user_id,
u1.*
FROM users u
LEFT JOIN users_followers f ON u.id = f.follower_id
INNER JOIN users u1 ON f.user_id = u1.id;
and then when I try to create a manual relation from the users table to the following_me view as a reference table (users.id --> following_me.user_id
), even tho it does appear on the tables dropdown with all the correct fields, when I save, I get and error that says following_me table does not exists
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Troubleshoot table relationships - Microsoft Support
Sometimes Excel fails to detect relationship between tables. ... For more information, see Create a relationship between two tables.
Read more >I keep getting the error "relation [TABLE] does not exist"
Each element has to be quoted individually: select "ID" from "Schema"."table1";. More details about quoted identifiers are in the manual.
Read more >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 >Postgres : Relation does not exist error
You created your tables with double quotes, and now the names are case sensitive. As documented in the manual "Approvals" and Approvals are...
Read more >Creating multiple tables and table relationships - Launch School
/* one-to-one: User has one address */ CREATE TABLE addresses ( user_id int, -- Both a primary and foreign key street varchar(30) NOT...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@tafelito I’m closing this issue. Feel free to re-open if you’d like to add something 🙂
I was indeed just creating the view as I mentioned before. I was not creating a function. Doing what you suggested actually worked. So the view was created and now I’m able to track it. It just won’t allow me to track it when I create it from the SQL editor. I can do more tests if you need me to. Thanks @rikinsk