

It uses the command line option pg_dump -t x2 | sed 's/x2/x3/g' | psql and in this setting I don't have access to the command line.Stack Overflow question about database copying: This isn't what I'm asking for for three reasons

Then copy all of the data with a SELECT * and then copy over all of the indices.
#Postgresql create table example serial
What I'd like to do is either straight make an exact copy with some miracle command, or if that's not possible, to copy the table with all contraints but without indices, and make sure they're the constraints 'in spirit' (aka a new counter for a SERIAL column). I also don't have the advantage of a command line. It also makes it infeasible to dump to a file to then re-ingest. The table size makes indexing a real time issue. Instead of setting up a new 'counter' on the the new table, it sets the default value of the column in the new table to the counter of the past table, meaning it won't increment as rows are added.

I'm trying to copy a large table (~40M rows, 100+ columns) in postgres where a lot of the columns are indexed. DISCLAIMER: This question is similar to the stack overflow question here, but none of those answers work for my problem, as I will explain later.
