1

So basiclly i want to create a computed field which is very basic, Get the full name from the database.

CREATE FUNCTION author_full_name(user_row users)
RETURNS TEXT AS $$
  SELECT user_row.firstName || ' ' || user_row.lastName
$$ LANGUAGE sql STABLE;

Here is the users table: users id int, firstName text, lastName text

db ss: https://ibb.co/gm1xzK2

I always end up with this error : "SQL Execution Failed no schema has been selected to create in. null"

Lord Zeus
  • 35
  • 1
  • 4

1 Answers1

1

You need to either fully qualify the schema where the function should be created eg public.author_full_name or update the search path in Postgres so that it defaults to a schema (public or otherwise)

See the answer here https://stackoverflow.com/a/41207765/1364771

Jesse Carter
  • 17,976
  • 7
  • 55
  • 87