This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi! LINQ code var query = from l in db.Logs group l by l.OwnerId into g select g; foreach (var logGrupa in query) { foreach(var log in logGrupa) { logs.Add(log); } } Generates this SQL:
This query returns error in Postgres
ERROR: column g1.ownerid does not exist If you change to [AS "ownerid"], it runs successfully. Subquery alone runs fine. |
|
|
Postgres is expecting a lower cased name to be used you will need to use a custom naming strategy to ensure this is the case when any quoting is required. What you will want to look at doing is to implement a custom naming strategy (have a look at this thread for an example: http://www.mindscape.co.nz/forums/Thread.aspx?PostID=8667) You will want to force lower cased column names like so: public string GetColumnName(string defaultName, string fieldName) { return defaultName.ToLower(); }
Jeremy |
|