Query database owner in Firebird 2.5?

305 views
Skip to first unread message

Wavey Maple

unread,
Mar 14, 2022, 10:42:52 PM3/14/22
to firebird...@googlegroups.com
Hi all,

I am writing up some transition documentation from Firebird 2.5 to v3.0, and I want to know how to query the database owner. There used to be content here:
but it appears to have been wiped and I cannot remember what was written there.

I can see that MON$OWNER was added to the MON$DATABASE table in v3.0:
https://github.com/FirebirdSQL/firebird/issues/4543
however I need to know how to get it in FB2.5. This can be through ISQL or gsec or any mechanism.

Thanks in advance for the help on this old stuff!
David

Wavey Maple

unread,
Mar 14, 2022, 11:00:26 PM3/14/22
to firebird...@googlegroups.com
Apologies...I wrote that too soon as I dredged old code and believe I found the answer:

SQL> SELECT DISTINCT RDB$OWNER_NAME AS DATABASE_OWNER FROM RDB$RELATIONS WHERE(RDB$SYSTEM_FLAG = 1);

DATABASE_OWNER

========================================================================

XXXXXXX


If this is correct, sorry for the noise but at least this can serve as a reference for anyone searching this group. If wrong, please let me know.

Thanks,
David

Martijn Tonies (Upscene Productions)

unread,
Mar 15, 2022, 4:10:44 AM3/15/22
to firebird...@googlegroups.com
Yes, this works fine.
 
With regards,

Martijn Tonies
Upscene Productions
https://www.upscene.com

Database Workbench - developer tool for Oracle, SQL Server, PostgreSQL, MySQL, InterBase, NexusDB and Firebird.
--
You received this message because you are subscribed to the Google Groups "firebird-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-suppo...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/firebird-support/CANNHrU7vBT31rdkztvXEyERRu%3DttuJwJtMLyOuHhm_JSC8LMjw%40mail.gmail.com.

Mark Rotteveel

unread,
Mar 15, 2022, 4:16:22 AM3/15/22
to firebird...@googlegroups.com
On 2022-03-15 03:42, Wavey Maple wrote:
> I am writing up some transition documentation from Firebird 2.5 to
> v3.0, and I want to know how to query the database owner. There used
> to be content here:
> http://www.firebirdfaq.org/faq108/
>
> but it appears to have been wiped and I cannot remember what was
> written there.

Tip: use the Wayback Machine from the Internet Archive:

https://web.archive.org/web/20210813161051/https://firebirdfaq.org/faq108/

It suggests to query the owner(s) of the system tables:

SELECT DISTINCT RDB$OWNER_NAME AS DATABASE_OWNER
FROM RDB$RELATIONS
WHERE (RDB$SYSTEM_FLAG = 1);

Mark

Stefan Heymann

unread,
Mar 15, 2022, 4:23:38 AM3/15/22
to firebird...@googlegroups.com
This here works as well and shouldn't be as expensive as the SELECT DISTINCT:

select first 1 rdb$owner_name from rdb$relations where rdb$relation_name = 'RDB$DATABASE'


Regards

Stefan



----- Ursprüngliche Nachricht / Original Message -----
Von/From: Wavey Maple <wavey...@gmail.com>
Gesendet/Date: 15.03.2022 04:00
An/To: firebird...@googlegroups.com <firebird...@googlegroups.com>
Betreff/Subject: [firebird-support] Re: Query database owner in Firebird 2.5?

Dmitry Yemanov

unread,
Mar 15, 2022, 4:29:04 AM3/15/22
to firebird...@googlegroups.com
15.03.2022 11:23, Stefan Heymann wrote:

> This here works as well and shouldn't be as expensive as the SELECT DISTINCT:
>
> select first 1 rdb$owner_name from rdb$relations where rdb$relation_name = 'RDB$DATABASE'

Correct, although "FIRST 1" is redundant as RDB$RELATION_NAME is a
unique key ;-)


Dmitry
Reply all
Reply to author
Forward
0 new messages