CURRENT_PATH
CURRENT_PATH is a SQL built-in function that returns a string representing the current path for the SQL session. This path includes the hierarchy of the folder structure from which the SQL session is operating. The function requires no parameters and is specific to the session's current context.
Example
Output
Explanation
The CURRENT_PATH
function in PostgreSQL returns the current search path, which is a list of schemas that the system uses to locate tables, views, functions, and other database objects. In the returning example "$user", public
, the search path indicates that the system will first look for objects in the user’s schema (represented by the $user
), and then in the public
schema.