I am using supabase and i am trying to accomplish one thing. I have a table called "customers", and it's like this: customer_id, first_name, last_name,....., profile_id (from the profile table, where data of users is stored). I have setup a simple RLS that let me do operations on this table that is as follow: (auth.id() = profile_id). In this way a user can see only its customers and its working fine. Now i have a "contracts" table.. This table has a relationship with "customers" table, every customer can have multiple contracts. I want to be able to select every contract from the contract table, only if the corresponding customer has a field that correspond to profile_id. Is the same as the first RLS rule on the customer table, but i need it to use it on the contracts table and avoid inserting profile_id also on this table. I'm new to postgres and supabase, can someone show me how it's done? Thanks
Related Questions in POSTGRESQL
- Only the first SQL script gets executed inside Docker Postgres container
- Compare fields in two tables
- Hibernate ClobJdbcType bindings: what are the diferences?
- Postgres && statement Error in Mybatis Mapper?
- Can this query be optimized? (Choosing a random row to insert, that excludes previously inserted Rows)
- Connection terminated unexpectedly while performing multi row insert using pg-promise
- Processing multiple forms in nodejs and postgresql
- How to copy data from SQLite to postgreSQL?
- PGAdmin4 configured behind a reverse proxy but unable to connect to Postgresql server
- Updates to pgsodium encrypted values don't use specified key_id
- Connecting to Postgres running in a Docker container using psql
- Can't connect to local postgresql server from my docker container
- Django Arrayfield migration to cloud sql (Postgresql) not creating the column
- Get list of matching keywords for each post
- docker-compose can't reset postgresql database
Related Questions in SUPABASE
- getting error when trying to launch kotlin jar file that use supabase "java.lang.NoClassDefFoundError"
- Error Inserting into Supabase: Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member
- Can an RPC result be included in a Supabase select function in Flutter for Data Modeling?
- Need some advice on differentiating between subscriptions using Stripe
- Updates to pgsodium encrypted values don't use specified key_id
- async/await is not yet supported in Client Components when using await supabase
- _supabaseClient__WEBPACK_IMPORTED_MODULE_1__.supabase.auth.signIn is not a function
- not able to change the confirmation email template in Self hosted supabase
- GET http://localhost:3000/ 500 (Internal Server Error)
- How can I use the verify_otp function on the python library for supabase / where can I find extended documentation on it?
- Listening to table inserts in supabase within radius of user location in Flutter
- NEXTJS - POST net::ERR_ABORTED 500 (Internal Server Error)
- How to use findMany in Drizzle ORM?
- Is it a good idea to use EF with Supabase?
- Why "npx prisma db pull" is blocked on Introspecting?
Related Questions in ROW-LEVEL-SECURITY
- Get embedded url of pbix power bi report that has paginated rdl report inside it
- Power BI Embedded with Row-Level Security
- What happens to RLS when join tables (Bigquery)
- Unable to set RLS in Power BI based on another table
- Two Separate Row Level Security Rules for 1 Role
- Row Level Security in Bigquery
- Measure results disappear when row level security is applied in Power BI
- Force row level security in postgres
- supabase postgress roles error in flutter
- Proper way to query table for RLS
- Bigquery tables get data API returning Access Denied
- RLS - Custom "No access" message (Power BI)
- supabase database functions and RLS
- implementing RLS policy based on criteria (country, organization) in users table
- SSAS/Power BI Row Level Security
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)