{"title":"PostgreSQL \u3067 mySQL \u306e last_insert_id() \u76f8\u5f53\u3092mybatis \u3067\u5b9f\u88c5\u3057\u305f\u3044","provider_name":"Hatena Blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Foboe2uran.hatenablog.com%2Fentry%2F2022%2F05%2F01%2F003000\" title=\"PostgreSQL \u3067 mySQL \u306e last_insert_id() \u76f8\u5f53\u3092mybatis \u3067\u5b9f\u88c5\u3057\u305f\u3044 - Oboe\u5439\u304d\u30d7\u30ed\u30b0\u30e9\u30de\u306e\u9ed9\u793a\u9332\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","blog_title":"Oboe\u5439\u304d\u30d7\u30ed\u30b0\u30e9\u30de\u306e\u9ed9\u793a\u9332","categories":["SQL","mybatis"],"type":"rich","description":"PostgreSQL \u306e CURVAL() \u3084\u3001LASTVAL() \u3067\u3001\u30b7\u30fc\u30b1\u30f3\u30b9\u304b\u3089\u6c42\u3081\u3089\u308c\u308b\u3082\u306e\u3067\u306f\u306a\u304f\u3001 UUID \u306e\u3088\u3046\u306a\u578b\u3067 Primary Key \u3092\u69cb\u6210\u3059\u308b\u30c6\u30fc\u30d6\u30eb\u633f\u5165\u76f4\u5f8c\u306e\u30ad\u30fc\u3092\u53d6\u5f97\u3057\u305f\u3044\u3002RETURNING \u3092\u4f7f\u3046\u3002insert\u6587\u306e\u6b21\u306e\u66f8\u5f0f INSERT INTO \u30c6\u30fc\u30d6\u30eb VALUES (...) RETURNING PK\u306eID INTO last_id; \u3067 INSERT\u6587\u5b9f\u884c\u3067\u6c42\u3081\u308b\u3002\u4f8b\uff09UUID\u81ea\u52d5\u30e9\u30f3\u30c0\u30e0\u95a2\u6570\u3092 DEFAULT \u306b\u6301\u3064\u30c6\u30fc\u30d6\u30eb CREATE TABLE public.taskitems ( id uuid NOT NULL DEFAULT gen_r\u2026","height":"190","width":"100%","published":"2022-05-01 00:30:00","url":"https://oboe2uran.hatenablog.com/entry/2022/05/01/003000","author_name":"posturan","blog_url":"https://oboe2uran.hatenablog.com/","provider_url":"https://hatena.blog","version":"1.0","image_url":null,"author_url":"https://blog.hatena.ne.jp/posturan/"}