copy data postgresql

December 1, 2009 14:37 by Didik

hello guys
here is a little trick of postgresql copy data to other similar table with "insert".
if you have 2 similar table and you want to backup it with a single click from your application you can try this :
for example if u have table employee and employee_backup and you want to copy all of
employee data to employee_backup you can do this query
"insert into employee_backup (select * from employee)".
it works not just for table but also for view.


Comments

December 6. 2009 03:54

Nice info, bro.
This will work for MS SQL too

Anton Setiawan

Add comment




  Country flag

Click to change captcha
biuquote
  • Comment
  • Preview
Loading