Subject Re: [Firebird-general] Create table with different ownership
Author Mark Rotteveel
On 17-4-2015 15:42, Dimitry Sibiryakov sd@...
[Firebird-general] wrote:
> Hello, All.
>
> Is there in SQL standard a way to create database object as owned by different user or
> to transfer ownership to a different user?
>

A quick scan of the standard seems to indicate that ownership is handled
per schema and not per table. They sometimes refer to the "owner of a
table" but this is inherited from the ownership of the schema.

Specifically it says (SQL:2011 Foundation, 4.21 SQL-Schemas):
"
An SQL-schema is a persistent descriptor that includes:
— The name of the SQL-schema.
— The <authorization identifier> of the owner of the SQL-schema.
— The name of the default character set for the SQL-schema.
— The <schema path specification> defining the SQL-path for SQL-invoked
routines for the SQL-schema.
— The descriptor of every component of the SQL-schema.
In this part of ISO/IEC 9075, the term “schema” is used only in the
sense of SQL-schema. The persistent objects described by the descriptors
are said **to be owned by or to have been created by the <authorization
identifier> of the schema**.
"

In other words, according to the SQL standard the owner of the table is
the owner of the schema it is created in. There is no other transfer of
ownership than transferring ownership of the schema.

Mark
--
Mark Rotteveel