CURRENT_CATALOG
Example
Section titled “Example”SELECT CURRENT_CATALOG;Output
Section titled “Output”'postgres'Explanation
Section titled “Explanation”The CURRENT_CATALOG command, when run, returns the name of the current database. In the example above, the command returned ‘postgres’, which is the default database used by PostgreSQL.
Example
Section titled “Example”SELECT CURRENT_CATALOG AS 'Current Database';Output
Section titled “Output”Current Database----------------database_nameExplanation
Section titled “Explanation”The CURRENT_CATALOG function in SQL Server returns the name of the current database. The SELECT CURRENT_CATALOG AS 'Current Database' statement retrieves the name of the current database and displays it under the column named ‘Current Database’.