donpuerto
08/11/2021, 1:34 AMScott P
08/11/2021, 1:49 AM.rpc()
(https://supabase.io/docs/reference/javascript/rpc)
"How to right function here?": https://www.postgresqltutorial.com/postgresql-create-function/Mattyfaz
08/11/2021, 5:00 AM.eq()
?
I've tried passing *
as well as %
but neither seems to work.
Edit: Nevermind - changing them all to ilike()
and %
if there is no value solves it.TheOriginalDude
08/11/2021, 5:18 AMTheOriginalDude
08/11/2021, 5:53 AMsql
CREATE OR REPLACE FUNCTION show_create_table(table_name text, join_char text = E'\n' )
RETURNS text AS
$BODY$
SELECT 'CREATE TABLE ' || $1 || ' (' || $2 || '' ||
string_agg(column_list.column_expr, ', ' || $2 || '') ||
'' || $2 || ');'
FROM (
SELECT ' ' || column_name || ' ' || data_type ||
coalesce('(' || character_maximum_length || ')', '') ||
case when is_nullable = 'YES' then '' else ' NOT NULL' end as column_expr
FROM information_schema.columns
WHERE table_schema = 'public' AND table_name = $1
ORDER BY ordinal_position) column_list;
$BODY$
LANGUAGE SQL STABLE;
SELECT public.show_create_table('Pastes');
This doesn't work either.Riven
08/11/2021, 8:11 AMlaznic
08/11/2021, 9:03 AMnet.http_post
?Enter
08/11/2021, 10:09 AMsilentworks
08/11/2021, 11:49 AMEnter
08/11/2021, 11:52 AMknight
08/11/2021, 12:18 PMknight
08/11/2021, 12:18 PMknight
08/11/2021, 12:20 PMPoypoypoy
08/11/2021, 1:17 PMPoypoypoy
08/11/2021, 1:20 PMShaneTheKing
08/11/2021, 1:20 PMobjects
table that references the user you're trying to delete and if you delete the user the table will be in an invalid state with a broken foreign key reference. You'll need to delete the row from objects
that depends on the user before you can delete the userPoypoypoy
08/11/2021, 1:22 PMPoypoypoy
08/11/2021, 1:23 PMPoypoypoy
08/11/2021, 1:45 PMPoypoypoy
08/11/2021, 2:10 PMPoypoypoy
08/11/2021, 2:38 PMKhan W
08/11/2021, 2:44 PMKhan W
08/11/2021, 2:53 PMGandalfG
08/11/2021, 3:26 PMScott P
08/11/2021, 3:49 PM(auth.role()::TEXT = 'authenticated')
, does it work then?GandalfG
08/11/2021, 3:27 PMGandalfG
08/11/2021, 3:28 PMScott P
08/11/2021, 3:39 PMerror
that you've destructured return anything?GandalfG
08/11/2021, 3:45 PMGandalfG
08/11/2021, 3:45 PM