Reverberations

News, Views, Rants and Raves About Technology and More

Databases vs Schemas

leave a comment »

PostgreSQL and MySQL differ on databases vs schemas terminology. While creating constraints such as foreign key, MySQL lets anyone reference tables across databases (without explicitally using schema). OTOH, PostgreSQL doesn’t have any way to maintain cross database references (as of PostgreSQL 8.2). So, although MySQL’s implimentation is non-standard (and incorrect) it is more functional in this case.
Wikipedia:

MySQL aliases schema with database behind the scenes, such that create schema and create database behave identically. It can be said that MySQL therefore has implemented cross-table functionality, skipped schema functionality entirely and provided similar functionality into their implementation of a database. In summary, Postgres fully supports schemas, but lacks some functionality MySQL has with databases, while MySQL doesn’t even attempt to support true schemas.

Written by Brajesh

November 6, 2007 at 8:57 pm

Posted in Coding, SQL

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: