This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-11-06
Channels
- # announcements (5)
- # asami (4)
- # babashka (27)
- # beginners (1)
- # calva (4)
- # cider (64)
- # clj-kondo (7)
- # clojure (7)
- # clojure-brasil (3)
- # clojure-europe (41)
- # clojure-france (2)
- # clojure-norway (101)
- # clojure-uk (5)
- # clojurescript (19)
- # cursive (3)
- # datahike (15)
- # datomic (15)
- # events (2)
- # honeysql (11)
- # hyperfiddle (27)
- # introduce-yourself (2)
- # jobs-rus (1)
- # leiningen (8)
- # london-clojurians (1)
- # lsp (175)
- # off-topic (52)
- # overtone (10)
- # portal (15)
- # re-frame (7)
- # reagent (1)
- # releases (1)
- # remote-jobs (2)
- # shadow-cljs (15)
- # sql (5)
help with migratus early feedback program anyone? We are working on some quality of life improvements for migratus + devops . We have some early work and would like some feedback . The PR is here https://github.com/yogthos/migratus/pull/252 . You should check out the guide https://github.com/yogthos/migratus/blob/3af6f4f9564b6e74970578d5913c008ab08decc6/examples/postgres/README.md What you can expect: • usage via cli even from babashka task • configuration via ENV, config file, etc • basic config and cli validation • status and list commands for migrations Everything is in progress, but if you do try it out, leave some comments on the PR. Thanks, cc @yogthos
Postgres: I want to clone a table (including a. data and b. constraints/indexes/defaults etc)
I've narrowed it down to:
1. CREATE TABLE x_clone LIKE x INCLUDING ALL
, which takes care of b but not a
2. CREATE TABLE x_clone AS x
, which takes care of a but not b
What's the best way to combine them? Run 1 and then INSERT INTO
the data row by row or run 2 first and add any schema-related stuff later? Happy to be told there's a third, better way 🙂
The table is smallish (much less than 1M rows) but the indexes are complex
Cloning the data row by row in not necessarily. You just insert from select:
insert into table_b select * from table_a
Oh, that's nice
So is that what you'd recommend?
CREATE TABLE x_clone LIKE x INCLUDING ALL
, followed by insert into x_clone select * from x
?