Status: New
Owner: ----
New issue 257 by guillaume.bibaut: PostgreSql uuid data type
http://code.google.com/p/dblinq2007/issues/detail?id=257
What steps will reproduce the problem?
1.Create a table TestTable with an identifier using the uuid type and a
second column with a character varying as testdata
2.generate the DataContext using sqlmetal
3.use the data context in some code to insert a "new TestTable {ID =
Guid.NewGuid(), TestData = "Data" }"
4.use DataContext.Log = Console.Out (or to a file)
What is the expected output? What do you see instead?
Expected :
in the WHERE statement after the INSERT statement has run, we should see :
WHERE ("ID" = ('7DCBA342-D28B-443b-8196-717014501B51')::uuid)
What we see instead :
WHERE ("ID" = 7DCBA342-D28B-443b-8196-717014501B51)
What version of the product are you using? On what operating system?
System.Data.Linq in Mono-2-6 branches (which is supposed to be 0.20 ?)
~/Mono/mono-2-6
$ svn info
Chemin : .
URL : svn://
anonsvn.mono-project.com/source/branches/mono-2-6
Racine du dépôt : svn://
anonsvn.mono-project.com/source
UUID du dépôt : e3ebcda4-bce8-0310-ba0a-eca2169e7518
Révision : 158311
...
$ sqlmetal /?
DbLinq Database mapping generator 2008 version 0.20
...
PostgreSql version : 8.4.4
Npgsql version : 2.0.9
Linux : ArchLinux (
http://archlinux.org/)
In my understanding of the DbLinq code in this mono branch, UUID use is not
provided.
Here is my sample test DataContext.Log, it's not exactly the same as
described in my issue, but still shows that uuid use is not provided :
INSERT INTO "public"."Characters" ("Id", "Name") VALUES (:ID, :Name)
-- :ID: Input Guid (Size = 0; Prec = 0; Scale = 0)
[3e2731f1-4ce2-4d89-b310-6397c2d1197a]
-- :Name: Input String (Size = 0; Prec = 0; Scale = 0) [Toto]
-- Context: PostgreSQL Model: AttributedMetaModel Build: 3.5.0.0
SELECT "CharacterId", "DateRanking", "ExpInLevel", "Id", "Level"
FROM "public"."History"
WHERE ("CharacterId" = 3e2731f1-4ce2-4d89-b310-6397c2d1197a)
-- Context: PostgreSQL Model: AttributedMetaModel Build: 3.5.0.0
Unhandled Exception: Npgsql.NpgsqlException:
syntax error at or near "f1"
Severity: ERROR
Code: 42601
at
Npgsql.NpgsqlState+<ProcessBackendResponses_Ver_3>c__Iterator1.MoveNext ()
[0x00000] in <filename unknown>:0
at Npgsql.ForwardsOnlyDataReader.GetNextResponseObject () [0x00000] in
<filename unknown>:0