# Enum NpgsqlValueGenerationStrategy

Namespace
  Npgsql.EntityFrameworkCore.PostgreSQL.Metadata

Assembly
  Npgsql.EntityFrameworkCore.PostgreSQL.dll

Defines strategies to use when generating values for database columns.

    public enum NpgsqlValueGenerationStrategy

Extension Methods
  NpgsqlValueGenerationStrategyExtensions.IsIdentity(NpgsqlValueGenerationStrategy)

## Fields

`IdentityAlwaysColumn = 3`

  Selects the always-identity column strategy (a value cannot be provided).

  Available only starting PostgreSQL 10.

`IdentityByDefaultColumn = 4`

  Selects the by-default-identity column strategy (a value can be provided to override the identity mechanism).

  Available only starting PostgreSQL 10.

`None = 0`

  No Npgsql-specific strategy.

`Sequence = 5`

  A pattern that uses a database sequence to generate values for the column.

`SequenceHiLo = 1`

  A sequence-based hi-lo pattern where blocks of IDs are allocated from the server and used client-side for generating keys.

  This is an advanced pattern--only use this strategy if you are certain it is what you need.

`SerialColumn = 2`

  Selects the serial column strategy, which is a regular column backed by an auto-created index.

  If you are creating a new project on PostgreSQL 10 or above, consider using IdentityByDefaultColumn instead.

## Remarks

See Model building conventions.