<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Schemas on BareSQL.com</title>
    <link>https://baresql.com/tags/schemas/</link>
    <description>Recent content in Schemas on BareSQL.com</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Mon, 26 Oct 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://baresql.com/tags/schemas/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Column Types Like DATETIME and BYTEA Exist on Some SQL Engines Only</title>
      <link>https://baresql.com/column-types-like-datetime-and-bytea-exist-on-some-sql-engines-only/</link>
      <pubDate>Mon, 26 Oct 2026 00:00:00 +0000</pubDate>
      <guid>https://baresql.com/column-types-like-datetime-and-bytea-exist-on-some-sql-engines-only/</guid>
      <description>&lt;p&gt;A schema with DATETIME and JSONB columns runs on SQLite without complaint. Both types fail on at least one of the other engines.&lt;/p&gt;&#xA;&lt;p&gt;SQLite accepts nearly any type name, so a schema that works there can still fail elsewhere. Each type in the table was used in a CREATE TABLE on all four engines.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://baresql.com/images/rule-type-not-everywhere.png&#34; alt=&#34;CREATE TABLE t (d DATETIME); SELECT COUNT(*) FROM t, run on four engines: SQLite 3.45.1 0; PostgreSQL 16.15 error: type &amp;quot;datetime&amp;quot; does not exist; MySQL 8.0.46 0; MariaDB 10.11.14 0.&#34;&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>MySQL and MariaDB on Linux Treat Table Names as Case Sensitive</title>
      <link>https://baresql.com/mysql-and-mariadb-on-linux-treat-table-names-as-case-sensitive/</link>
      <pubDate>Mon, 26 Oct 2026 00:00:00 +0000</pubDate>
      <guid>https://baresql.com/mysql-and-mariadb-on-linux-treat-table-names-as-case-sensitive/</guid>
      <description>&lt;p&gt;Code that creates a table as Users and later reads users works on SQLite and PostgreSQL. On MySQL or MariaDB running on Linux it fails, since users is another table that doesn’t exist, while the same code on a Mac works, which makes the bug easy to miss.&lt;/p&gt;&#xA;&lt;p&gt;MySQL and MariaDB keep each table in files named after it, and file names on Linux are case-sensitive (lower_case_table_names = 0, the default there). On Windows and macOS the default makes names case-insensitive. SQLite and PostgreSQL ignore case in unquoted names.&lt;/p&gt;</description>
    </item>
    <item>
      <title>MySQL Refuses a Key on a TEXT Column Without a Prefix Length</title>
      <link>https://baresql.com/mysql-refuses-a-key-on-a-text-column-without-a-prefix-length/</link>
      <pubDate>Mon, 26 Oct 2026 00:00:00 +0000</pubDate>
      <guid>https://baresql.com/mysql-refuses-a-key-on-a-text-column-without-a-prefix-length/</guid>
      <description>&lt;p&gt;A TEXT column as a primary key is ordinary on SQLite and PostgreSQL. MySQL and MariaDB refuse it, and MySQL refuses a plain index or unique key on TEXT as well.&lt;/p&gt;&#xA;&lt;p&gt;SQLite and PostgreSQL index TEXT columns as they are. MySQL wants a prefix length, INDEX (x(100)), which the others reject. MariaDB 10.4 and later accept plain indexes and unique keys on TEXT columns.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://baresql.com/images/rule-index-on-text.png&#34; alt=&#34;CREATE TABLE t (x TEXT PRIMARY KEY); SELECT COUNT(*) FROM t, run on four engines: SQLite 3.45.1 0; PostgreSQL 16.15 0; MySQL 8.0.46 error: BLOB/TEXT column &#39;x&#39; used in key specification without a key length; MariaDB 10.11.14 error: BLOB/TEXT column &#39;x&#39; used in key specification without a key length.&#34;&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>MySQL Refuses a Plain DEFAULT Value on TEXT Columns</title>
      <link>https://baresql.com/mysql-refuses-a-plain-default-value-on-text-columns/</link>
      <pubDate>Mon, 26 Oct 2026 00:00:00 +0000</pubDate>
      <guid>https://baresql.com/mysql-refuses-a-plain-default-value-on-text-columns/</guid>
      <description>&lt;p&gt;A notes column declared as &lt;code&gt;TEXT DEFAULT &#39;&#39;&lt;/code&gt; works on SQLite, PostgreSQL and MariaDB. MySQL refuses the CREATE TABLE.&lt;/p&gt;&#xA;&lt;p&gt;MySQL 8.0.13 and later accept a default written as an expression in parentheses, DEFAULT (&#39;a&#39;), which the other three engines accept as well.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://baresql.com/images/rule-text-default.png&#34; alt=&#34;CREATE TABLE t (id INTEGER, x TEXT DEFAULT &#39;a&#39;); INSERT INTO t (id) VALUES (1); SELECT x FROM t, run on four engines: SQLite 3.45.1 &#39;a&#39;; PostgreSQL 16.15 &#39;a&#39;; MySQL 8.0.46 error: BLOB, TEXT, GEOMETRY or JSON column &#39;x&#39; can&#39;t have a default value; MariaDB 10.11.14 &#39;a&#39;.&#34;&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>MySQL Refuses CREATE INDEX IF NOT EXISTS</title>
      <link>https://baresql.com/mysql-refuses-create-index-if-not-exists/</link>
      <pubDate>Mon, 26 Oct 2026 00:00:00 +0000</pubDate>
      <guid>https://baresql.com/mysql-refuses-create-index-if-not-exists/</guid>
      <description>&lt;p&gt;Migrations that may run twice often say &lt;code&gt;CREATE INDEX IF NOT EXISTS&lt;/code&gt;, and SQLite, PostgreSQL and MariaDB accept it. MySQL stops the migration with a syntax error.&lt;/p&gt;&#xA;&lt;p&gt;MySQL accepts IF NOT EXISTS for tables and databases, and not for indexes.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://baresql.com/images/rule-index-if-not-exists.png&#34; alt=&#34;CREATE TABLE t (x INTEGER); CREATE INDEX IF NOT EXISTS t_x ON t (x); SELECT COUNT(*) FROM t, run on four engines: SQLite 3.45.1 0; PostgreSQL 16.15 0; MySQL 8.0.46 error: You have an error in your SQL syntax ... near &#39;IF NOT EXISTS t_x ON t (x)&#39; at line 1; MariaDB 10.11.14 0.&#34;&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>MySQL Table Options Like ENGINE and CHARSET Fail on PostgreSQL and SQLite</title>
      <link>https://baresql.com/mysql-table-options-like-engine-and-charset-fail-on-postgresql-and-sqlite/</link>
      <pubDate>Mon, 26 Oct 2026 00:00:00 +0000</pubDate>
      <guid>https://baresql.com/mysql-table-options-like-engine-and-charset-fail-on-postgresql-and-sqlite/</guid>
      <description>&lt;p&gt;A MySQL schema ends its CREATE TABLE statements with options such as &lt;code&gt;ENGINE=InnoDB DEFAULT CHARSET=utf8mb4&lt;/code&gt;. SQLite and PostgreSQL refuse the statement at the first option.&lt;/p&gt;&#xA;&lt;p&gt;Dumps made with mysqldump carry these options on every table. SQLite’s own options, WITHOUT ROWID and STRICT, fail on the other three engines in the same way.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://baresql.com/images/rule-table-options.png&#34; alt=&#34;CREATE TABLE t (x INTEGER) ENGINE=InnoDB; SELECT COUNT(*) FROM t, run on four engines: SQLite 3.45.1 error: near &amp;quot;=&amp;quot;: syntax error; PostgreSQL 16.15 error: syntax error at or near &amp;quot;ENGINE&amp;quot;; MySQL 8.0.46 0; MariaDB 10.11.14 0.&#34;&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>No Auto Increment Column Syntax Works on Every SQL Engine</title>
      <link>https://baresql.com/no-auto-increment-column-syntax-works-on-every-sql-engine/</link>
      <pubDate>Mon, 26 Oct 2026 00:00:00 +0000</pubDate>
      <guid>https://baresql.com/no-auto-increment-column-syntax-works-on-every-sql-engine/</guid>
      <description>&lt;p&gt;A schema meant for several engines needs ids that number themselves, and no single way of asking for that works on all four. SERIAL comes closest, and on SQLite it fails without a word.&lt;/p&gt;&#xA;&lt;p&gt;AUTO_INCREMENT belongs to MySQL and MariaDB, AUTOINCREMENT to SQLite, and GENERATED BY DEFAULT AS IDENTITY to PostgreSQL. SERIAL is PostgreSQL’s as well, and MySQL and MariaDB accept it as BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE. SQLite accepts any type name, so SERIAL is only a name there and the column stays NULL: SQLite numbers rows for a column declared INTEGER PRIMARY KEY and nothing else.&lt;/p&gt;</description>
    </item>
    <item>
      <title>SQLite Has No CREATE OR REPLACE VIEW</title>
      <link>https://baresql.com/sqlite-has-no-create-or-replace-view/</link>
      <pubDate>Mon, 26 Oct 2026 00:00:00 +0000</pubDate>
      <guid>https://baresql.com/sqlite-has-no-create-or-replace-view/</guid>
      <description>&lt;p&gt;&lt;code&gt;CREATE OR REPLACE VIEW&lt;/code&gt; lets a migration change a view in one step on PostgreSQL, MySQL and MariaDB. On SQLite the statement is a syntax error.&lt;/p&gt;&#xA;&lt;p&gt;SQLite can only drop a view and create it again.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://baresql.com/images/rule-create-or-replace.png&#34; alt=&#34;CREATE OR REPLACE VIEW v AS SELECT x FROM t; SELECT COUNT(*) FROM v, run on four engines: SQLite 3.45.1 error: near &amp;quot;OR&amp;quot;: syntax error; PostgreSQL 16.15 0; MySQL 8.0.46 0; MariaDB 10.11.14 0.&#34;&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>SQLite Stores Text in INTEGER Columns and Ignores VARCHAR Lengths</title>
      <link>https://baresql.com/sqlite-stores-text-in-integer-columns-and-ignores-varchar-lengths/</link>
      <pubDate>Mon, 26 Oct 2026 00:00:00 +0000</pubDate>
      <guid>https://baresql.com/sqlite-stores-text-in-integer-columns-and-ignores-varchar-lengths/</guid>
      <description>&lt;p&gt;A test suite on SQLite passes with a quantity of &lt;code&gt;&#39;abc&#39;&lt;/code&gt;, or &lt;code&gt;&#39;Germany&#39;&lt;/code&gt; in a &lt;code&gt;VARCHAR(2)&lt;/code&gt; country column. PostgreSQL, MySQL and MariaDB refuse both values, so the bug shows up in production instead.&lt;/p&gt;&#xA;&lt;p&gt;Column types on SQLite are preferences: a value that does not fit is stored as it is, and lengths are never checked. Tests that run on SQLite then pass with data the production engine rejects. SQLite’s STRICT tables (version 3.37 and later) check types but not lengths, and the other engines do not accept the STRICT keyword.&lt;/p&gt;</description>
    </item>
    <item>
      <title>VARCHAR Without a Length Fails on MySQL and MariaDB</title>
      <link>https://baresql.com/varchar-without-a-length-fails-on-mysql-and-mariadb/</link>
      <pubDate>Mon, 26 Oct 2026 00:00:00 +0000</pubDate>
      <guid>https://baresql.com/varchar-without-a-length-fails-on-mysql-and-mariadb/</guid>
      <description>&lt;p&gt;Schemas written for PostgreSQL often declare names and notes as plain &lt;code&gt;VARCHAR&lt;/code&gt;, with no length. MySQL and MariaDB refuse that CREATE TABLE, since they want a length on every VARCHAR column.&lt;/p&gt;&#xA;&lt;p&gt;PostgreSQL reads VARCHAR without a length as text of any length, and SQLite ignores lengths anyway.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://baresql.com/images/rule-varchar-length.png&#34; alt=&#34;CREATE TABLE t (x VARCHAR); SELECT COUNT(*) FROM t, run on four engines: SQLite 3.45.1 0; PostgreSQL 16.15 0; MySQL 8.0.46 error: You have an error in your SQL syntax ... near &#39;)&#39; at line 1; MariaDB 10.11.14 error: You have an error in your SQL syntax ... near &#39;)&#39; at line 1.&#34;&gt;&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
