Re: [sqlalchemy] postgresql: force create SERIAL without primary key

2020-09-30 Thread Павел Фролов
Mike, fist of all thank you a lot for your answers - it works for me now, but I found issue case (it was necessary to test more thoroughly and describe the libraries, I use latest sqlalchemy and alembic) so problem was when I had UniqueConstraint instead of PrimaryKeyConstraint. *#

Re: [sqlalchemy] postgresql: force create SERIAL without primary key

2020-09-30 Thread Mike Bayer
I just ran your test case, it generates BIGSERIAL, no warning is emitted because I don't include primary_key=True on the column. Can you ensure SQLAlchemy is on latest 1.3 version and try the below MCVE? if you can modify it to show your problem that would help. import sqlalchemy as sa from

Re: [sqlalchemy] postgresql: force create SERIAL without primary key

2020-09-30 Thread Mike Bayer
oh other way around, you want BIGSERIAL make yourself a BIGSERIAL type. from sqlalchemy import Column from sqlalchemy import create_engine from sqlalchemy import Integer from sqlalchemy import MetaData from sqlalchemy import Table from sqlalchemy import types as sqltypes class

Re: [sqlalchemy] postgresql: force create SERIAL without primary key

2020-09-29 Thread Павел Фролов
Thank you for the answer, but how it can help... I tried, but I NEED autoincrement (SERIAL in postgres), NO NEED primary key on this, particular column. Also I tried with Sequence and without autoincrement: Column('id', BIGINT, sa.Sequence('test_seq'), autoincrement=False, nullable=False) no

Re: [sqlalchemy] postgresql: force create SERIAL without primary key

2020-09-29 Thread Mike Bayer
set autoincrement=False in the Column definition Column('id', BIGINT, autoincrement=False) On Tue, Sep 29, 2020, at 3:49 PM, Павел Фролов wrote: > Hi all, > > I need just autoincrement without primary key, like: > > CREATE TABLE test ( > id BIGSERIAL NOT NULL, > run_id INTEGER NOT

[sqlalchemy] postgresql: force create SERIAL without primary key

2020-09-29 Thread Павел Фролов
Hi all, I need just autoincrement without primary key, like: CREATE TABLE test ( id BIGSERIAL NOT NULL, run_id INTEGER NOT NULL ); How it's do with sqlalchemy core? I tried: sa.Column('id', sa.BIGINT(), sa.Sequence('test_seq')), or sa.Column('id', sa.BIGINT(), autoincrement=True), ->