ss1289
05-05-2008, 05:35 PM
In PostgreSQL, I'm trying to create a table in one database using the results of a select query in another totally different database.
Now the only way I know of to do this is to get the results from one table and run a bunch of inserts into the other table.
But I was wondering if there was a way to do it where I could create a table on the fly, like the following somehow
CREATE TABLE newTable AS (//results from the other table in the other database);
I'm not sure if this is possible since you're creating a table in one database from the results of a table in another database. You can't mix the two databases that easily, can you?
Any advice on how to do this would be greatly appreciated.
Now the only way I know of to do this is to get the results from one table and run a bunch of inserts into the other table.
But I was wondering if there was a way to do it where I could create a table on the fly, like the following somehow
CREATE TABLE newTable AS (//results from the other table in the other database);
I'm not sure if this is possible since you're creating a table in one database from the results of a table in another database. You can't mix the two databases that easily, can you?
Any advice on how to do this would be greatly appreciated.