What does DBD::Pg not liked named parameters?

btilly on 2007-06-07T23:22:46

At $work I'm getting a few basic tools set up. Since we use PostgreSQL, I'm using DBD::Pg. With DBD::Oracle I grew to like some of the more flexible ways of entering parameters, so I look for that in DBD::Pg. I find that there are three options.

1. The DBI standard ?. If I was happy with that, I wouldn't be reading this documentation.

2. They allow positional parameters with $1, $2, $3. Given that this is inside of Perl, I'm going to constantly be wondering whether I'm accidentally interpolating in variables. Better than ? but I don't really like the syntax. The visual disambiguation from variable interpolation was a reason to prefer DBD::Oracle's :1, :2 and so on.

3. They support full named parameters. :foo. :bar. Yay! I like it! But they go on to say, While this syntax is supported by DBD::Pg, its use is highly discouraged.

Huh? Does anyone know why they discourage the cleanest and most flexible solution? Personally whenever I get the chance to work by name rather than by position, I jump at the opportunity. But I'm somewhat reluctant to use a feature that the software authors don't want me to use without knowing the reason for that dislike...


Use them anyway

florian on 2007-06-08T11:25:40

I'm using them since they where released a few years ago. Never had any troubles with it - so suggest you just ignore the warning ;)

... or try a portable alternative

izut on 2008-01-16T14:30:50

If DBD::Pg developers don't trust their named placeholders, you've found a reason to try DBIx::Placeholder::Named :-)