Ā© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
3 replies
Adam Ambrosius

relation 'public.table_name' does not exist

I am unable to fetch data from my table while running locally. It does work once deployed though. I have logged my
SUPABASE_URL
SUPABASE_URL
and
SUPABASE_ANON_KEY
SUPABASE_ANON_KEY
and those are populated successfully. I only have one project, I have linked it and am running
supabase start
supabase start
,
supabase functions serve function-name
supabase functions serve function-name
.
Here is the only code that is being executed which is modeled directly off of the examples provided.
import { createClient } from "https://esm.sh/@supabase/supabase-js@^1.33.2";

export const supabaseClient = createClient(
  // Supabase API URL - env var exported by default when deployed.
  Deno.env.get("SUPABASE_URL") ?? "",
  // Supabase API ANON KEY - env var exported by default when deployed.
  Deno.env.get("SUPABASE_ANON_KEY") ?? ""
);
import { createClient } from "https://esm.sh/@supabase/supabase-js@^1.33.2";

export const supabaseClient = createClient(
  // Supabase API URL - env var exported by default when deployed.
  Deno.env.get("SUPABASE_URL") ?? "",
  // Supabase API ANON KEY - env var exported by default when deployed.
  Deno.env.get("SUPABASE_ANON_KEY") ?? ""
);

import { serve } from "https://deno.land/std@0.131.0/http/server.ts";
import { supabaseClient } from "../_shared/supabaseClient.ts";

serve(async (req) => {
  console.log(Deno.env.get("SUPABASE_URL") ?? "");
  console.log(Deno.env.get("SUPABASE_ANON_KEY") ?? "");
  const { data, error } = await supabaseClient.from("positions").select("*");

  console.log({ data, error });

  return new Response(JSON.stringify(data), {
    headers: { "Content-Type": "application/json" },
  });
});
import { serve } from "https://deno.land/std@0.131.0/http/server.ts";
import { supabaseClient } from "../_shared/supabaseClient.ts";

serve(async (req) => {
  console.log(Deno.env.get("SUPABASE_URL") ?? "");
  console.log(Deno.env.get("SUPABASE_ANON_KEY") ?? "");
  const { data, error } = await supabaseClient.from("positions").select("*");

  console.log({ data, error });

  return new Response(JSON.stringify(data), {
    headers: { "Content-Type": "application/json" },
  });
});


What do I need to do so that I can execute this locally?
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

relation \"public.undefined\" does not exist supabase table
SupabaseSSupabase / help-and-questions
3y ago
relation "public.users" does not exist
SupabaseSSupabase / help-and-questions
3y ago
42P01 relation public.profiles does not exist
SupabaseSSupabase / help-and-questions
4y ago
relation does not exist
SupabaseSSupabase / help-and-questions
4y ago