DEV Community

AntDB
AntDB

Posted on

AntDB-Oracle Compatibility Developer's Manual P4–11

Data Object Naming Parsing

Database objects in SPL programs can be referenced by either qualified or unqualified names. A qualified name is of the form schema.name, where schema is the name of the schema to which the database object belongs with the identifier "name". Unqualified names do not have a "schema." part. When a reference is made to a qualified name, there is no ambiguity in the reference to the object, which either exists or does not exist in the specified schema.

If you use an unqualified name to locate an object, you will be asked to use the current user's search path. When a user becomes the current user of a session, the default search path is used to associate with this user. The search path consists of a list of patterns, and the search order is left-to-right when locating references to data objects with unqualified names. If the corresponding object is not found in all schemas of the search path, it is assumed that the object does not exist. The SHOW search_path command can be used in PSQL to display the default search path.

SHOW search_path;
search_path
----------------------
$user,public,sys,dbo
(1 row)
Enter fullscreen mode Exit fullscreen mode

In the search path shown above, $user is a normal placeholder for the current session user, so if the current user in the session above is AntDB. Then search for a database object with an unqualified name in the following order in the following schema-first AntDB, then public, then sys, and finally dbo.

When an unqualified database object name can be resolved on the search path, it is possible to confirm whether the current user has permission to perform the corresponding operation on the specified object.

Note: The concept of search paths is not compatible with Oracle. For an unqualified reference, Oracle only searches for the relevant named database object in the current user's schema. It is also important to note that in Oracle, a user and the schema to which they belong belong belong to the same entity, however, in AntDB, the user and the schema belong to two different objects.

Top comments (0)