Core SQL Compatibility

Core SQL Compatibility

CedarDB implements the SQL dialect of PostgreSQL. While we are able to syntactically parse any PostgreSQL-compliant statement, not all underlying functionality is implemented yet.

This page gives a non-exhaustive overview of currently supported core SQL functionality. CedarDB strives for full PostgreSQL compatibility, and features not currently supported will be added over time.

For PostgreSQL-specific functionality, such as system table support, see the backend compatibility page.

Data Definition

Table Creation & Deletion

FeatureSupport StateDetails
CREATE TABLEYesDocumentation
DROP TABLEYes
Default ValuesYes
GENERATEDYesonly AS IDENTITY
Check ConstraintsNo
Not-Null ConstraintsYesDocumentation
Unique ConstraintsYesDocumentation
Primary KeysYesDocumentation
Foreign KeysYesWithout ON DELETE
Documentation
Named ConstraintsNo
Exclusion ConstraintsNo
System ColumnsYesOnly meaningful for tableoid and ctid

Table Modification (ALTER TABLE)

FeatureSupport StateDetails
ADD COLUMNYes
DROP COLUMNYes
ADD CHECKNo
ADD CONSTRAINTYes
ADD FOREIGN KEYYes
DROP CONSTRAINTNo
ALTER COLUMNNo
SET DEFAULTNo
DROP DEFAULTNo
COLUMN TYPENo
RENAME COLUMNYes
RENAME TOYes

Privileges

FeatureSupport StateDetails
CREATE ROLEYesDocumentation
OWNER TOYes
ALTER ROLEYesDocumentation
GRANTYesOnly GRANT role to other_role
REVOKENo
SET ROLENo
INHERITYesDocumentation
Row Security PoliciesNo

Indexes

FeatureSupport StateDetails
CREATE INDEXYesOnly B-Tree Indexes Documentation
GINNo
BRINNo
Multicolumn IndexesYesDocumentation
Ordered IndexesYesDocumentation
Unique IndexesYes
Indexes on ExpressionsNo
Partial IndexesNo

Misc

FeatureSupport StateDetails
CREATE SCHEMAYesDocumentation
DROP SCHEMANo
search_pathYesDocumentation
Table InheritanceNo
Table PartitioningYesOnly at creation, only by hash
Foreign Data WrappersNo
ViewsYesDocumentation
DatabasesYesDocumentation
Functions & ProceduresYesDocumentation
Also in cedar_script language
Custom TypesNo
TriggersNo
Prepared StatementsYes

Data Manipulation

FeatureSupport StateDetails
INSERTYesDocumentation
UPDATEYesDocumentation
DELETEYesDocumentation
TRUNCATEYesDocumentation
RETURNINGYesDocumentation
COPY FROMYesDocumentation
COPY TOYesDocumentation
ON CONFLICTYesDocumentation

Queries

FeatureSupport StateDetails
Table & View ReferencesYes
Inner JoinsYesDocumentation
Outer JoinsYesDocumentation
SemijoinsYesDocumentation
AntijoinsYes
Table FunctionsYes
Lateral SubqueriesYes
User-Specified AliasesYes
GROUP BYYesDocumentation
HAVINGYesDocumentation
GROUPING SETSYes
CUBEYes
ROLLUPYes
WINDOW FunctionsYesDocumentation
WITHYesDocumentation
WITH RECURSIVEYes
UNIONYes
UNION ALLYes
INTERSECTYes
EXCEPTYes
ORDER BYYes
LIMITYes
OFFSETYes
Table Generating FunctionYes

Data Types

Types

FeatureSupport StateDetails
arrayYesArray Documentation
bigintYesInteger Documentation
bigserialNo
bit [ (n) ]YesBit Documentation
bit varying [ (n) ]YesBit Documentation
booleanYesBoolean Documentation
boxNo
byteaYesBlob Documentation
character [ (n) ]YesText Documentation
character varying [ (n) ]YesText Documentation
cidrNo
circleNo
dateYesDate Documentation
double precisionYesDouble Documentation
inetNo
integerYesInteger Documentation
interval [ fields ] [ (p) ]YesInterval Documentation
jsonYesJSON Documentation
jsonbYesJSON Documentation
lineNo
lsegNo
macaddrNo
macaddr8No
moneyNo
numeric [ (p, s) ]YesNumeric Documentation
pathNo
pg_lsnNo
pg_snapshotNo
pointNo
polygonNo
realYesDouble Documentation
smallintYesInteger Documentation
smallserialNo
serialNo
textYesText Documentation
time [ (p) ] [ without time zone ]YesTime Documentation
time [ (p) ] with time zoneYesTime Documentation
timestamp [ (p) ] [ without time zone ]YesTimestamp Documentation
timestamp [ (p) ] with time zoneYesTimestamp Documentation
tsqueryNo
tsvectorNo
txid_snapshotNo
uuidYesUUID Documentation
xmlNo

Operators & Functions

Logical

FeatureSupport StateDetails
ANDYes
ORYes
NOTYes

Comparison

FeatureSupport StateDetails
<Yes
>Yes
<=Yes
>=Yes
=Yes
<>Yes
!=Yes
BETWEENYes
NOT BETWEENYes
IS DISTINCTYes
IS NOT DISTINCTYes
IS NULLYes
IS NOT NULLYes
IS TRUEYes
IS NOT TRUEYes
IS FALSEYes
IS NOT FALSEYes
IS UNKNOWNYes
IS NOT UNKNOWNYes

Mathematical

FeatureSupport StateDetails
+Yes
-Yes
*Yes
/Yes
%Yes
^Yes
|/Yes
||/Yes
@Yes
&Yes
|Yes
#Yes
~Yes
<<Yes
>>Yes
absYes
cbrtYes
ceilYes
degreesYes
divYes
erfNo
erfcNo
expYes
factorialNoExists as ! operand
floorYes
gcdNo
lcmNo
lnYes
logYes
log10Yes
min_scaleNo
modYes
piYes
powerYes
radiansNo
roundYes
scaleNo
signYes
sqrtYes
trim_scaleNo
truncYes
width_bucketYes
randomYes
random_normalNo
setseedNo
acosYes
acosdNo
asinYes
asindNo
atanYes
atandNo
atan2Yes
atan2dNo
cosYes
cosdNo
cotYes
cotdNo
sinYes
sindNo
tanYes
tandNo
sinhNo
coshNo
tanhNo
asinhNo
acoshNo
atanhNo

String

FeatureSupport StateDetails
||Yes
btrimYes
bit_lengthYes
char_lengthYes
lowerYes
lpadYes
ltrimYes
normalizeNo
octet_lengthYes
overlayYes
positionYes
rpadYes
rtrimYes
substringYesCurrently not supporting regular expression arguments
trimYes
upperYes
^@No
asciiYes
chrYes
concatYes
concat_wsYes
formatYes
initcapYes
leftYes
lengthYes
md5Yes
parse_identYes
quote_identYes
quote_literalYes
quote_nullableYes
regexp_countNo
regexp_instrNo
regexp_likeNo
regexp_matchYes
regexp_matchesYes
regexp_replaceYesCurrently not supporting replacing N’th match
regexp_split_to_arrayYes
regexp_split_to_tableYes
regexp_substrYes
repeatYes
replaceYes
reverseYes
rightYes
split_partYes
starts_withYes
string_to_arrayYes
string_to_tableNo
strposYes
substrYes
to_asciiNo
to_hexYes
translateYes
unistrNo

Bytea

FeatureSupport StateDetails
||Yes
bit_lengthYes
btrimYes
ltrimNo
octet_lengthYes
overlayYes
positionYes
rtrimNo
substringYes
trimYesOnly for BOTH direction
bit_countNo
get_bitNo
get_byteYes
lengthYes
md5Yes
set_bitYes
set_byteYes
sha224No
sha384No
sha512No
substrYes
convertYesOnly for UTF8
convert_fromYesOnly for UTF8
convert_toYesOnly for UTF8
encodeYes
decodeYes

Bit

FeatureSupport StateDetails
||No
&No
|No
#No
~No
<<No
>>No
bit_countYes
bit_lengthYes
lengthNo
octet_lengthYes
overlayYes
positionYes
substringYes
get_bitYes
set_bitYes

Pattern Matching

FeatureSupport StateDetails
LIKEYes
SIMILAR TOYes

Data Type Formatting

FeatureSupport StateDetails
to_charNo
to_dateNo
to_numberNo
to_timestampNo

Date/Time

FeatureSupport StateDetails
+Yes
-Yes
*Yes
/Yes
ageYes
clock_timestampYes
current_dateYes
current_timeYes
current_timestampYes
date_addNopossible with +
date_binNo
date_partYes
date_subtractNopossible with -
date_truncYesWithout timezone
extractYes
isfiniteNo
justify_daysYes
justify_hoursYes
justify_intervalYes
localtimeYes
localtimestampYes
make_dateNo
make_intervalNo
make_timeNo
make_timestampNo
make_timestamptzYes
nowYes
statement_timestampNo
timeofdayNo
transaction_timestampNo
to_timestampYes
OVERLAPSYes
EXTRACTYesWithout timezone

Enum

FeatureSupport StateDetails
enum_firstNo
enum_lastNo
enum_rangeNo

Geometric

FeatureSupport StateDetails
+No
-No
*No
/No
@-@No
@@No
#No
##No
<->No
@>No
<@No
&&No
<<No
>>No
&<No
&>No
<<|No
|>>No
&<|No
|&>No
<^No
>^No
?#No
?-No
?|No
?-|No
?||No
~=No
areaNo
centerNo
diagonalNo
diameterNo
heightNo
isclosedNo
isopenNo
lengthNo
npointsNo
pcloseNo
popenNo
radiusNo
slopeNo
widthNo
boxNo
bounding_boxNo
circleNo
lineNo
lsegNo
pathNo
pointNo
polygonNo

Network

FeatureSupport StateDetails
<<No
<<=No
>>No
>>=No
&&No
~No
&No
|No
+No
-No
abbrevNo
broadcastNo
familyNo
hostNo
hostmaskNo
inet_mergeNo
inet_same_familyNo
masklenNo
netmaskNo
networkNo
set_masklenNo
textNo

Text Search

FeatureSupport StateDetails
@@No
||No
&&No
!!No
<->No
@>No
<@No
array_to_tsvectorNo
get_current_ts_configNo
lengthNo
numnodeNo
plainto_tsqueryNo
phraseto_tsqueryNo
websearch_to_tsqueryNo
querytreeNo
setweightNo
stripNo
to_tsqueryNo
to_tsvectorNo
json(b)_to_tsvectorNo
ts_deleteNo
ts_filterNo
ts_headlineNo
ts_rankNo
ts_rank_cdNo
ts_rewriteNo
tsquery_phraseNo
tsvector_to_arrayNo
unnestNo
ts_debugNo
ts_lexizeNo
ts_parseNo
ts_token_typeNo
ts_statNo

UUID

FeatureSupport StateDetails
get_random_uuidYes
uuid_extract_timestampNo
uuid_extract_versionNo

XML

FeatureSupport StateDetails
xmltextNo
xmlcommentNo
xmlconcatNo
xmlelementNo
xmlforestNo
xmlpiNo
xmlrootNo
xmlaggNo
IS DOCUMENTNo
IS NOT DOCUMENTNo
XMLEXISTSNo
xml_is_well_formedNo
xpathNo
xpath_existsNo
XMLTABLENo

JSON

FeatureSupport StateDetails
->Yes
->>Yes
#>No
#>>No
@>No
<@No
?No
?|No
?&No
||No
-No
#-No
@?No
@@No
to_jsonNo
to_jsonbNo
array_to_jsonNo
json_arrayNo
row_to_jsonNo
json_build_arrayNo
jsonb_build_arrayNo
json_build_objectNo
jsonb_build_objectNo
json_objectNo
jsonb_objectNo
IS JSONNo
json_array_elementsYes
jsonb_array_elementsYes
json_array_elements_textNo
jsonb_array_elements_textNo
json_array_lengthYes
jsonb_array_lengthNo
json_eachNo
jsonb_eachNo
json_each_textNo
jsonb_each_textNo
json_object_keysNo
jsonb_object_keysNo
json_populate_recordNo
jsonb_populate_recordNo
json_populate_recordsetNo
jsonb_populate_recordsetNo
json_to_recordNo
jsonb_to_recordNo
json_to_recordsetNo
jsonb_to_recordsetNo
jsonb_setNo
jsonb_set_laxNo
jsonb_insertNo
json_strip_nullsNo
jsonb_strip_nullsNo
json_pathNo

Sequence Manipulation

FeatureSupport StateDetails
nextvalYesOnly with sequence ID
setvalNo
currvalNo
lastvalNo

Conditional

FeatureSupport StateDetails
CASEYes
COALESCEYes
NULLIFYes
GREATESTYes
LEASTYes

Array

FeatureSupport StateDetails
@>Yes
<@Yes
&&No
||YesNot for multidimensional
array_appendYes
array_catYes
array_dimsYes
array_fillYes
array_lowerYes
array_ndimsYes
array_positionYes
array_positionsYes
array_prependYes
array_removeYes
array_replaceYes
array_sampleNo
array_shuffleNo
array_to_stringYes
array_upperYes
array_cardinalityYes
trim_arrayYes
unnestYesNo multi-array expansion

Range

FeatureSupport StateDetails
@>No
<@No
&&No
<<No
>>No
&<No
&>No
-|-No
+No
*No
-No
lowerNo
upperNo
isemptyNo
lower_incNo
upper_incNo
lower_infNo
upper_infNo
range_mergeNo
multirangeNo
unnestNo

Aggregate Functions

Generic
FeatureSupport StateDetails
any_valueYesAggregate Function Documentation
array_aggYesAggregate Function Documentation
avgYesAggregate Function Documentation
bit_andYesAggregate Function Documentation
bit_orYesAggregate Function Documentation
bit_xorYesAggregate Function Documentation
bool_andYesAggregate Function Documentation
bool_orYesAggregate Function Documentation
count(*)YesAggregate Function Documentation
count(“any”)YesAggregate Function Documentation
json(b)_aggNo
json(b)_objectaggNo
json(b)_object_aggNo
json_arrayaggNo
maxYesAggregate Function Documentation
minYesAggregate Function Documentation
range(_intersect)_aggNo
string_aggYesAggregate Function Documentation
sumYesAggregate Function Documentation
xmlaggNo
Statistical
FeatureSupport StateDetails
corrNo
covar_popYesAggregate Function Documentation
covar_sampYesAggregate Function Documentation
regr_avgxYesAggregate Function Documentation
regr_avgyYesAggregate Function Documentation
regr_countYesAggregate Function Documentation
regr_interceptYesAggregate Function Documentation
regr_r2YesAggregate Function Documentation
regr_slopeYesAggregate Function Documentation
regr_sxxYesAggregate Function Documentation
regr_sxyYesAggregate Function Documentation
regr_syyNo
stddevYesAggregate Function Documentation
stddev_popYesAggregate Function Documentation
stddev_sampYesAggregate Function Documentation
varianceYesAggregate Function Documentation
var_popYesAggregate Function Documentation
var_sampYesAggregate Function Documentation
Ordered-Set
FeatureSupport StateDetails
modeYesAggregate Function Documentation
percentile_contYesAggregate Function Documentation
percentile_discYesAggregate Function Documentation

Window

FeatureSupport StateDetails
row_numberYes
rankYes
dense_rankYes
percent_rankYes
cume_distYes
ntileYes
lagYes
leadYes
first_valueYes
last_valueYes
nth_valueYes

Subquery

FeatureSupport StateDetails
EXISTSYes
INYes
NOT INYes
ANY/SOMEYes
ALLYes

Array Comparison

FeatureSupport StateDetails
EXISTSYes
INYes
NOT INYes
ANY/SOMEYes
ALLYes

Set Returning

FeatureSupport StateDetails
generate_seriesYes
generate_subscriptNo