database.sarang.net
UserID
Passwd
Database
DBMS
MySQL
ㆍPostgreSQL
Firebird
Oracle
Informix
Sybase
MS-SQL
DB2
Cache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
PostgreSQL Q&A 7642 게시물 읽기
No. 7642
table1 디비자료만 table2로 옮길려구합니다.
작성자
초보
작성일
2009-03-11 11:51
조회수
7,546

table1에 있는 
[table 1]
"nr" int4 DEFAULT  NOT NULL,
"bid" int4 DEFAULT NULL,
"thread" numeric DEFAULT NULL,
"id" text DEFAULT NULL,
"nick" text DEFAULT NULL,
"passwd" text DEFAULT NULL,
"cdate" timestamp DEFAULT NULL,
"modify_time" timestamp DEFAULT NULL,
"subject" text DEFAULT NULL,
"email" text DEFAULT NULL,
"link" text[] DEFAULT NULL,
"body" text DEFAULT NULL,
"adminflag" int4 DEFAULT NULL,
"hit" int4 DEFAULT NULL,
"cmt" int4 DEFAULT NULL,
"last_comment" timestamp DEFAULT NULL,
"filename" numeric[] DEFAULT NULL,
"filesize" int4[] DEFAULT NULL,
"pseudo" text[] DEFAULT NULL,
"down" int4 DEFAULT NULL,
"ip" inet DEFAULT NULL,
"secret" int2 DEFAULT 0,
"mime" int2 DEFAULT NULL,
"top" int2 DEFAULT NULL,
CONSTRAINT "table 1" PRIMARY KEY ("nr")
)
WITH (OIDS=FALSE);

CREATE TABLE "table 2" (
"nr" int4 DEFAULT nextval NOT NULL,
"bid" int4 DEFAULT NULL,
"category" int4 DEFAULT NULL,
"thread" numeric DEFAULT NULL,
"id" text DEFAULT NULL,
"nick" text DEFAULT NULL,
"passwd" text DEFAULT NULL,
"cdate" timestamp DEFAULT NULL,
"modify_time" timestamp DEFAULT NULL,
"subject" text DEFAULT NULL,
"email" text DEFAULT NULL,
"link" text[] DEFAULT NULL,
"body" text DEFAULT NULL,
"adminflag" int4 DEFAULT NULL,
"hit" int4 DEFAULT NULL,
"cmt" int4 DEFAULT NULL,
"last_comment" timestamp DEFAULT NULL,
"filename" numeric[] DEFAULT NULL,
"filesize" int4[] DEFAULT NULL,
"pseudo" text[] DEFAULT NULL,
"down" int4 DEFAULT NULL,
"ip" inet DEFAULT NULL,
"secret" int2 DEFAULT 0,
"mime" int2 DEFAULT NULL,
"top" int2 DEFAULT NULL,
"recommand" int4 DEFAULT NULL,
"ximg" text[] DEFAULT NULL,
"edit" int4 DEFAULT NULL,
"ext1" int4[] DEFAULT NULL,
"ext2" text[] DEFAULT NULL,
"ext3" timestamp[] DEFAULT NULL,
"tmpsubj" text DEFAULT NULL,
"tmpbody" text DEFAULT NULL,
CONSTRAINT "table2" PRIMARY KEY ("nr")
)
WITH (OIDS=FALSE);

어떻게 옮기면 좋을까요....ㅠㅠ

이 글에 대한 댓글이 총 1건 있습니다.

insert into table2 (column1, column2.....) select column1,column2.... from table1

김상기(ioseph)님이 2009-03-11 12:23에 작성한 댓글입니다.
[Top]
No.
제목
작성자
작성일
조회
7645김상기님 감사합니다. ^ ^ - 추가 질문 ㅎㅎ [2]
이진영
2009-03-12
7696
7644postgres 이중화에 대하여 [1]
김태규
2009-03-12
10730
7643커서 open시에 프로그램이 멈춥니다...
양영광
2009-03-11
6935
7642table1 디비자료만 table2로 옮길려구합니다. [1]
초보
2009-03-11
7546
7641Import error 떠욤.. ㅠㅠ [1]
초보
2009-03-11
7766
7640김상기(ioseph)님 과 고수님들 도와주세요. [1]
이진영
2009-03-10
7008
7639새로운 에러에 대한 질문 좀 드립니다. 도와주세요. ㅠㅠ [3]
이진영
2009-03-09
7954
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2024 DSN, All rights reserved.
작업시간: 0.017초, 이곳 서비스는
	PostgreSQL v16.2로 자료를 관리합니다