r/SQL • u/Rare-Ad6166 • Jun 30 '26
PostgreSQL Anybody that can help me with this is a pro
In pg admin, to import manually you need to create a table with the exact same columns for it to successfully import a file. But situations with JOIN function has different set of tables and different set of columns so it doesn’t exactly match the column thats in the file. This makes it impossible to create tables that requires importation. How do you fix this?
0
Upvotes
37
u/alinroc SQL Server DBA Jun 30 '26
Import into a staging table that matches your file.
Then write the query(ies) to transform and load that data from that staging table into the tables that your application uses.
This is a standard ETL pattern.
4
u/dwswish Jun 30 '26
RIP stack overflow
0
u/[deleted] Jun 30 '26
[deleted] — view deleted comment
0
u/[deleted] Jun 30 '26
[deleted] — view deleted comment