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 2822 게시물 읽기
No. 2822
python으로 만들어본 text형의 대형데이타 입력시험(결과와 소스)
작성자
가우
작성일
2001-05-29 12:11
조회수
15,739

[ess@jncama ess]$ ./a.py

WARNING: Python C API version mismatch for module _pg:

This Python has API version 1010, module _pg has version 1007.

010501.trf = 1992530 [ 11:48:38 / 11:48:40 ]

010502.trf = 1993013 [ 11:48:40 / 11:48:42 ]

010503.trf = 1992562 [ 11:48:42 / 11:48:43 ]

010504.trf = 1995547 [ 11:48:44 / 11:48:45 ]

010505.trf = 1991803 [ 11:48:46 / 11:48:47 ]

010506.trf = 1989938 [ 11:48:48 / 11:48:49 ]

010507.trf = 1995239 [ 11:48:50 / 11:48:51 ]

010508.trf = 1992950 [ 11:48:51 / 11:48:53 ]

010509.trf = 2030871 [ 11:48:53 / 11:48:55 ]

010510.trf = 2031421 [ 11:48:55 / 11:49:02 ]

010511.trf = 2032668 [ 11:49:03 / 11:49:05 ]

010512.trf = 2032315 [ 11:49:06 / 11:49:07 ]

010513.trf = 2031792 [ 11:49:08 / 11:49:10 ]

010514.trf = 2033491 [ 11:49:10 / 11:49:12 ]

010515.trf = 2033213 [ 11:49:13 / 11:49:14 ]

010516.trf = 2033374 [ 11:49:15 / 11:49:17 ]

010517.trf = 2034058 [ 11:49:17 / 11:49:19 ]

010518.trf = 2031919 [ 11:49:20 / 11:49:22 ]

010519.trf = 2032995 [ 11:49:22 / 11:49:24 ]

010520.trf = 2034100 [ 11:49:25 / 11:49:27 ]

010521.trf = 2037287 [ 11:49:28 / 11:49:30 ]

010522.trf = 87962 [ 11:49:30 / 11:49:30 ]

010523.trf = 2033477 [ 11:49:31 / 11:49:33 ]

('010501.trf', 1992530)

('010502.trf', 1993013)

('010503.trf', 1992562)

('010504.trf', 1995547)

('010505.trf', 1991803)

('010506.trf', 1989938)

('010507.trf', 1995239)

('010508.trf', 1992950)

('010509.trf', 2030871)

('010510.trf', 2031421)

('010511.trf', 2032668)

('010512.trf', 2032315)

('010513.trf', 2031792)

('010514.trf', 2033491)

('010515.trf', 2033213)

('010516.trf', 2033374)

('010517.trf', 2034058)

('010518.trf', 2031919)

('010519.trf', 2032995)

('010520.trf', 2034100)

('010521.trf', 2037287)

('010522.trf', 87962)

('010523.trf', 2033477)

Total 44494525 byte

 

[ess@jncama ess]$ cat a.py

#! /usr/local/bin/python

 

tst_path='/home/ess/var/emf/nkj'

 

sql1="""

create table tst_text

(

name text,

contents text

);

"""

 

import pg,time

d = pg.DB('ess')

 

try:

d.query(sql1)

d.query('truncate tst_text')

except: pass

 

for no in range(1,24):

tst_file='%s/0105%02d.trf' % (tst_path,no)

a=open(tst_file,'r').read()

 

t = time.strftime('%T',time.localtime(time.time()))

print '%s = %9d [ %s /' % (tst_file.split('/')[/1],len(a),t),

 

d.query( """insert into tst_text values('%s','%s');""" % (tst_file,a))

 

t = time.strftime('%T',time.localtime(time.time()))

print ' %s ]' % t

 

r00 = d.query('select name,length(contents) as len from tst_text').getresult()

tot = 0

for no in r00:

print (no[0].split('/')[/1],no[1])

try: tot += int(no[1])

except: pass

 

print 'Total %d byte' % tot

[ess@jncama ess]$

[ess@jncama ess]$ psql

Welcome to psql, the PostgreSQL interactive terminal.

 

Type: \copyright for distribution terms

\h for help with SQL commands

\? for help on internal slash commands

\g or terminate with semicolon to execute query

\q to quit

 

ess=> \q

ess=> select count(*),sum(length(contents)) from tst_text ;

count | sum

///////+//////////

23 | 44494525

(1 row)

 

ess=> \q

[Top]
No.
제목
작성자
작성일
조회
2828postgresql 7.1 install 중에서 다음과 같은 에러가 나네요.
김남수
2001-05-29
2536
2830┕>Re: postgresql 7.1 install 중에서 다음과 같은 에러가 나네요.
정재익
2001-05-29 19:08:08
2759
2832 ┕>Re: Re: postgresql 7.1 install 중에서 다음과 같은 에러가 나네요.
김남수
2001-05-29 21:28:24
2851
2837  ┕>Re: Re: Re: postgresql 7.1 install 중에서 다음과 같은 에러가 나네요.
정재익
2001-05-30 15:03:22
2725
2844   ┕>Re: Re: Re: Re: postgresql 7.1 install 중에서 다음과 같은 에러가 나네요.
김남수
2001-05-30 21:38:32
2640
2826cygwin사용시 한글문제는 어떻게 하나요??
김종진
2001-05-29
2385
2831┕>Re: cygwin사용시 한글문제는 어떻게 하나요??
정재익
2001-05-29 19:11:12
2595
2833┕>Re: cygwin사용시 한글문제는 어떻게 하나요??
바보
2001-05-29 21:28:28
2588
2824pl/pgsql 사용시 에러
김진화
2001-05-29
2106
2829┕>Re: pl/pgsql 사용시 에러
정재익
2001-05-29 19:05:55
2403
2822python으로 만들어본 text형의 대형데이타 입력시험(결과와 소스)
가우
2001-05-29
15739
2821변수를 제대루 인식하지 못하는데요......
안세환
2001-05-29
2119
28207.1버젼의 python의 pg모듈을 쓸때주의
가우
2001-05-29
2265
2825┕>Re: 7.1버젼의 python의 pg모듈을 쓸때주의
김상기
2001-05-29 14:08:53
2381
2827 ┕>sum(),avg()의 변환값에 변화가
가우
2001-05-29 17:01:27
2849
2818테이블이름
안세환
2001-05-29
2360
2819┕>Re: 테이블이름
가우
2001-05-29 11:38:11
2450
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2024 DSN, All rights reserved.
작업시간: 0.028초, 이곳 서비스는
	PostgreSQL v16.2로 자료를 관리합니다