title: Adding named foreign key constraints in a SQL Create statement
body: <p>I currently have:</p>
  
  <pre><code>CREATE TABLE  galleries_gallery (
      id              INT NOT NULL PRIMARY KEY IDENTITY,
      title           NVARCHAR(50) UNIQUE NOT NULL,
      description     VARCHAR(256),
      templateID      INT NOT NULL REFERENCES galleries_templates(id),
      jsAltImgID      INT NOT NULL REFERENCES libraryImage(id)
      jsAltText       NVARCHAR(500),
      dateCreated     SMALLDATETIME NOT NULL,
      dateUpdated     SMALLDATETIME NOT NULL,
      lastUpdatedBy   INT,
      deleted         BIT NOT NULL DEFAULT 0
  );
  </code></pre>
  
  <p>But this adds constraints with auto generated names which make it hard to drop the constraint later. What do I need to add in order to name the constraints?</p>
  
  <p>The above example is SQL Server and I also need it in PostgreSQL.</p>