8.7. 列舉型別
8.7.1. Declaration of Enumerated Types
CREATE TYPE mood AS ENUM ('sad', 'ok', 'happy');CREATE TYPE mood AS ENUM ('sad', 'ok', 'happy');
CREATE TABLE person (
name text,
current_mood mood
);
INSERT INTO person VALUES ('Moe', 'happy');
SELECT * FROM person WHERE current_mood = 'happy';
name | current_mood
------+--------------
Moe | happy
(1 row)8.7.2. Ordering
8.7.3. Type Safety
8.7.4. Implementation Details
Last updated
Was this helpful?