I have 2 databases one named logs
that has the table:
http_log:
id: serial
method: Varchar(10)
url: varchar(150)
I also have an another database named archiving
that also has a table named http_log
:
http_log:
id: unsinged integer
method: Varchar(10)
url: varchar(150)
How I can create the foreign table archived_http_log
so I can transfer data from the http_log
to archived_http_log
. I cannot have a table with the same name in my postgresql therefore I cannot have 2 tables named http_log
.
What I want top achieve is via a single SQL script to transfer data from logs.http_log
to archiving.http_log
. So in a server to run:
INSERT INTO archived_http_log VALUES (SELECT * from http_log);