I am trying to call a function called account.user_available_sel
in PostgreSQL 13 which returns a table of data. It is very simple like this:
SELECT * FROM account.user_available_sel(_email => 'email@xxx.xxx');
The SELECT *
part returns back the entire table of data which includes the user's email, password, forename, surname. dob
etc.
Because this is only supposed to check if an email
has not already been registered, I only want to return a simple value like invalid
if a record exists. In my mind something like this (obviously does not work):
SELECT 'invalid' FROM account.user_available_sel(_email => 'email@xxx.xxx');
How could I just return that string instead of the entire recordset?