Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Some Types that we use in SQL Server don't exist in PostgreSQL or they have different names. Here’s a list:

  • nvarchardecimal(int, int) is called varcharnumeric(int, int). These two types should be identical.

  • datetime does not exist. Currently we’re mostly using timestamp.

  • There exists no equivalent of tinyint. We’re forced to use smallint instead. Hopefully this will not affect db size too muchNote that decimal(int, int) can still be used and is automatically cast to numeric(int, int).

  • char(int) is called character(int).

  • nvarchar(int) is called varchar(int).

  • uniqueidentifier is called uuid (which stands for “universal unique identifier”).

  • varbinary(int) does not exist. Currently we use ByteA. It is a variable-length binary string, unfortunately we can not assign a default length.uniqueidentifier is called uuid (this is short for “universal unique identifier”) ByteA is used instead as it serves the same purpose.

  • datetime does not exist. Instead either timestamp with timezone or timestamp without timezone should be used. In its migration Django has consistently chosen to use timestamp with timezone so this trend was continued.