Index: trunk/src/bldprogs/scm.cpp
===================================================================
--- trunk/src/bldprogs/scm.cpp	(revision 69442)
+++ trunk/src/bldprogs/scm.cpp	(revision 69460)
@@ -524,4 +524,14 @@
 };
 
+static PFNSCMREWRITER const g_aRewritersFor_SqlFiles[] =
+{
+    rewrite_ForceNativeEol,
+    rewrite_ExpandTabs,
+    rewrite_StripTrailingBlanks,
+    rewrite_AdjustTrailingLines,
+    rewrite_SvnKeywords,
+    rewrite_SvnNoExecutable,
+    rewrite_Copyright_SqlComment,
+};
 
 static PFNSCMREWRITER const g_aRewritersFor_FileLists[] = /* both makefile and shell script */
@@ -568,4 +578,5 @@
     SCM_CFG_ENTRY(g_aRewritersFor_QtUiFiles,        false, "*.ui" ),
     SCM_CFG_ENTRY(g_aRewritersFor_SifFiles,         false, "*.sif" ),
+    SCM_CFG_ENTRY(g_aRewritersFor_SqlFiles,         false, "*.pgsql|*.sql" ),
     /* Should be last. */
     SCM_CFG_ENTRY(g_aRewritersFor_OtherMakefiles,   false, "Makefile|makefile|GNUmakefile|SMakefile" ),
@@ -1287,5 +1298,5 @@
                 {
                     RTStrFree(pszFreeLine);
-                    rc = RTMsgErrorRc(VERR_NO_MEMORY, "%s: Ran out of memory deal with escaped newlines");
+                    rc = RTMsgErrorRc(VERR_NO_MEMORY, "%s: Ran out of memory deal with escaped newlines", pszFilename);
                     break;
                 }
Index: trunk/src/bldprogs/scm.h
===================================================================
--- trunk/src/bldprogs/scm.h	(revision 69442)
+++ trunk/src/bldprogs/scm.h	(revision 69460)
@@ -80,4 +80,5 @@
     kScmCommentStyle_Rem_Lower,
     kScmCommentStyle_Rem_Camel,
+    kScmCommentStyle_Sql,
     kScmCommentStyle_Tick,
     kScmCommentStyle_End
@@ -206,4 +207,5 @@
 FNSCMREWRITER rewrite_Copyright_RemComment;
 FNSCMREWRITER rewrite_Copyright_SemicolonComment;
+FNSCMREWRITER rewrite_Copyright_SqlComment;
 FNSCMREWRITER rewrite_Copyright_TickComment;
 FNSCMREWRITER rewrite_Makefile_kup;
Index: trunk/src/bldprogs/scmparser.cpp
===================================================================
--- trunk/src/bldprogs/scmparser.cpp	(revision 69442)
+++ trunk/src/bldprogs/scmparser.cpp	(revision 69460)
@@ -105,5 +105,5 @@
 
 /**
- * Callback for checking if comment.
+ * Callback for checking if batch comment.
  */
 static size_t isBatchComment(const char *pchLine, size_t cchLine, bool fSecond)
@@ -121,4 +121,22 @@
             && IS_REM(pchLine, 1, cchLine))
             return 4;
+    }
+    return 0;
+}
+
+/**
+ * Callback for checking if SQL comment.
+ */
+static size_t isSqlComment(const char *pchLine, size_t cchLine, bool fSecond)
+{
+    if (   cchLine >= 2
+        && pchLine[0] == '-'
+        && pchLine[1] == '-')
+    {
+        if (!fSecond)
+            return 2;
+        if (   cchLine >= 3
+            && pchLine[2] == '-')
+            return 3;
     }
     return 0;
@@ -850,4 +868,52 @@
 
 /**
+ * Deals with comments in SQL files.
+ *
+ * @returns VBox status code / callback return code.
+ * @param   pIn                 The stream to parse.
+ * @param   pfnCallback         The callback.
+ * @param   pvUser              The user parameter for the callback.
+ */
+static int enumerateSqlComments(PSCMSTREAM pIn, PFNSCMCOMMENTENUMERATOR pfnCallback, void *pvUser)
+{
+    int             rcRet = VINF_SUCCESS;
+    uint32_t        iLine = 0;
+    SCMEOL          enmEol;
+    size_t          cchLine;
+    const char     *pchLine = ScmStreamGetLine(pIn, &cchLine, &enmEol);
+    while (pchLine != NULL)
+    {
+        /*
+         * Skip leading blanks and check for '--'.
+         */
+        size_t off = 0;
+        while (off + 3 < cchLine && RT_C_IS_SPACE(pchLine[off]))
+            off++;
+        if (   cchLine < 2
+            || pchLine[0] != '-'
+            || pchLine[1] != '-')
+        {
+            iLine++;
+            pchLine = ScmStreamGetLine(pIn, &cchLine, &enmEol);
+        }
+        else
+        {
+            int rc = handleLineComment(pIn, isSqlComment, pfnCallback, pvUser,
+                                       &pchLine, &cchLine, &enmEol, &iLine, &off);
+            if (RT_FAILURE(rc))
+                return rc;
+            if (rcRet == VINF_SUCCESS)
+                rcRet = rc;
+        }
+    }
+
+    int rcStream = ScmStreamGetStatus(pIn);
+    if (RT_SUCCESS(rcStream))
+        return rcRet;
+    return rcStream;
+}
+
+
+/**
  * Deals with simple line comments.
  *
@@ -930,4 +996,7 @@
             return enumerateBatchComments(pIn, pfnCallback, pvUser);
 
+        case kScmCommentStyle_Sql:
+            return enumerateSqlComments(pIn, pfnCallback, pvUser);
+
         case kScmCommentStyle_Tick:
             return enumerateSimpleLineComments(pIn, '\'', isTickComment, pfnCallback, pvUser);
Index: trunk/src/bldprogs/scmrw.cpp
===================================================================
--- trunk/src/bldprogs/scmrw.cpp	(revision 69442)
+++ trunk/src/bldprogs/scmrw.cpp	(revision 69460)
@@ -363,4 +363,5 @@
     { RT_STR_TUPLE("rem") },
     { RT_STR_TUPLE("Rem") },
+    { RT_STR_TUPLE("--") },
     { RT_STR_TUPLE("'") },
     { RT_STR_TUPLE("<end>") },
@@ -378,4 +379,5 @@
     { RT_STR_TUPLE("rem ") },
     { RT_STR_TUPLE("Rem ") },
+    { RT_STR_TUPLE("-- ") },
     { RT_STR_TUPLE("' ") },
     { RT_STR_TUPLE("<end>") },
@@ -393,4 +395,5 @@
     { RT_STR_TUPLE("rem") },
     { RT_STR_TUPLE("Rem") },
+    { RT_STR_TUPLE("--") },
     { RT_STR_TUPLE("'") },
     { RT_STR_TUPLE("<end>") },
@@ -408,4 +411,5 @@
     { RT_STR_TUPLE("rem") },
     { RT_STR_TUPLE("Rem") },
+    { RT_STR_TUPLE("--") },
     { RT_STR_TUPLE("'") },
     { RT_STR_TUPLE("<end>") },
@@ -1692,4 +1696,10 @@
 }
 
+/** Copyright updater for sql  comments.   */
+bool rewrite_Copyright_SqlComment(PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings)
+{
+    return rewrite_Copyright_Common(pState, pIn, pOut, pSettings, kScmCommentStyle_Sql);
+}
+
 /** Copyright updater for tick-prefixed comments.   */
 bool rewrite_Copyright_TickComment(PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings)
