I installed orafce extension on PostgreSQL 9.5. I saw that it is better to create a specific schema for all extensions and that what I did. I connected to template 1 and performed the next commands :
template1=# create schema extensions;
CREATE SCHEMA
template1=# grant usage on schema extensions to public;
GRANT
template1=# grant execute on all functions in schema extensions to public;
GRANT
template1=# alter default privileges in schema extensions grant execute on
functions to public;
ALTER DEFAULT PRIVILEGES
template1=# alter default privileges in schema extensions grant usage on
types to public;
ALTER DEFAULT PRIVILEGES
template1=# create extension orafce schema extensions;
CREATE EXTENSION
template1=# show search_path;
search_path
-----------------
"$user", public
(1 row)
template1=# set search_path="$user",public,extensions;
SET
After that I created a new database test1 and a new user mariel1. In addition I edited postgresql.conf and set the search_path to be "$user",public,extensions.
I connected to the database - psql -d test1 -U mariel1
. Now when I try to use the function sysdate for example the database doesn't recognize the function:
postgres=# select sysdate() from dual;
ERROR: function sysdate() does not exist
LINE 1: select sysdate() from dual;
^
HINT: No function matches the given name and argument types. You might need
to add explicit type casts.
postgres=# select extensions.sysdate() from dual;
ERROR: schema "extensions" does not exist
LINE 1: select extensions.sysdate() from dual;
After some searching I saw that some of the functions available under other schemas like oracle, utl_file and more. I want to understand why the functions of orafce (oracle.sysdate etc...) created under different schemas (oracle,utl_file..) and not under my new schema extensions.