Problem with datetime in updates

[email protected]
Newsgroups gmane.comp.gnu.enterprise.general
Message-ID <[email protected]>
Hello.

I have a table definition like that:

      <table name="org_org">
      	<constraints>
	  ...
  	</constraints>
	<fields>
	  <field name="id" type="key" auto="Y" defaultwith="serial"
		  nullable="N"/>
  	  <field name="nick" type="string" length="25" nullable="N"/>
  	  <field name="name" type="string" length="60" nullable="N"/>
  	  <field name="created" type="datetime" defaultwith="timestamp"
	  						     ^^^^^^^^^^
		  nullable="N"/>
  	  <field name="status" type="string"/>
  	  <field name="status_updated" type="datetime"
		  defaultwith="timestamp" nullable="N"/>
  	</fields>
        ...
      </table>


Postgresql gives this schema:

...

CREATE TABLE "org_org" (
	"id" bigint DEFAULT nextval('org_org_id_seq'::text) NOT NULL,
	"nick" character varying(25) NOT NULL,
	"name" character varying(60) NOT NULL,
	"created" timestamp without time zone DEFAULT now() NOT NULL,
	          ^^^^^^^^^
	"status" text,
	"status_updated" timestamp without time zone DEFAULT now() NOT NULL,
	Constraint "pk_org" Primary Key ("id")
);

...

And, as a query example from line command:

 id | nick | name |          created           | ...
----+------+------+----------------------------+ ...
 11 | f    | ff   | 2004-03-29 01:23:22.886056 | ...
					^^^^^^

i.e.: timestamp has 6 decimal digits for seconds

The problem arises when I you try to update from gnue-forms, which
issues this statement:

DB005: [RecordSet:56] _postChanges: statement=UPDATE org_org SET
name='fff' WHERE id='11' AND status_updated='2004-03-29 01:23:22' AND
created='2004-03-29 01:23:22' AND name='ff' AND nick='f' AND
         ^^^^^^^^^^^^^^^^^^^
status='prop'

i.e.: no decimal digits for seconds, so none record gets updated.

¿Any suggestion about how can I deal with it?

thanks in advance.
-- 
José Esteban
Granada - Spain
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.