01.08.2013 Views

SWENET Software Infrastructure Space Weather Data Specification ...

SWENET Software Infrastructure Space Weather Data Specification ...

SWENET Software Infrastructure Space Weather Data Specification ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>SWENET</strong> <strong>Software</strong> <strong>Infrastructure</strong> Date: 2004-10-20<br />

<strong>Space</strong> <strong>Weather</strong> <strong>Data</strong> <strong>Specification</strong> Version: 0.<br />

Annex Status: Draft<br />

On most platforms, the real type has a range of at least 1E-37 to 1E+37 with a precision of<br />

at least 6 decimal digits. The double precision type typically has a range of around 1E-<br />

307 to 1E+308 with a precision of at least 15 digits. Values that are too large or too small will<br />

cause an error. Rounding may take place if the precision of an input number is too high.<br />

Numbers too close to zero that are not representable as distinct from zero will cause an underflow<br />

error.<br />

PostgreSQL also supports the SQL-standard notations float and float(p) for specifying<br />

inexact numeric types. Here, p specifies the minimum acceptable precision in binary digits.<br />

PostgreSQL accepts float(1) to float(24) as selecting the real type, while<br />

float(25) to float(53) select double precision. Values of p outside the allowed<br />

range draw an error. float with no precision specified is taken to mean double precision.<br />

A.2 Character Types<br />

<strong>Data</strong> Type Description<br />

character(n)<br />

char(n)<br />

fixed-length, blank padded<br />

character varying(n) variable-length with limit<br />

varchar(n)<br />

text variable unlimited length<br />

Table 60: PostgreSQL Character <strong>Data</strong> Types<br />

SQL defines two primary character types: character varying(n) and character(n),<br />

where n is a positive integer. Both of these types can store strings up to n characters in<br />

length. An attempt to store a longer string into a column of these types will result in an error,<br />

unless the excess characters are all spaces, in which case the string will be truncated to the<br />

maximum length. (This somewhat bizarre exception is required by the SQL standard.) If the<br />

string to be stored is shorter than the declared length, values of type character will be<br />

space-padded; values of type character varying will simply store the shorter string.<br />

If one explicitly casts a value to character varying(n) or character(n), then an overlength<br />

value will be truncated to n characters without raising an error. (This too is required by<br />

the SQL standard.)<br />

The notations varchar(n) and char(n) are aliases for character varying(n) and<br />

character(n), respectively. character without length specifier is equivalent to character(1);<br />

if character varying is used without length specifier, the type accepts strings of<br />

any size. The latter is a PostgreSQL extension.<br />

In addition, PostgreSQL provides the text type, which stores strings of any length. Although<br />

the type text is not in the SQL standard, several other SQL database management systems<br />

have it as well.<br />

The storage requirement for data of these types is 4 bytes plus the actual string, and in case<br />

of character plus the padding. Long strings are compressed by the system automatically, so<br />

the physical requirement on disk may be less. Long values are also stored in background<br />

tables so they do not interfere with rapid access to the shorter column values. In any case,<br />

the longest possible character string that can be stored is about 1 GB. (The maximum value<br />

Project: <strong>Space</strong> <strong>Weather</strong> Pilot Project Coordination and <strong>Software</strong> <strong>Infrastructure</strong> Development<br />

Reference: R047rep026_00_07_<strong>Data</strong>_<strong>Specification</strong>_(BIRA).doc<br />

eta_max space GmbH, Richard-Wagner-Str. 1, 38106 Braunschweig, Germany<br />

Page<br />

86 / 88

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!