View Single Post

   
  #1 (permalink)  
Old 04-15-2008, 11:57 PM
David Goodenough
 
Posts: n/a
Default setString and timestamps

I understand from looking at the archive that there some changes around
8.0 in this area, but I am confused as to how to proceed.

I have some code which takes a table and inserts values into it where the
values have come from XML and are thus all strings. Some of these XML
fields are timestamps, but this generic code does not have table specific
knowledge.

From what I have read I think I have to use something like the metadata
for this table to find the type of this column, and if it is a timestamp then
I need to take the string and convert it into a timestamp before I set it
into the parameterized insert. Is this right, and are there any other
datatypes which are not implicitly converted from String to whatever is
necessary?

If it is only timestamps, why are they singled out for this special treatment?

Also there was some question about the difference between timestamps
with and without zone, mine are without should that make a difference.

Is there a HOWTO about this somewhere?

David

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Reply With Quote