1

In PostgreSQL v11, Difference between SELECT function() and CALL procedure? If I select a procedure this errore is returned:

ERROR: public.delete() is a procedure To call a procedure, use CALL.

5
  • What about the error message or behavior surprises you? Commented May 13, 2019 at 10:18
  • Hi @TimBiegeleisen, usually I use SELECT statement, not CALL Commented May 13, 2019 at 10:19
  • there is a difference between sql functions that can be used for example in select clauses, these simply format or manipulate the selected column data. Stored procedures on the other hand cannot be selected only called as they are not functions but procedures (which have side-effects and so on..) Commented May 13, 2019 at 10:20
  • see here dba.stackexchange.com/questions/194684/…, and dba.stackexchange.com/questions/2357/… Commented May 13, 2019 at 10:23
  • select is for functions, call is for procedures Commented May 13, 2019 at 10:24

1 Answer 1

1

The procedure can not be SELECTed. Note following basic difference between procedure and function.

 - In PostgreSQL 11, PROCEDURE was added
 - Functions return value but procedures does not return values
 - Transaction can be crated inside procedure and not inside function
Sign up to request clarification or add additional context in comments.

1 Comment

Transaction can be crated inside procedure and not inside function - I don't get what do you mean, in function there is possible creating transaction.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.