Skip to content

Latest commit

 

History

History
62 lines (47 loc) · 738 Bytes

constant.md

File metadata and controls

62 lines (47 loc) · 738 Bytes

Constants

Unicode Escapes

SELECT U&'\0061 \0062';
SELECT U&'!0061 !0062' UESCAPE '!';

+------------+
| ?column?   |
|------------|
| a b        |
+------------+

Dollar-quoted

SELECT $$Dianne's horse$$;
$SomeTag$Dianne's horse$SomeTag$

Bit-string

SELECT B'1001';

SELECT X'1FF';

+--------------+
| ?column?     |
|--------------|
| 000111111111 |
+--------------+

Numeric Constants

SELECT 5e2;

+------------+
|   ?column? |
|------------|
|      500.0 |
+------------+

SELECT 1.925e-3;

+------------+
|   ?column? |
|------------|
|   0.001925 |
+------------+

SELECT REAL '1.23'; -- force casting it

+----------+
|   float4 |
|----------|
|     1.23 |
+----------+