Home

Call a Postgres function

Perform a function call.

You can call Postgres functions as Remote Procedure Calls, logic in your database that you can execute from anywhere. Functions are useful when the logic rarely changes—like for password resets and updates.

create or replace function hello_world() returns text as $$
  select 'Hello world';
$$ language sql;
Parameters
  • fn
    REQUIRED
    FunctionName

    The function name to call

  • args
    Optional
    object

    The arguments to pass to the function call

  • options
    Optional
    object

    Named parameters


const { data, error } = await supabase.rpc('hello_world')