### 1. RDS作成
まず、RDSでpostgreSQLを作成し、EC2から接続してデータを挿入します。
$ psql -h xxxxxx.*.ap-northeast-1.rds.amazonaws.com -U root -d postgres
CREATE TABLE playground (
equip_id serial PRIMARY KEY,
type varchar (50) NOT NULL,
color varchar (25) NOT NULL,
location varchar(25) check (location in ('north', 'south', 'west', 'east', 'northeast', 'southeast', 'southwest', 'northwest')),
install_date date
);
INSERT INTO playground (type, color, location, install_date) VALUES ('slide', 'blue', 'south', '2022-04-28');
INSERT INTO playground (type, color, location, install_date) VALUES ('swing', 'yellow', 'northwest', '2022-08-16');
postgres=> SELECT * FROM playground;
### 2. snapshotsからrestore
RDSのsnapshotsでsnapshotsを作成し、少し時間を置いてから、restoreを押下します。

するとDB作成時と同じ様な設定画面が表示される。

create databaseをすると元のDBとは別のDBが作成される
### restoreしたRDSに接続
endpointをコピーして、新しいDBの方に接続
$ psql -h xxxxxx.*.ap-northeast-1.rds.amazonaws.com -U root -d postgres
postgres=> SELECT * FROM playground;
equip_id | type | color | location | install_date
———-+——-+——–+———–+————–
1 | slide | blue | south | 2022-04-28
2 | swing | yellow | northwest | 2022-08-16
(2 行)
うおおおおおおおおおおおおおおお
これは凄い
完全に理解した