Re: bytea & perl
От | SCassidy@overlandstorage.com |
---|---|
Тема | Re: bytea & perl |
Дата | |
Msg-id | OFAE9306F1.B83F23BA-ON882572E6.005576BF-882572E6.00562508@overlandstorage.com обсуждение исходный текст |
Ответ на | Re: bytea & perl (Tom Allison <tom@tacocat.net>) |
Список | pgsql-general |
You don't use quote when using placeholders, but you will have to escape the special characters, as mentioned previously.
The note in DBD:Pg perldoc that says this:
NOTE: The undocumented (and invalid) support for the "SQL_BINARY"
data type is officially deprecated. Use "PG_BYTEA" with
"bind_param()" instead:
Is talking abojut SQL_BINARY, not PG_BYTEA being deprecated as a type name.
You use quote when building statements inline, like:
my $modelq=$dbh->quote($model);
$stmt=qq(select id, model from tbl1 where model = $modelq)
Susan Cassidy
Tom Allison <tom@tacocat.net> 05/25/2007 04:15 AM |
|
I think the quote() part for bytes is deprecated already?
my $string = "(" . join($glue, map{$dbh->quote($_,PG_BYTEA)} @$tokens) . ")";
returns
Unknown type 17, defaulting to VARCHAR
as a warning...
On May 24, 2007, at 1:11 PM, SCassidy@overlandstorage.com wrote:
Hi,
First, I would advise never using " insert into xx values (y,x)" without explicitly naming the columns; same for select statements - never use select * (a table change can mess things up).
By the way, I just noticed in the release notes for the very latest couple of versions of DBD:Pg that some placeholder changes were made. You might want to check the release notes and your version of DBD:Pg about your placeholder issues.
----------------------------------------------------------------------------------------------
Simply protected storage solutions ensure that your information is
automatically safe, readily available and always there, visit us at http://www.overlandstorage.com
----------------------------------------------------------------------------------------------
В списке pgsql-general по дате отправления: