[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: Old bug, old module - What should be right?



Gunnar Wolf wrote:
> I want to close a pretty old bug ( #41890! :-O ). It requires a minor
> change in libapache-dbilogger-perl - Setting the column "user" to a
> SQL-legal name (it seems it was meant for MySQL, which is quite
> relaxed on what it accepts - I don't know if this problem would still
> show up with a current Postgres, but using 'user' as a column name is
> definitively not nice).

You do not have to make an incompatible change.  "user" is very well
allowed as a column name in PostgreSQL, you just have to double-quote it
to distinguish it from the "user" keyword:

| CREATE TABLE requests (
|     server varchar(127) DEFAULT '' NOT NULL,
|     bytes mediumint(9) DEFAULT '0' NOT NULL,
|     "user" varchar(15) DEFAULT '' NOT NULL,
|     [...]
| );

This doesn't even justify a change of the sample SQL code in the module's
documentation, since this issue is indeed PostgreSQL specific.  Perhaps a
Pg-specific note in the docs would do.

On a general note, having had a quick look at Apache::DBILogger, I think
this module is in pretty bad shape.  The CPAN module failed 4 of 5 test
builds[1], and the documentation's formatting is broken, especially that
of the sample SQL code -- try to look at the module's documentation in
HTML format[2].

References:
 1. http://testers.cpan.org/show/Apache-DBILogger.html
 2. http://search.cpan.org/dist/Apache-DBILogger/DBILogger.pm



Reply to: