Upgrade to Pro — share decks privately, control downloads, hide ads and more …

沖縄観光とPostgreSQL排他制約の話

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on.
Avatar for nikawa2161 nikawa2161
December 28, 2025

 沖縄観光とPostgreSQL排他制約の話

Avatar for nikawa2161

nikawa2161

December 28, 2025
Tweet

More Decks by nikawa2161

Other Decks in Technology

Transcript

  1. CREATE EXTENSION btree_gist; CREATE TABLE room_reservations ( room_name text, check_in

    timestamp, check_out timestamp ); ALTER TABLE room_reservations ADD CONSTRAINT no_overlapping_reservations EXCLUDE USING gist ( room_name WITH =, tsrange(check_in, check_out) WITH && );
  2. &&

  3. gist ( room_name WITH =, tsrange(check_in, check_out) WITH && );

    room_name WITH = tsrange(check_in, check_out) WITH &&