summaryrefslogtreecommitdiff
path: root/test/dialect/postgresql/test_compiler.py
diff options
context:
space:
mode:
authorFederico Caselli <cfederico87@gmail.com>2022-09-24 15:50:26 +0200
committerMike Bayer <mike_mp@zzzcomputing.com>2022-10-17 15:36:25 -0400
commit974b1bd0fc40e11fc2886b5a9fc333feeeebf546 (patch)
tree421f0545c13a203f40435c4646a0de664e0e9756 /test/dialect/postgresql/test_compiler.py
parent665c94cc2f0340735515c4f4477e11b556d2bcd8 (diff)
downloadsqlalchemy-974b1bd0fc40e11fc2886b5a9fc333feeeebf546.tar.gz
Revert automatic set of sequence start to 1
The :class:`.Sequence` construct restores itself to the DDL behavior it had prior to the 1.4 series, where creating a :class:`.Sequence` with no additional arguments will emit a simple ``CREATE SEQUENCE`` instruction **without** any additional parameters for "start value". For most backends, this is how things worked previously in any case; **however**, for MS SQL Server, the default value on this database is ``-2**63``; to prevent this generally impractical default from taking effect on SQL Server, the :paramref:`.Sequence.start` parameter should be provided. As usage of :class:`.Sequence` is unusual for SQL Server which for many years has standardized on ``IDENTITY``, it is hoped that this change has minimal impact. Fixes: #7211 Change-Id: I1207ea10c8cb1528a1519a0fb3581d9621c27b31
Diffstat (limited to 'test/dialect/postgresql/test_compiler.py')
-rw-r--r--test/dialect/postgresql/test_compiler.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/dialect/postgresql/test_compiler.py b/test/dialect/postgresql/test_compiler.py
index c763dbeac..96a8e7d5a 100644
--- a/test/dialect/postgresql/test_compiler.py
+++ b/test/dialect/postgresql/test_compiler.py
@@ -91,11 +91,11 @@ class SequenceTest(fixtures.TestBase, AssertsCompiledSQL):
(SmallInteger, "AS SMALLINT "),
(BigInteger, "AS BIGINT "),
)
- def test_create_index_concurrently(self, type_, text):
+ def test_compile_type(self, type_, text):
s = Sequence("s1", data_type=type_)
self.assert_compile(
schema.CreateSequence(s),
- "CREATE SEQUENCE s1 %sSTART WITH 1" % text,
+ f"CREATE SEQUENCE s1 {text}".strip(),
dialect=postgresql.dialect(),
)