5

I am looking at list of SQL keywords here https://www.postgresql.org/docs/current/sql-keywords-appendix.html

There are some single letter keywords there. I cannot find any information about them. Where can I find the information and what are these for?

Examples, A, C, F, G, K, M, P, T.

1 Answer 1

6

Checking my copy (of a draft) of the SQL standard (version 2011), I see that K, M, G, T, P are mentioned in section 5.2 <token> and <separator>:

<large object length token> ::=
  <digit>... <multiplier>

<multiplier> ::=
    K
  | M 
  | G
  | T
  | P

and they obviously mean Kilo, Mega, Giga, Tera, Peta. They are explained in section 6.1 <data type>, Syntax Rules 9:

9) The numeric value of a <large object length> LOL is determined as follows.  
Case:  
    a)  If LOL immediately contains <unsigned integer> and does not immediately 
    contain <multiplier>, then the numeric value of <large object length> is the
    numeric value of the specified <unsigned integer>.  
    b)  If LOL immediately contains <large object length token> or immediately 
    contains <unsigned integer> and <multiplier>, then let D be the value of
    the specified <unsigned integer> or the numeric value of the sequence of 
    <digit>s of <large object length token> interpreted as an <unsigned integer>. 
    The numeric value of LOL is the numeric value resulting from the 
    multiplication of D and MS, where MS is:  
        i) If <multiplier> is K, then 1,024.  
        ii) If <multiplier> is M, then 1,048,576.  
        iii) If <multiplier> is G, then 1,073,741,824.  
        iv) If <multiplier> is T, then 1,099,511,627,776.  
        v) If <multiplier> is P, then 1,125,899,906,842,624.

C and M are mentioned in 10.2 <language clause>:

<language clause> ::=
  LANGUAGE <language name>

<language name> ::=
    ADA
  | C
  | COBOL
  | FORTRAN
  | M | MUMPS
  | PASCAL
  | PLI
  | SQL

I haven't found A. It might have been in older versions of the SQL standard and then removed or might have been added in later versions.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.