© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
8 replies
Greg

Failed to run sql query missing FROM-clause entry for table new

Hi, When trying to run this function i get the error in the title and im not sure where i am going wrong
create or replace function createticket("auth" text, "ticketname" text, "issuetype" text, "devicetype" text ,"issuedetails" text, "priority" text)
returns void
language plpgsql
security definer set search_path = public
as $$
BEGIN
  IF  (checkifauth(auth)) THEN
    insert into public.tickets (id, ticketname, issuetype, devicetype, issuedetails,priority)
     values (new.id,new.ticketname,new.issuetype,new.devicetype,new.issuedetails,new.priority);
  END IF;
  END;
$$
create or replace function createticket("auth" text, "ticketname" text, "issuetype" text, "devicetype" text ,"issuedetails" text, "priority" text)
returns void
language plpgsql
security definer set search_path = public
as $$
BEGIN
  IF  (checkifauth(auth)) THEN
    insert into public.tickets (id, ticketname, issuetype, devicetype, issuedetails,priority)
     values (new.id,new.ticketname,new.issuetype,new.devicetype,new.issuedetails,new.priority);
  END IF;
  END;
$$


and this is my other function incase that has issues

BEGIN
  IF EXISTS (select authkey from public.userprofile where authkey::text = auth) THEN
  return true;
  else return false;
  END IF;
  END;
BEGIN
  IF EXISTS (select authkey from public.userprofile where authkey::text = auth) THEN
  return true;
  else return false;
  END IF;
  END;



and this is thw query i run

 select createticket('0d06829a-d271-4dde-b69a-6d16a2254143','test','test','test','test','test');
 select createticket('0d06829a-d271-4dde-b69a-6d16a2254143','test','test','test','test','test');
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

missing FROM-clause entry for table "new"
SupabaseSSupabase / help-and-questions
4mo ago
Failed to run SQL query
SupabaseSSupabase / help-and-questions
4y ago
'Failed to run sql query column 'where clause argument' does not exist'
SupabaseSSupabase / help-and-questions
4y ago
Failed to delete creator_roles: Failed to run sql query: Query read timeout
SupabaseSSupabase / help-and-questions
4w ago