Default Values vs. server side functions + Sequence fills
Posted: Tue 12 Apr 2016 12:56
Dear Support!
I have found an interesting thing.
From the document I read that we must provide sequence name and keyfields for get IDs in interesting records (f. e. masters, or which IDs used in next statements).
It's ok.
But:
I found a "strange" property named "DefaultValues" (?) which fills up the fields with PG table field defaults.
The first question was: what happens with server side evaluated expressions?
Ok, simple expressions can be evaluated by client side as "1", "true", etc.
But what happens with complexes like "current_timestamp" and so on?
The story continued with a developer's experiments.
He said that serials (default nextval()) also evaluated, so he get the next identifier without KeyFieldNames/SequenceName pairs.
It can be true? What happens there? Do you silently call the default expressions on PGQuery.Append, and put the result into the fields?
Can we use this property, or it have limitations?
He said he found a "problem" (?) that when he got this value (f. e. 53), and KeyFieldNames/SeqName filled, it overwrote this value with new.
It can be true? I have no example to it now, but what is your theory about it?
Thanks for your great work!
dd
I have found an interesting thing.
From the document I read that we must provide sequence name and keyfields for get IDs in interesting records (f. e. masters, or which IDs used in next statements).
It's ok.
But:
I found a "strange" property named "DefaultValues" (?) which fills up the fields with PG table field defaults.
The first question was: what happens with server side evaluated expressions?
Ok, simple expressions can be evaluated by client side as "1", "true", etc.
But what happens with complexes like "current_timestamp" and so on?
The story continued with a developer's experiments.
He said that serials (default nextval()) also evaluated, so he get the next identifier without KeyFieldNames/SequenceName pairs.
It can be true? What happens there? Do you silently call the default expressions on PGQuery.Append, and put the result into the fields?
Can we use this property, or it have limitations?
He said he found a "problem" (?) that when he got this value (f. e. 53), and KeyFieldNames/SeqName filled, it overwrote this value with new.
It can be true? I have no example to it now, but what is your theory about it?
Thanks for your great work!
dd