ThePhilip
07/04/2022, 2:20 PMRegeX
07/04/2022, 2:28 PMgaryaustin
07/04/2022, 2:29 PMsilentworks
07/04/2022, 4:01 PMSalvage_Dev
07/04/2022, 4:42 PMSteve
07/04/2022, 7:00 PMdipankarmaikap
07/05/2022, 11:07 AMbegin
insert into public.profiles (id, email, name, location, confirmed_at)
values (new.id, new.email, new.raw_user_meta_data->> 'name', new.raw_user_meta_data->> 'location', new.email_confirmed_at);
return new;
end;
Hey I have this sql function when new user signs up it creates a profile for each. Its working but the confirmed_at field is not updating i dont know why, i tried new.email_confirmed_at
and new.confirmed_at
silentworks
07/05/2022, 1:29 PM! Do you even Vim, bro?
07/05/2022, 10:01 PMsets
and queries
. Maybe they're the things I desperately need. I don't know! 🙏
sql
create or replace function get_random_prices()
returns table (item_id int, value int)
as $$
declare
random_prices table (item_id int, value int);
begin
select id, floor(random() * (max_value - min_value + 1) + min_value)
insert into random_prices
as value
from prices_ranges; -- private table, no policies set
return random_prices;
end
$$ language plpgsql;
garyaustin
07/06/2022, 12:23 AMchipilov
07/06/2022, 12:28 PMBigJ
07/07/2022, 8:11 AMBigJ
07/07/2022, 9:06 AMBigJ
07/07/2022, 9:08 AMbhaskar
07/09/2022, 2:18 AMauth()
inside a view or function and check if auth().role = 'authenticated'
? only authenticated users can read value from column A and if column B is "special value". if column b is "not special value" anyone can read itgaryaustin
07/09/2022, 2:34 AMbhaskar
07/09/2022, 3:10 PMjar
07/10/2022, 5:09 AMselect jsonb_path_query_array('[1,2,7,4,5]'::jsonb, ('$[0 to 2]'));
works
select jsonb_path_query_array('[1,2,7,4,5]'::jsonb, ('$[0 to '||2||']'));
doesnt workjar
07/10/2022, 2:49 PMselect * from jsonb_array_elements('[1,2,7,4,5]'::jsonb) limit 3 offset 2;
jar
07/11/2022, 1:28 AMselect jsonb_path_query_array(
'[6,7,1, 2, 3, 4]',
'$[$min to $max]',
'{"min": '||2||', "max": 3}'
);
weilzuvielgewalt
07/11/2022, 2:02 PMisPremium
which is whether true
or false
. How can I do that?
nearby_studios function (param: location
)
sql
select *
from studios
order by location <-> st_geogfromtext(nearby_studios.location);
I use it like this
js
const { data: studios, error } = await client.rpc('nearby_studios',
{ location: `POINT(${userLocation.longitude} ${userLocation.latitude})` }
)
.limit(50)
.not('street', 'is', null)
.not('city', 'is', null)
2B
07/12/2022, 1:07 AM2B
07/12/2022, 1:11 AMCREATE TABLE example (
a integer,
b integer,
c integer,
UNIQUE (a, c)
);
silentworks
07/12/2022, 1:26 AM2B
07/12/2022, 1:28 AM2B
07/12/2022, 1:29 AM2B
07/12/2022, 1:31 AM//This works
CREATE TABLE example (
a integer,
b integer,
c integer,
UNIQUE (a)
);
// This did not work
CREATE TABLE example (
a integer,
b integer,
c integer,
UNIQUE (a, c)
);
silentworks
07/12/2022, 1:38 AM2B
07/12/2022, 1:47 AMFehmi
07/12/2022, 10:43 AMogr2ogr
from my laptop (basically, I am trying to import a MapInfo TAB into the DB which PostGIS activated) but getting the error below
ERROR 1: ERROR: permission denied for table spatial_ref_sys
I think it is because the spatial_ref_sys
table is owned by supabase_admin
user and my default db user does not have write access to that table. How can I fix this? Thanks