0
Not a bug

Too big MAXVALUE for sequence (postgresql 9.3)

Grzegorz Kaczor 9 year бұрын updated by anonymous 9 year бұрын 2

Code generated for sequence is:


-- Sequence: ACCOUNT_NUMBER_GROUP_SEQCREATE SEQUENCE ACCOUNT_NUMBER_GROUP_SEQ
      INCREMENT BY 1
      MINVALUE 1
      MAXVALUE 9999999999999999999999999999
      START WITH 10000 
      
      NO CYCLE
      
;

When I try to run it in PostgreSQL 9.3.5, I get an error:


ERROR: value "9999999999999999999999999999" is out of range for type bigint

Shouldn't MAXVALUE be lower? Or perhaps MAXVALUE should be omitted in this case as the default is 2^63-1?

GOOD, I'M SATISFIED

OK, I exported model to XML and changed sequence definitions. Thanks.

Satisfaction mark by Grzegorz Kaczor 9 year бұрын

This might be related to reverse engineering somehow, because the model was initially exported from Oracle to Vertabelo XML and imported back as PostgreSQL.

Not a bug

Well, this is something that Oracle returns when reading information about sequences (this is how reverse-engineering works). Please see the screenshot:


We currently don't support migration between DBMS-es like in your case.

I think it's pretty easy to fix it. It should be sufficient to use sed or any find&replace tool to change this 999... to any value supported by PostgreSQL.