Identifiers

In Materialize, identifiers are used to refer to columns and database objects like sources, views, and indexes.

Naming restrictions

  • The first character of an identifier must be an ASCII letter (a-z and A-Z), an underscore (_), or any non-ASCII character.

  • The remaining characters of an identifier must be ASCII letters (a-z and A-Z), ASCII digits (0-9), underscores (_), dollar signs ($), or any non-ASCII characters.

You can circumvent any of the above rules by double-quoting the the identifier, e.g. "123_source" or "fun_source_@". All characters inside a quoted identifier are taken literally, except that double-quotes must be escaped by writing two adjacent double-quotes, as in "includes""quote".

Case sensitivity

Materialize performs case folding (the caseless comparison of text) for identifiers, which means that identifiers are effectively case-insensitive (foo is the same as FOO is the same as fOo). This can cause issues when column names come from data sources which do support case-sensitive names, such as Avro-formatted sources or CSV headers.

To avoid conflicts, double-quote all field names ("field_name") when working with case-sensitive sources.

Keyword collision

Materialize is very permissive with accepting SQL keywords as identifiers (e.g. offset, user). If Materialize cannot use a keyword as an identifier in a particular location, it throws a syntax error. You can wrap the identifier in double quotes to force Materialize to interpret the word as an identifier instead of a keyword.

For example, SELECT offset is invalid, because it looks like a mistyping of SELECT OFFSET <n>. You can wrap the identifier in double quotes, as in SELECT "offset", to resolve the error.

We recommend that you avoid using keywords as identifiers whenever possible, as the syntax errors that result are not always obvious.

The current keywords are listed below.

  • ACCESS
  • ACKS
  • ADDRESS
  • ADDRESSES
  • ALL
  • ALTER
  • AND
  • ANY
  • ARN
  • ARRANGEMENT
  • ARRAY
  • AS
  • ASC
  • AT
  • AUCTION
  • AUTHORITY
  • AVAILABILITY
  • AVRO
  • AWS
  • BEGIN
  • BETWEEN
  • BIGINT
  • BOOLEAN
  • BOTH
  • BPCHAR
  • BROKER
  • BROKERS
  • BUCKET
  • BY
  • BYTES
  • CASCADE
  • CASE
  • CAST
  • CERTIFICATE
  • CHAIN
  • CHAR
  • CHARACTER
  • CHARACTERISTICS
  • CHECK
  • CLIENT
  • CLOSE
  • CLUSTER
  • CLUSTERS
  • COALESCE
  • COLLATE
  • COLUMNS
  • COMMIT
  • COMMITTED
  • COMPACTION
  • COMPRESSION
  • COMPUTE
  • COMPUTECTL
  • CONFLUENT
  • CONNECTION
  • CONNECTIONS
  • CONSTRAINT
  • COPY
  • COUNT
  • COUNTER
  • CREATE
  • CROSS
  • CSV
  • CURRENT
  • CURSOR
  • DATABASE
  • DATABASES
  • DATUMS
  • DAY
  • DAYS
  • DEALLOCATE
  • DEBEZIUM
  • DEBUG
  • DEBUGGING
  • DEC
  • DECIMAL
  • DECLARE
  • DECORRELATED
  • DEFAULT
  • DELETE
  • DELIMITED
  • DELIMITER
  • DESC
  • DETAILS
  • DISCARD
  • DISCOVER
  • DISTINCT
  • DOT
  • DOUBLE
  • DROP
  • EFFORT
  • ELEMENT
  • ELSE
  • ENABLE
  • END
  • ENDPOINT
  • ENFORCED
  • ENVELOPE
  • ESCAPE
  • EXCEPT
  • EXECUTE
  • EXISTS
  • EXPECTED
  • EXPLAIN
  • EXPOSE
  • EXTRACT
  • FACTOR
  • FALSE
  • FETCH
  • FIELDS
  • FILTER
  • FIRST
  • FLOAT
  • FOLLOWING
  • FOR
  • FOREIGN
  • FORMAT
  • FORWARD
  • FROM
  • FULL
  • FULLNAME
  • GENERATOR
  • GREATEST
  • GROUP
  • GROUPS
  • GZIP
  • HAVING
  • HEADER
  • HEADERS
  • HOLD
  • HOST
  • HOUR
  • HOURS
  • ID
  • IDEMPOTENCE
  • IDLE
  • IF
  • IGNORE
  • ILIKE
  • IN
  • INCLUDE
  • INDEX
  • INDEXES
  • INFO
  • INLINE
  • INNER
  • INSERT
  • INT
  • INTEGER
  • INTERSECT
  • INTERVAL
  • INTO
  • INTROSPECTION
  • IS
  • ISNULL
  • ISOLATION
  • JOIN
  • JSON
  • KAFKA
  • KEY
  • KEYS
  • KINESIS
  • LAST
  • LATERAL
  • LATEST
  • LEADING
  • LEAST
  • LEFT
  • LEVEL
  • LIKE
  • LIMIT
  • LIST
  • LOAD
  • LOCAL
  • LOG
  • LOGICAL
  • LOGIN
  • MAP
  • MATCHING
  • MATERIALIZE
  • MATERIALIZED
  • MAX
  • MECHANISMS
  • MERGE
  • MESSAGE
  • METADATA
  • MINUTE
  • MINUTES
  • MODE
  • MONTH
  • MONTHS
  • MS
  • MUTUALLY
  • NAME
  • NAMES
  • NATURAL
  • NEXT
  • NO
  • NOLOGIN
  • NONE
  • NOSUPERUSER
  • NOT
  • NOTICE
  • NOTIFICATIONS
  • NULL
  • NULLIF
  • NULLS
  • OBJECTS
  • OF
  • OFFSET
  • ON
  • ONLY
  • OPERATOR
  • OPTIMIZED
  • OPTIMIZER
  • OPTIONS
  • OR
  • ORDER
  • ORDINALITY
  • OUTER
  • OVER
  • PARTITION
  • PASSWORD
  • PHYSICAL
  • PLAN
  • PLANS
  • PORT
  • POSITION
  • POSTGRES
  • PRECEDING
  • PRECISION
  • PREFIX
  • PREPARE
  • PRIMARY
  • PRIVATELINK
  • PROGRESS
  • PROTOBUF
  • PUBLICATION
  • QUERY
  • QUOTE
  • RAISE
  • RANGE
  • RAW
  • READ
  • REAL
  • RECURSIVE
  • REFERENCES
  • REFRESH
  • REGEX
  • REGION
  • REGISTRY
  • RENAME
  • REPEATABLE
  • REPLACE
  • REPLICA
  • REPLICAS
  • REPLICATION
  • RESET
  • RESTRICT
  • RETENTION
  • RETURNING
  • RIGHT
  • ROLE
  • ROLES
  • ROLLBACK
  • ROTATE
  • ROW
  • ROWS
  • S3
  • SASL
  • SCALE
  • SCAN
  • SCHEMA
  • SCHEMAS
  • SCRIPT
  • SECOND
  • SECONDS
  • SECRET
  • SECRETS
  • SEED
  • SELECT
  • SEQUENCES
  • SERIALIZABLE
  • SERVICE
  • SESSION
  • SET
  • SHOW
  • SINK
  • SINKS
  • SIZE
  • SMALLINT
  • SNAPSHOT
  • SOME
  • SOURCE
  • SOURCES
  • SQS
  • SSH
  • SSL
  • START
  • STDIN
  • STDOUT
  • STORAGECTL
  • STRATEGY
  • STRING
  • SUBSCRIBE
  • SUBSOURCE
  • SUBSTRING
  • SUPERUSER
  • SYSTEM
  • TABLE
  • TABLES
  • TAIL
  • TEMP
  • TEMPORARY
  • TEST
  • TEXT
  • THEN
  • TICK
  • TIES
  • TIME
  • TIMELINE
  • TIMEOUT
  • TIMESTAMP
  • TO
  • TOKEN
  • TOPIC
  • TPCH
  • TRACE
  • TRAILING
  • TRANSACTION
  • TRIM
  • TRUE
  • TUNNEL
  • TYPE
  • TYPES
  • UNBOUNDED
  • UNCOMMITTED
  • UNION
  • UNIQUE
  • UNKNOWN
  • UP
  • UPDATE
  • UPSERT
  • URL
  • USER
  • USERNAME
  • USERS
  • USING
  • VALUE
  • VALUES
  • VARCHAR
  • VARYING
  • VIEW
  • VIEWS
  • WARNING
  • WHEN
  • WHERE
  • WINDOW
  • WIRE
  • WITH
  • WITHOUT
  • WORK
  • WORKERS
  • WRITE
  • YEAR
  • YEARS
  • ZONE
  • ZONES
Back to top ↑