:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
HogQL bytecode changelog
2026-10-15 - 1.0.72
Added sha256HmacBase64Key to the standard library. No bytecode operations changed.
sha256HmacBase64Key(key, data, encoding) # HMAC-SHA256 of data, key is base64, encoding defaults to 'hex'
The function decodes the key from base64 and uses the raw bytes as the HMAC key. Svix-style webhook
secrets (whsec_...) are random bytes, so sha256HmacChain cannot verify them: it uses the UTF-8
bytes of a string key. The key is accepted with or without base64 padding. encoding is one of
hex, base64, base64url, or binary.
2026-09-28 - 1.0.71
range checks the requested length against the memory limit before it builds the array, as the
Python VM does. A range past the limit fails with the Memory limit ... exceeded error. No bytecode
operations changed.
2026-09-07 - 1.0.70
Eleven standard library functions accept the trailing arguments that HogQL accepts. No bytecode operations changed.
Version 1.0.69 started to enforce a maxArgs limit that no dispatch path had ever checked. Several
limits were below the HogQL signature for the same name, so a call that runs in an insight failed in
Hog:
round(19.99, 2) # and floor
now('UTC') # and toString, toStartOfDay, toStartOfWeek, dateTrunc
position('abc', 'b', 1) # and positionCaseInsensitive
arraySort(arr, x) # and arrayReverseSort
Each of these runs again. The trailing argument is accepted and ignored, which is what the VM did before 1.0.69.
range keeps its limit of two arguments. HogQL takes a step argument, and neither VM implements one.
JSONHas also accepts a single argument with no path components, matching HogQL and the existing
implementation.
See Hog function argument counts for the remaining differences from HogQL.
2026-08-27 - 1.0.69
The VM checks the argument count of a standard library function before it calls it. No bytecode operations changed.
A call with too few or too many arguments fails with Function <name> requires at least N arguments
or Function <name> requires at most N arguments. The VM applied this check only to a standard
library function held in a variable. A direct call skipped it and ran with the wrong number of
arguments.
Three functions now accept argument counts that they always supported but that the VM refused:
jsonStringify(value, indent) # second argument indents the output
JSONLength(value) # path arguments are optional
and(a), or(a, b, c) # both take one or more arguments
2026-08-04 - 1.0.68
Added SHA-1 primitives to the standard library. No bytecode operations changed.
sha1Hex(data) # SHA-1 of a string, hex encoded
sha1(data, encoding) # SHA-1 of a string, encoding defaults to 'hex'
sha1HmacChainHex(data) # HMAC-SHA1 chained over an array of strings, hex encoded
sha1HmacChain(data, encoding) # same, encoding defaults to 'hex'
encoding is one of hex, base64, base64url, or binary, matching md5, sha256, and
sha256HmacChain. A two element chain is a plain HMAC-SHA1 of a key and a message, which is what
webhook signature verification needs.
SHA-1 is broken for collision resistance and must not be picked for new work. HMAC-SHA1 is still sound for message authentication, and it is here only because some vendors sign their webhooks with it.
2023-06-30 - 1.0.2
Rolled back cohort matching instructions.
2023-06-28 - 1.0.1
Added cohort matching instructions.
IN_COHORT = 27 # [val2, val1, IREGEX] # val1 in cohort val2
NOT_IN_COHORT = 28 # [val2, val1, NOT_IREGEX] # val1 not in cohort val2
2023-06-28 - 1.0.0 - First version
Operations added
FIELD = 1 # [arg3, arg2, arg1, FIELD, 3] # arg1.arg2.arg3
CALL = 2 # [arg2, arg1, CALL, 'concat', 2] # concat(arg1, arg2)
AND = 3 # [val3, val2, val1, AND, 3] # val1 and val2 and val3
OR = 4 # [val3, val2, val1, OR, 3] # val1 or val2 or val3
NOT = 5 # [val, NOT] # not val
PLUS = 6 # [val2, val1, PLUS] # val1 + val2
MINUS = 7 # [val2, val1, MINUS] # val1 - val2
MULTIPLY = 8 # [val2, val1, MULTIPLY] # val1 * val2
DIVIDE = 9 # [val2, val1, DIVIDE] # val1 / val2
MOD = 10 # [val2, val1, MOD] # val1 % val2
EQ = 11 # [val2, val1, EQ] # val1 == val2
NOT_EQ = 12 # [val2, val1, NOT_EQ] # val1 != val2
GT = 13 # [val2, val1, GT] # val1 > val2
GT_EQ = 14 # [val2, val1, GT_EQ] # val1 >= val2
LT = 15 # [val2, val1, LT] # val1 < val2
LT_EQ = 16 # [val2, val1, LT_EQ] # val1 <= val2
LIKE = 17 # [val2, val1, LIKE] # val1 like val2
ILIKE = 18 # [val2, val1, ILIKE] # val1 ilike val2
NOT_LIKE = 19 # [val2, val1, NOT_LIKE] # val1 not like val2
NOT_ILIKE = 20 # [val2, val1, NOT_ILIKE] # val1 not ilike val2
IN = 21 # [val2, val1, IN] # val1 in val2
NOT_IN = 22 # [val2, val1, NOT_IN] # val1 not in val2
REGEX = 23 # [val2, val1, REGEX] # val1 =~ val2
NOT_REGEX = 24 # [val2, val1, NOT_REGEX] # val1 !~ val2
IREGEX = 25 # [val2, val1, IREGEX] # val1 =~* val2
NOT_IREGEX = 26 # [val2, val1, NOT_IREGEX] # val1 !~* val2
TRUE = 29 # [TRUE] # true
FALSE = 30 # [FALSE] # false
NULL = 31 # [NULL] # null
STRING = 32 # [STRING, 'text'] # 'text'
INTEGER = 33 # [INTEGER, 123] # 123
FLOAT = 34 # [FLOAT, 123.12] # 123.01
Functions added
concat(...) # concat('test: ', 1, null, '!') == 'test: 1!'
match(string, pattern) # match('fish', '$fi.*') == true
toString(val) # toString(true) == 'true'
toInt(val) # toInt('123') == 123
toFloat(val) # toFloat('123.2') == 123.2
toUUID(val) # toUUID('string') == 'string'