Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9348585
15-flavor.sql
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
984 B
Subscribers
None
15-flavor.sql
View Options
-- database flavor
create
type
database_flavor
as
enum
(
'default'
,
-- default: full index availability for deduplication and read queries
'mirror'
,
-- mirror: reduced indexes to allow for out of order insertions
'read_replica'
-- read replica: minimal indexes to allow read queries
);
comment
on
type
database_flavor
is
'Flavor of the current database'
;
create
table
dbflavor
(
flavor
database_flavor
,
single_row
char
(
1
)
primary
key
default
'x'
,
check
(
single_row
=
'x'
)
);
comment
on
table
dbflavor
is
'Database flavor storage'
;
comment
on
column
dbflavor
.
flavor
is
'Database flavor currently deployed'
;
comment
on
column
dbflavor
.
single_row
is
'Bogus column to force the table to have a single row'
;
create
or
replace
function
swh_get_dbflavor
()
returns
database_flavor
language
sql
stable
as
$$
select
coalesce
((
select
flavor
from
dbflavor
),
'default'
);
$$
;
comment
on
function
swh_get_dbflavor
is
'Get the flavor of the database currently deployed'
;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Jul 4 2025, 6:38 PM (5 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3240878
Attached To
rDSTO Storage manager
Event Timeline
Log In to Comment