Closed auspex closed 4 years ago
PostgreSQL sequences are always generating bigint numbers. The usual wisdom is to always use bigint as primary keys. pgloader does not implement Fkey graph resolution to match the integer size of all the schema that way. You have two choices:
Encountered the same issue here.
PostgreSQL sequences are always generating bigint numbers.
@dimitri thanks for the great tool and appreciate the workarounds, but just wanted to point out that sequences can be smallint, integer, or bigint since PostgreSQL 10 (https://www.postgresql.org/docs/10/sql-createsequence.html).
No
Yes
Database contains two tables defined as
The Sequence fields (defined as
[int] IDENTITY(1,1)
in SQL Server) are cast tobigint
, but the foreign keys remainint
. This doesn't cause a problem whenpgloader
creates the new tables, but the Dotnet Core Entity Framework throws a fit because the two types don't match.While I can guarantee Postgresql will be happy by casting all
int
tobigint
, I'm expecting this will cause trouble down the road with my EntityFramework app running on either SQL Server or Postgresql, where it's going to want the types to match.A SQL Server
int
should always map tointeger
, not sometimes tobigint
.