jon.m
10/01/2021, 11:26 PMjon.m
10/01/2021, 11:26 PMdelete from storage.objects where avatar is null (select objects.id, objects.name, avatar from storage.objects left join profiles on profiles.avatar like '%' || objects.name || '%' where bucket_id = 'avatars')
silentworks
10/02/2021, 1:24 AMPeanut
10/02/2021, 4:23 AMPeanut
10/02/2021, 4:24 AMPeanut
10/02/2021, 4:24 AMPeanut
10/02/2021, 4:25 AMPeanut
10/02/2021, 4:41 AMHorseShoe
10/02/2021, 6:33 AMHorseShoe
10/02/2021, 6:34 AMmagicbyt3
10/04/2021, 4:06 PMsql
DROP FUNCTION random_action;
CREATE OR REPLACE FUNCTION random_action()
RETURNS TABLE (
id bigint,
name varchar,
type_name varchar
) AS
$func$
BEGIN
RETURN QUERY(
SELECT actions.id, actions.name, action_type.name as type_name
FROM actions
LEFT JOIN action_type ON (action_type.id = actions.action_type_id)
ORDER BY random()
LIMIT 1
);
END
$func$
LANGUAGE plpgsql;
It is returning a random row as expected, however type_name is always null and I am wondering how I can query this foreign table column. Any help is appreciated. Thanks in advance.Scott P
10/04/2021, 5:05 PMaction_type.id
which matches your actions.action_type_id
, try aliasing the tables:
from actions a
and left join action_type b
Then reference them as ON (b.id = a.action_type_id)
It shouldn't make a difference, but sometimes it can help.sudo killall windows
10/04/2021, 10:34 PMsudo killall windows
10/04/2021, 10:35 PM(1=blankvalueFromInsert)
sudo killall windows
10/04/2021, 10:47 PMSteve
10/04/2021, 10:55 PMsudo killall windows
10/04/2021, 10:55 PMsudo killall windows
10/04/2021, 10:56 PMsudo killall windows
10/04/2021, 10:57 PMsudo killall windows
10/04/2021, 10:58 PMsql
SELECT
raw_user_meta_data->>'provider_id'
from
auth.users
sudo killall windows
10/04/2021, 10:59 PMmagicbyt3
10/05/2021, 12:51 PMHal
10/05/2021, 4:20 PMjason-lynx
10/06/2021, 1:39 AMjason-lynx
10/06/2021, 4:15 AMHal
10/06/2021, 9:27 AMHal
10/06/2021, 9:30 AMJaeden
10/07/2021, 8:18 AMpublic
. I want to enable read access if the public
column is set to true
or if the author_id
column matches the uid.
This is what I have so far when I click on Edit
in the policy for this specific table, but it doesn't seem to work. I'm new to SQL expressions and not sure if this is the way to do it.
(
(true = public)
OR (uid() = author_id)
)
jason-lynx
10/07/2021, 9:05 AM(uid() = author_id OR public)