03-08-2012, 10:07 PM
Ok, that of course is a problem, since functions within SQL are not ANSI specified afaik. But as always there is a way around this: apply functions post query. I know that this sometimes may cause a huge overhead, if a statement looks like "SELECT * FROM WHERE trim("field1") <> ''; ". Another solution would be to provide data "As needed", e.g. if one one php function needs all "field1" values as they are and another function needs to compare against the trim("field1"), then a second table would be the right choice. I also think, that may speed up certain operations, since the DB Server wouldn't have to apply the function on every field.
It wold propably cost more memory, but less then running a second DB server. Also memory is kind of cheap nowdays.
There are some things I'm not shure about, e.g. what ANSI-SQL (92, 98, 2003) or other SQL standart AdoDB parses, what statements are definitly working. I suppose statements like "INSERT * ON DUPLICATE INSERT" are made use of, but are on the other hand not suppurted by PostgreSQL. ANSI-SQL somenumber defines MERGE for that Operation, but I don't know, if AdoDB has implemented this statement.
It wold propably cost more memory, but less then running a second DB server. Also memory is kind of cheap nowdays.
There are some things I'm not shure about, e.g. what ANSI-SQL (92, 98, 2003) or other SQL standart AdoDB parses, what statements are definitly working. I suppose statements like "INSERT * ON DUPLICATE INSERT" are made use of, but are on the other hand not suppurted by PostgreSQL. ANSI-SQL somenumber defines MERGE for that Operation, but I don't know, if AdoDB has implemented this statement.