You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Myrna van Lunteren <m....@gmail.com> on 2005/06/07 20:44:44 UTC

Re: q re schemas

Hi Peter,
 Firstly, the derby-dev is intended for developers working on 
changing/fixing the derby source code. These questions you're asking 
currently are better served at the derby-user@db.apache.org list. Unless 
you're volunteering to fix the code for DERBY-85? In that case, I misread 
your intentions.
 - how to see owner of a table
Did you see the manuals? There's a tab for them right at the apache derby 
home page... 
The reference guide shows the system tables.
To see ownership of tables, join sys.tables & sys.schemas, e.g. like this:
select tablename, schemaname from sys.sysschemas, sys.systables where 
sys.sysschemas.schemaid = sys.systables.schemaid.
That would show you what users created which table.
 - ...who's the owner?.....
You cannot have a database without a default schema. Derby uses 'APP' as the 
default schema if there is no other schemaname set. If you logged in using a 
certain username, then that becomes the assumed schemaname for that session. 
If you create another schema, that does nothing to change the ownership of 
objects created, but if you set the schema to the newly created schema, or 
create a table with the schemaname specified, then the table sits in that 
schema. 
 So, for instance, if you log in using 'user', anything you create will be 
in schema 'user', unless you do "create schema xuser" followed by "set 
schema xuser", or connect using xuser, or "create table xuser.<tablename>" 
 Hope this helps.
Myrna
 On 6/7/05, Peter Nabbefeld <Pe...@gmx.de> wrote: 
> 
> 
> I've just begun to use derby, so I don't currently know how to check for
> the user of a table. What I'd like to know is: When I'm using a database 
> without default schema, just creating a schema in a different schema and
> inserting a row - who's the owner? Just to make it clear, assume the
> username is "user", the schema is "xuser" - will the owner be "user" or 
> "xuser"?
> 
> Regards,
> Peter
> 
> 
> Dyre.Tjeldvoll@Sun.COM schrieb:
> 
> > [...]
> >
> 
>