Ben Kim <[EMAIL PROTECTED]> writes:
> Manuel Sugawara <masm ( at ) fciencias ( dot ) unam ( dot ) mx> wrote:
> >> Is there a way to completely turn off case sensitivity of the names
> >> of table, field, sequence, etc.?
> >No, i'm afraid not. But you can tweak scan.l to teach postgreSQL do
> >what you want.
>
> Many thanks. I want to ask a few questions, if you don't mind.
Ok, here is what I would do if I were facing your problem:
1.- Be sure that each identifier in the database catalogs doesn't
require the double quotes, for instance, for pg_class do something
like:
update pg_class set relname = lower(relname) where relname <> lower(relname);
Do the same for pg_namespace, pg_attribute, etc.
2.- Teach scan.l to treat "Identifier" just as identifier, the
following patch against 7.3 will do the work
*** scan.l~ 2002-11-10 21:33:44.000000000 -0600
--- scan.l 2004-03-30 15:36:23.000000000 -0600
***************
*** 408,414 ****
literalbuf[len] = '\0';
literallen = len;
}
! yylval.str = litbufdup();
return IDENT;
}
<xd>{xddouble} {
--- 408,414 ----
literalbuf[len] = '\0';
literallen = len;
}
! yylval.str = litbufdup_lower();
return IDENT;
}
<xd>{xddouble} {
***************
*** 670,675 ****
--- 670,691 ----
return new;
}
+ static char *
+ litbufdup_lower(void)
+ {
+ char *new;
+ int i;
+
+ new = palloc(literallen + 1);
+ memcpy(new, literalbuf, literallen+1);
+
+ for(i = 0; x < literallen; x++)
+ if (isupper((unsigned char) *(new + i))
+ *(new + i) = tolower((unsigned char) *(new + i));
+
+ return new;
+ }
+
unsigned char
unescape_single_char(unsigned char c)
Regards,
Manuel.
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly