Β© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabaseβ€’4y agoβ€’
5 replies
infinity-books.xyz

issues with sql query

Hi there,

I have some trouble figuring out this error message on my client (browser) console:

{
  "code": "42703",
  "details": null,
  "hint": "There is a column named \"post_id\" in table \"content\", but it cannot be referenced from this part of the query.",
  "message": "column \"post_id\" does not exist"
}
{
  "code": "42703",
  "details": null,
  "hint": "There is a column named \"post_id\" in table \"content\", but it cannot be referenced from this part of the query.",
  "message": "column \"post_id\" does not exist"
}


This occurs after calling this function using RPC:

CREATE OR REPLACE FUNCTION public.create_content_parts(parts json[])
RETURNS void AS $$
  DECLARE
    array_len int;
  BEGIN
    array_len := array_length(parts, 1);
    FOR i IN 1..array_len
    LOOP
      insert into content(post_id, body, type, index)
      values (parts[i]->post_id, parts[i]->body, parts[i]->type, parts[i]->index);
    END LOOP;
  END
$$ LANGUAGE plpgsql SECURITY DEFINER;
CREATE OR REPLACE FUNCTION public.create_content_parts(parts json[])
RETURNS void AS $$
  DECLARE
    array_len int;
  BEGIN
    array_len := array_length(parts, 1);
    FOR i IN 1..array_len
    LOOP
      insert into content(post_id, body, type, index)
      values (parts[i]->post_id, parts[i]->body, parts[i]->type, parts[i]->index);
    END LOOP;
  END
$$ LANGUAGE plpgsql SECURITY DEFINER;


The table has a post_id (int8) column setup, all other columns exist as well. Any ideas what maybe wrong here?

Thanks in advance.
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

Error SQL query
SupabaseSSupabase / help-and-questions
7mo ago
SQL query help
SupabaseSSupabase / help-and-questions
4y ago
SQL to Supabase query
SupabaseSSupabase / help-and-questions
3y ago
How to write out query with supabase sql
SupabaseSSupabase / help-and-questions
3y ago