Skip to content

Commit eaf298b

Browse files
committed
Drop support for PostgreSQL 9.1
PostgreSQL version 9.1 is no longer supported by the upstream, and it's not worth the maintenance overhead.
1 parent 327058f commit eaf298b

File tree

5 files changed

+3
-138
lines changed

5 files changed

+3
-138
lines changed

.travis.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,6 @@ matrix:
3939

4040
# Do quick test runs for each supported version of PostgreSQL
4141
# minus the latest.
42-
- os: linux
43-
dist: precise
44-
sudo: false
45-
language: python
46-
python: "3.5"
47-
services: postgresql
48-
env: BUILD=quicktests PGVERSION=9.1
49-
addons:
50-
postgresql: '9.1'
51-
5242
- os: linux
5343
dist: trusty
5444
sudo: false

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ framework. You can read more about asyncpg in an introductory
1717
`blog post <http://magic.io/blog/asyncpg-1m-rows-from-postgres-to-python/>`_.
1818

1919
asyncpg requires Python 3.5 or later and is supported for PostgreSQL
20-
versions 9.1 to 9.6.
20+
versions 9.2 to 9.6.
2121

2222

2323
Documentation

asyncpg/connection.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,7 @@ def __init__(self, protocol, transport, loop,
8080
self._server_caps = _detect_server_capabilities(
8181
self._server_version, settings)
8282

83-
if self._server_version < (9, 2):
84-
self._intro_query = introspection.INTRO_LOOKUP_TYPES_91
85-
else:
86-
self._intro_query = introspection.INTRO_LOOKUP_TYPES
83+
self._intro_query = introspection.INTRO_LOOKUP_TYPES
8784

8885
self._reset_query = None
8986
self._proxy = None

asyncpg/introspection.py

Lines changed: 0 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -134,124 +134,6 @@
134134
'''.format(typeinfo=_TYPEINFO)
135135

136136

137-
# Prior to 9.2 PostgreSQL did not have range types.
138-
_TYPEINFO_91 = '''\
139-
(
140-
SELECT
141-
t.oid AS oid,
142-
ns.nspname AS ns,
143-
t.typname AS name,
144-
t.typtype AS kind,
145-
(CASE WHEN t.typtype = 'd' THEN
146-
(WITH RECURSIVE typebases(oid, depth) AS (
147-
SELECT
148-
t2.typbasetype AS oid,
149-
0 AS depth
150-
FROM
151-
pg_type t2
152-
WHERE
153-
t2.oid = t.oid
154-
155-
UNION ALL
156-
157-
SELECT
158-
t2.typbasetype AS oid,
159-
tb.depth + 1 AS depth
160-
FROM
161-
pg_type t2,
162-
typebases tb
163-
WHERE
164-
tb.oid = t2.oid
165-
AND t2.typbasetype != 0
166-
) SELECT oid FROM typebases ORDER BY depth DESC LIMIT 1)
167-
168-
ELSE NULL
169-
END) AS basetype,
170-
t.typreceive::oid != 0 AND t.typsend::oid != 0
171-
AS has_bin_io,
172-
t.typelem AS elemtype,
173-
elem_t.typdelim AS elemdelim,
174-
NULL::oid AS range_subtype,
175-
elem_t.typreceive::oid != 0 AND
176-
elem_t.typsend::oid != 0
177-
AS elem_has_bin_io,
178-
(CASE WHEN t.typtype = 'c' THEN
179-
(SELECT
180-
array_agg(ia.atttypid ORDER BY ia.attnum)
181-
FROM
182-
pg_attribute ia
183-
INNER JOIN pg_class c
184-
ON (ia.attrelid = c.oid)
185-
WHERE
186-
ia.attnum > 0 AND NOT ia.attisdropped
187-
AND c.reltype = t.oid)
188-
189-
ELSE NULL
190-
END) AS attrtypoids,
191-
(CASE WHEN t.typtype = 'c' THEN
192-
(SELECT
193-
array_agg(ia.attname::text ORDER BY ia.attnum)
194-
FROM
195-
pg_attribute ia
196-
INNER JOIN pg_class c
197-
ON (ia.attrelid = c.oid)
198-
WHERE
199-
ia.attnum > 0 AND NOT ia.attisdropped
200-
AND c.reltype = t.oid)
201-
202-
ELSE NULL
203-
END) AS attrnames
204-
FROM
205-
pg_catalog.pg_type AS t
206-
INNER JOIN pg_catalog.pg_namespace ns ON (
207-
ns.oid = t.typnamespace)
208-
LEFT JOIN pg_type elem_t ON (
209-
t.typlen = -1 AND
210-
t.typelem != 0 AND
211-
t.typelem = elem_t.oid
212-
)
213-
)
214-
'''
215-
216-
INTRO_LOOKUP_TYPES_91 = '''\
217-
WITH RECURSIVE typeinfo_tree(
218-
oid, ns, name, kind, basetype, has_bin_io, elemtype, elemdelim,
219-
range_subtype, elem_has_bin_io, attrtypoids, attrnames, depth)
220-
AS (
221-
222-
SELECT
223-
ti.oid, ti.ns, ti.name, ti.kind, ti.basetype, ti.has_bin_io,
224-
ti.elemtype, ti.elemdelim, ti.range_subtype, ti.elem_has_bin_io,
225-
ti.attrtypoids, ti.attrnames, 0
226-
FROM
227-
{typeinfo} AS ti
228-
WHERE
229-
ti.oid = any($1::oid[])
230-
231-
UNION ALL
232-
233-
SELECT
234-
ti.oid, ti.ns, ti.name, ti.kind, ti.basetype, ti.has_bin_io,
235-
ti.elemtype, ti.elemdelim, ti.range_subtype, ti.elem_has_bin_io,
236-
ti.attrtypoids, ti.attrnames, tt.depth + 1
237-
FROM
238-
{typeinfo} ti,
239-
typeinfo_tree tt
240-
WHERE
241-
(tt.elemtype IS NOT NULL AND ti.oid = tt.elemtype)
242-
OR (tt.attrtypoids IS NOT NULL AND ti.oid = any(tt.attrtypoids))
243-
OR (tt.range_subtype IS NOT NULL AND ti.oid = tt.range_subtype)
244-
)
245-
246-
SELECT DISTINCT
247-
*
248-
FROM
249-
typeinfo_tree
250-
ORDER BY
251-
depth DESC
252-
'''.format(typeinfo=_TYPEINFO_91)
253-
254-
255137
TYPE_BY_NAME = '''\
256138
SELECT
257139
t.oid,

tests/test_codecs.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def _timezone(offset):
214214
('json', 'json', [
215215
'[1, 2, 3, 4]',
216216
'{"a": [1, 2], "b": 0}'
217-
], (9, 2)),
217+
]),
218218
('jsonb', 'jsonb', [
219219
'[1, 2, 3, 4]',
220220
'{"a": [1, 2], "b": 0}'
@@ -744,10 +744,6 @@ async def test_domains(self):
744744
async def test_range_types(self):
745745
"""Test encoding/decoding of range types."""
746746

747-
if self.server_version < (9, 2):
748-
raise unittest.SkipTest(
749-
'PostgreSQL servers < 9.2 do not support range types.')
750-
751747
cases = [
752748
('int4range', [
753749
[(1, 9), asyncpg.Range(1, 10)],

0 commit comments

Comments
 (0)