3 ms·
Temp DB's feel like a slightly underused technique too. (Not saying it's always better.) Ie, just a quick script that adds a serial id as the first column. The
by joshe 4y ago
Temp DB's feel like a slightly underused technique too. (Not saying it's always better.)
Ie, just a quick script that adds a serial id as the first column. Then imports to postgres/mysql based on header names (column names) and file name (becomes table name) to a brand new db.
Usually DBs are so long lived and carefully designed that there's a bit of mental block to just importing trash data and dropping the whole database later. I'm always 15 mins into awk before i remember.
Also in postgres you can do it as a new schema in an existing database, and join with the existing data. Probably safest to not do that in production :-).
Like so:
https://stackoverflow.com/questions/5712387/can-we-join-two-tables-in-postgresql-if-the-tables-are-in-different-schemas https://stackoverflow.com/questions/5712387/can-we-join-two-...
Then just drop the whole schema when you are done screwing around.