postgres 0.7.1 → 0.7.9.2007.12.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/COPYING +340 -0
- data/COPYING.txt +340 -0
- data/Contributors +28 -0
- data/GPL +340 -0
- data/LICENSE +58 -0
- data/README +31 -31
- data/compat-ruby-postgres/extconf.rb +34 -0
- data/compat-ruby-postgres/postgres.c +2811 -0
- data/compat-ruby-postgres/type-oids.h +65 -0
- data/ext/compat.c +461 -0
- data/ext/compat.h +106 -0
- data/ext/extconf.rb +48 -0
- data/ext/pg.c +2730 -0
- data/ext/pg.h +14 -0
- metadata +43 -35
- data/ChangeLog +0 -230
- data/MANIFEST +0 -14
- data/README.ja +0 -183
- data/doc/postgres.html +0 -257
- data/doc/postgres.jp.html +0 -239
- data/extconf.rb +0 -47
- data/postgres-ruby.gemspec +0 -22
- data/postgres.c +0 -1513
- data/sample/losample.rb +0 -47
- data/sample/psql.rb +0 -1181
- data/sample/psqlHelp.rb +0 -158
- data/sample/test1.rb +0 -63
- data/sample/test2.rb +0 -44
- data/sample/test4.rb +0 -71
data/sample/losample.rb
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
require "postgres"
|
2
|
-
|
3
|
-
def main
|
4
|
-
conn = PGconn.connect("localhost",5432,"","")
|
5
|
-
puts("dbname: " + conn.db + "\thost: " + conn.host + "\tuser: " + conn.user)
|
6
|
-
|
7
|
-
# Transaction
|
8
|
-
conn.exec("BEGIN")
|
9
|
-
lobj = conn.loimport("losample.rb")
|
10
|
-
lobjnum = lobj.oid
|
11
|
-
puts("loimport ok! oid=" + lobj.oid.to_s)
|
12
|
-
lobj.open
|
13
|
-
lobj.seek(0,PGlarge::SEEK_SET) # SEEK_SET or SEEK_CUR or SEEK_END
|
14
|
-
buff = lobj.read(18)
|
15
|
-
puts buff
|
16
|
-
if 'require "postgres"' == buff
|
17
|
-
puts "read ok!"
|
18
|
-
end
|
19
|
-
lobj.seek(0,PGlarge::SEEK_END)
|
20
|
-
buff = lobj.write("write test ok?\n")
|
21
|
-
puts lobj.tell
|
22
|
-
puts 'export test .file:lowrite.losample add "write test of?"...'
|
23
|
-
lobj.export("lowrite.txt")
|
24
|
-
lobj.close
|
25
|
-
conn.exec("COMMIT")
|
26
|
-
begin
|
27
|
-
lobj.read(1)
|
28
|
-
puts "boo!"
|
29
|
-
return
|
30
|
-
rescue
|
31
|
-
puts "ok! Large Object is closed"
|
32
|
-
end
|
33
|
-
conn.exec("BEGIN")
|
34
|
-
puts lobjnum.to_s
|
35
|
-
lobj = conn.loopen(lobjnum)
|
36
|
-
puts "large object reopen ok!"
|
37
|
-
lobj.seek(0,PGlarge::SEEK_SET) # SEEK_SET or SEEK_CUR or SEEK_END
|
38
|
-
buff = lobj.read(18)
|
39
|
-
puts buff
|
40
|
-
puts "reread ok!"
|
41
|
-
conn.exec("COMMIT")
|
42
|
-
lobj.unlink
|
43
|
-
puts "large object unlink"
|
44
|
-
end
|
45
|
-
|
46
|
-
main
|
47
|
-
|