claud9
08/19/2021, 8:17 PMPGP_SYM_ENCRYPT
or have any examples?dailylurker
08/20/2021, 12:16 AMScott P
08/20/2021, 12:42 AMadmin_id
set to auth.uid()
and then inserts the other values in the same row - sort of like modifying it in-place before committing the transaction to the DB.
Another option is to put the other values from new
into the query: e.g. INSERT INTO public.my_table(admin_id, some_string, some_number) VALUES (auth.uid(), new.some_string, new.some_number)
.
Another option which might work would be to set the column default to auth.uid()
. That way, whenever a new row is inserted, it'll automatically set the value of the admin_id
column to auth.uid()
.dailylurker
08/20/2021, 2:17 AMquicksnap
08/20/2021, 4:41 AMt1.blah_blah
and I wanted to use that column in a subquery who also had a column of the same name (... where foo.blah_blah = blah_blah
). Instead of warning me, it just used the unqualified name from foo
.. which is always true, and really tripped me up.quicksnap
08/20/2021, 4:43 AMwith
clause. Here's my redacted SQL: USING (
-- .. snip ..
and
user_id in (
with foo as (select blah_blah)
select
owner_id
from
wave_blips wb,
foo
where
wb.blah_blah = foo.blah_blah
and
wb.owner_id = user_id
)
quicksnap
08/20/2021, 4:43 AMquicksnap
08/20/2021, 4:43 AMquicksnap
08/20/2021, 4:44 AMraise notice
or whatever, and there's no way to "run" a policy other than using itburggraf
08/20/2021, 3:20 PMquicksnap
08/20/2021, 6:03 PMMrWolf
08/21/2021, 2:22 AMPeanut
08/21/2021, 11:21 AMtable "mysuperspecialtable"
id: TEXT = 'activeUsers',
value: JSONB =
{
"activeUserId": "abcdef"
}
Something like:
SELECT
username,
avatarurl
FROM mysuperspecialtable
LEFT JOIN users ON users.id = (mysuperspecialtable.value ->> 'activeUserId')::TEXT
WHERE
mysuperspecialtable.id = 'activeUsers'
How do I grab the user's record using that property? I have tried everything I can think of
(Some context is I am converting Firestore to PostgreSQL and I stored some references to docs in an array)Peanut
08/21/2021, 3:16 PMThePhilip
08/21/2021, 6:29 PMsumchans
08/22/2021, 7:58 PM'%91960000000’,’%7780000000',’%6720000000',’%4160000000','%7780000000'
. With this query I am not getting any errors, but I am supposed to get two records returned, but I get a blank array returned. final results = await postgresConnection.query(
"SELECT display_name,phone_number FROM public.users WHERE phone_number LIKE (@contacts)",
substitutionValues: {"contacts": contacts});
Olyno
08/22/2021, 10:22 PMsumchans
08/22/2021, 10:23 PMsumchans
08/22/2021, 10:23 PMsumchans
08/22/2021, 10:23 PMdailylurker
08/23/2021, 2:21 PMsumchans
08/23/2021, 10:55 PMburggraf
08/24/2021, 12:52 AMjason-lynx
08/24/2021, 1:39 AMLIKE
with IN
?jason-lynx
08/24/2021, 1:40 AMjason-lynx
08/24/2021, 1:43 AMWHERE phone_number LIKE '%(@contacts)%'
?sumchans
08/24/2021, 1:47 AMsumchans
08/24/2021, 1:49 AMjason-lynx
08/24/2021, 1:51 AMsumchans
08/24/2021, 2:04 AM