Slide 44
Slide 44 text
E.1.3.5. Data Types
● マルチレンジ型の使用例 (1)
CREATE TABLE rooms (no text primary key, reserved datemultirange);
CREATE TABLE
Table "public.rooms"
Column | Type | Collation | Nullable | Default
----------+----------------+-----------+----------+---------
no | text | | not null |
reserved | datemultirange | | |
Indexes:
"rooms_pkey" PRIMARY KEY, btree (no)
INSERT INTO rooms VALUES
('101', datemultirange(
daterange('2021-09-01', '2021-09-02', '[]'), daterange('2021-09-07', '2021-09-09')) ),
('201', datemultirange(
daterange('2021-09-03', '2021-09-05', '[]')) )
;
INSERT 0 2
daterange() は
従来の範囲型生成関数