[TAP] data type for column metadata

Patrick Dowler patrick.dowler at nrc-cnrc.gc.ca
Tue Mar 24 14:30:42 PDT 2009


On 2009-03-24 11:36:23 Rob Seaman wrote:
> On Mar 24, 2009, at 11:21 AM, Patrick Dowler wrote:
> > PS-you still have to know the datatype to write a syntactically
> > correct query :-)
>
> Which is why a sexagesimal value is a floating point number (a two
> level base-60 fraction), not a string.

At an underlying level it is true that a timestamp is a number (amount of time 
since epoch), but that is not relevant to writing a query. You cannot do:

SELECT * FROM someTable WHERE someDate <= 100.0

You get a type-clash. That is because an RDBMS does have a timestamp type and 
has to be able to convert the two arguments to the operand to the same type 
for comparison. Hence you have to know it is a timestamp in order to know to 
write the other argument correctly. Furthermore, in ADQL (SQL) that other 
argument is expressed as a string, eg:

SELECT * FROM someTable WHERE someDate <= '2009-01-01 01:02:03.4'

In terms of TAP I recall that we specify that the format of the constant is 
iso8601 and if we haven't we need to specify exactly which variant(s) are 
allowed. 
-- 

Patrick Dowler
Tel/Tél: (250) 363-0044
Canadian Astronomy Data Centre
National Research Council Canada
5071 West Saanich Road
Victoria, BC V9E 2M7

Centre canadien de donnees astronomiques
Conseil national de recherches Canada
5071, chemin West Saanich
Victoria (C.-B.) V9E 2M7



More information about the dal mailing list