---
title: "Discussion on \"EF Core and PostgreSQL: Check Constraints\" | Hashnode"
description: "Discussion on \"EF Core and PostgreSQL: Check Constraints\". Check constraints are an essential aspect of maintaining data integrity in a PostgreSQL database. They allow you to define rules that data in a specific column must adhere to, ensuring that only valid and acceptable data can be inserted or updated. I..."
url: "https://hashnode.com/posts/ef-core-and-postgresql-check-constraints/64c813353cc2baa64fa86153"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [EF Core and PostgreSQL: Check Constraints](https://mbarkt3sto.hashnode.dev/ef-core-and-postgresql-check-constraints?utm_source=hashnode&utm_medium=feed)

Check constraints are an essential aspect of maintaining data integrity in a PostgreSQL database. They allow you to define rules that data in a specific column must adhere to, ensuring that only valid and acceptable data can be inserted or updated. I...

Jul 31, 2023 · 5 min read · mbarkt3sto.hashnode.dev  
Read the article

-   [#efcore](https://hashnode.com/tag/efcore)
-   [#entity-framework](https://hashnode.com/tag/entity-framework)
-   [#postgresql](https://hashnode.com/tag/postgresql)
-   [#sql](https://hashnode.com/tag/sql)
-   [#net](https://hashnode.com/tag/net)

## Written by

[M B A R K](https://hashnode.com/@MbarkT3sto)

@MbarkT3sto · Morocco

  
[View profile](https://hashnode.com/@MbarkT3sto)

.NET Specialist

I’m a passionated .NET/C# developer, who likes to play around with C# and see how much I can do with it.

## Responses 1

Markdown supported · ⌘↵ to post

[Illia Ratkevych](https://hashnode.com/@einsteins_brain)

[Dec 30, 2024](https://hashnode.com/posts/ef-core-and-postgresql-check-constraints/64c813353cc2baa64fa86153/comment/677314157d44ad2d82f1fe89)

Thanks for the article. I assumed that EF must have something like you specified. However, it did not recognize .HasCheckConstraint() method :(

I didn't find info about EF version you used. I can assume that in 2023 it was EF Core 7 or something like that, but still not sure.
