Skip to content

Commit 441ea9d

Browse files
author
James William Pye
committed
Add a timestamp column.
1 parent 4100d60 commit 441ea9d

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

postgresql/test/perf_query_io.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,17 @@
99
import time
1010
import sys
1111
import decimal
12+
import datetime
1213

1314
def insertSamples(count, insert_records):
1415
recs = [
15-
(-3, 123, 0xfffffea023, decimal.Decimal("90900023123.40031"), decimal.Decimal("432.40031"), 'some_óäæ_thing', 'varying', 'æ')
16+
(
17+
-3, 123, 0xfffffea023,
18+
decimal.Decimal("90900023123.40031"),
19+
decimal.Decimal("432.40031"),
20+
'some_óäæ_thing', 'varying', 'æ',
21+
datetime.datetime(1982, 5, 18, 12, 0, 0, 100232)
22+
)
1623
for x in range(count)
1724
]
1825
gen = time.time()
@@ -54,9 +61,9 @@ def timeTupleRead(portal):
5461

5562
def main(count):
5663
execute('CREATE TEMP TABLE samples '
57-
'(i2 int2, i4 int4, i8 int8, n numeric, n2 numeric, t text, v varchar, c char)')
64+
'(i2 int2, i4 int4, i8 int8, n numeric, n2 numeric, t text, v varchar, c char, ts timestamp)')
5865
insert_records = prepare(
59-
"INSERT INTO samples VALUES ($1, $2, $3, $4, $5, $6, $7, $8)"
66+
"INSERT INTO samples VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9)"
6067
)
6168
select_records = prepare("SELECT * FROM samples")
6269
try:

0 commit comments

Comments
 (0)