| От | Michael Fuhr |
|---|---|
| Тема | Re: How to copy from Table to table |
| Дата | |
| Msg-id | 20050403034438.GA30300@winnie.fuhr.org обсуждение |
| Список | pgsql-general |
[Originally sent to pgsql-committers; I'm replying to pgsql-general.] On Tue, Mar 29, 2005 at 01:20:02AM -0800, joseph antonyraj wrote: > > I need your help to copy a table from a table through copy command > using PostGresql command. Just for your information, both the tables > will exists and will overwrite as on requirement. What do you mean by "overwrite"? Do you want to replace the entire table? Or do you want to keep existing records, add new records, and update (overwrite) records that match some condition? If you want to replace the entire table, then you can use TRUNCATE or DELETE to empty it, then INSERT ... SELECT to insert the results of a query. Another possibility would be to DROP the table and use CREATE TABLE AS or SELECT INTO, but then you'd have to recreate any indexes, constraints, triggers, etc. -- Michael Fuhr http://www.fuhr.org/~mfuhr/
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера