copy record? - Mailing list pgsql-general

From Gauthier, Dave
Subject copy record?
Date
Msg-id 482E80323A35A54498B8B70FF2B87980049413B5EB@azsmsx504.amr.corp.intel.com
Whole thread Raw
Responses Re: copy record?
Re: copy record?
List pgsql-general

Hi:

 

From within a perl/DBI script, I want to be able to make a copy of a record in a table, changing only the value of the primary key.  I don't know in advance what all the columns are, just the table name.

 

I suppose I could pull the column names for the table from the metadata, query the table/record for the values to copy, build an insert statement from all of that and run it.  But is there a simpler, more elegant way to do this?

 

Thanks for any help !  

pgsql-general by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: #PgWest 2011: CFP now open
Next
From: "Brent Wood"
Date:
Subject: Re: Miidpoint between two long/lat points? (earthdistance?)