-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/19/2010 07:31 AM, Benjamin Peterson wrote:
> I was curious if there's a reason why BINARY as a column type doesn't produce 
> a
> column without a type affinity like BLOB. This would be one less special case
> between SQLite and other RDMS.

The mappings are defined in http://www.sqlite.org/datatype3.html

You are correct that there are potentially several more synonyms for the
various types.  However unless you can show massive problems the current
set can't realistically be changed since that would alter behaviour of
existing databases.  SQLite takes forward and backwards compatibility
very seriously.

But in any event this should not matter.  If you insert a blob into a
column with any other affinity then it will remain a blob.

sqlite> create table x(y binary);
sqlite> insert into x values(x'31');
sqlite> insert into x values(x'3100');

0x31 is the char '1'.

sqlite> .dump
CREATE TABLE x(y binary);
INSERT INTO x VALUES(X'31');
INSERT INTO x VALUES(X'3100');

The affinity will only affect you if you declare the column as type
'binary' (which will give integer affinity) and then insert a string
consisting of digits.  But if you expect the column to be binary, why
are you not supplying blobs?

If you are using Python for all this then I suggest taking it up on the
python-sqlite group since there are further "issues" behind what
pysqlite does.

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxs6lUACgkQmOOfHg372QTCuQCg1bbJlQPWOslrnhH6XagB+U3s
Gq0AoOXlX7LfH/17usyqMuQqDlt+ufnI
=1nRf
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to