FK Constraint with ON DELETE SET DEFAULT cascading as table owner

2019-02-01 Thread David G. Johnston
On Friday, February 1, 2019, rob stone wrote: > Hello, > > On Fri, 2019-02-01 at 14:01 +, Brad Leupen wrote: > > CREATE TABLE foo ( > > tenant TEXT REFERENCES tenant NOT NULL DEFAULT user, > > > This script winds up failing because the “user” default value on > > foo.tenant evaluates to t

Re: FK Constraint with ON DELETE SET DEFAULT cascading as table owner

2019-02-01 Thread rob stone
Hello, On Fri, 2019-02-01 at 14:01 +, Brad Leupen wrote: > Hello, > > We are using RLS on Postgres 11 to implement multi tenancy in our > application. We have a tenant table whose id matches the tenant’s > user role. Each table has a tenant_id FKA that defaults to > “current_user”. All of ou

FK Constraint with ON DELETE SET DEFAULT cascading as table owner

2019-02-01 Thread Brad Leupen
Hello, We are using RLS on Postgres 11 to implement multi tenancy in our application. We have a tenant table whose id matches the tenant’s user role. Each table has a tenant_id FKA that defaults to “current_user”. All of our foreign key constraints are multipart (tenant_id + row_id). So far thi