# The silent syntax difference in foreign keys between Postgres and MySQL

DevFeed: [The silent syntax difference in foreign keys between Postgres and MySQL](<https://devfeed.tech/articles/the-silent-syntax-difference-in-foreign-keys-between-postgres-and-mysql-5824.md>)

Original publisher: [Read original article](<https://neon.com/blog/the-silent-syntax-difference-in-foreign-keys-between-postgres-and-mysql>)

Author: Rishi Raj Jain

Published: 2024-06-05T16:25:00Z

Content type: article

Language: en

Sources: [Blog -- Neon Docs](<https://devfeed.tech/sources/blog-neon-docs.md>)

Topics: [MySQL](<https://devfeed.tech/topics/mysql.md>), [Database](<https://devfeed.tech/topics/database.md>)

Tags: [data](<https://devfeed.tech/tags/data.md>), [database](<https://devfeed.tech/tags/database.md>), [databases](<https://devfeed.tech/tags/databases.md>), [mysql](<https://devfeed.tech/tags/mysql.md>), [postgres](<https://devfeed.tech/tags/postgres.md>), [switching](<https://devfeed.tech/tags/switching.md>)

## AI overview

The article explains how foreign-key definition syntax differs between Postgres and MySQL. It describes foreign keys, parent-child table relationships, referential integrity, and the potential for unexpected behavior when switching between database systems.

## Source excerpt

Foreign keys are a concept embedded in almost every relational database. If you are normalizing your database, you will expect to use foreign keys throughout. And they seem simple. But simplicity often belies the subtle differences that can trip you up when switching between data...