{"type":"rich","author_name":"ingnis","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.ingage.jp%2Fentry%2F2022%2F04%2F19%2F173218\" title=\"0\u57cb\u3081\u3055\u308c\u3066\u3044\u306a\u3044\u6570\u5b57\u6587\u5b57\u5217\u3092\u30bd\u30fc\u30c8\u3057\u305f\u3044 - \u30a4\u30f3\u30b2\u30fc\u30b8\u958b\u767a\u8005\u30d6\u30ed\u30b0\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","image_url":null,"height":"190","categories":["\u30d0\u30c3\u30af\u30a8\u30f3\u30c9"],"provider_url":"https://hatena.blog","title":"0\u57cb\u3081\u3055\u308c\u3066\u3044\u306a\u3044\u6570\u5b57\u6587\u5b57\u5217\u3092\u30bd\u30fc\u30c8\u3057\u305f\u3044","author_url":"https://blog.hatena.ne.jp/ingnis/","blog_title":"\u30a4\u30f3\u30b2\u30fc\u30b8\u958b\u767a\u8005\u30d6\u30ed\u30b0","published":"2022-04-19 17:32:18","description":"\u3069\u3046\u3082\u3001\u306b\u3057\u3080\u3089\u3067\u3059\u3002\u4eca\u56de\u306fRails5.2 PostgreSQL\u306e\u8a71\u3067\u3059\u3002 messages \u30c6\u30fc\u30d6\u30eb \u306b \u6587\u5b57\u578b str_id \u306b\u6570\u5b57\u304c0\u57cb\u3081\u306a\u3057\u3067\u4fdd\u5b58\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30bd\u30fc\u30c8\u3055\u308c\u307e\u3059\u3002 select * from messages order by str_id; id | str_id ----+------- 50 | 1000 47 | 110 46 | 12 \u3053\u306e\u5834\u5408\u3001lpad\u3092\u4f7f\u3063\u30660\u57cb\u3081\u306e\u6587\u5b57\u5217\u306b\u5909\u63db\u3059\u308b\u3053\u3068\u3067\u6b63\u3057\u304f\u4e26\u3073\u66ff\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 lpad(str_id, 5, '0') str_id \u3092 5\u6841\u306e\u6570\u5b57\u306b\u3057\u3066\u6841\u304c\u8db3\u308a\u306a\u3044\u5834\u5408\u306f\u5de6\u7aef\u304b\u3089 0 \u3067\u57cb\u3081\u308b sel\u2026","provider_name":"Hatena Blog","url":"https://blog.ingage.jp/entry/2022/04/19/173218","blog_url":"https://blog.ingage.jp/","width":"100%","version":"1.0"}