# SQL Release Notes

_This page documents the version history of [SQL in KDB-X](../introduction.md), including released versions, fixes, and improvements._

## 2026.10.20

- Window functions: lag, lead, nth_value added; row_number is now 1-based (was 0-based)
- Window frames: rows/range/groups between .. and ..; the default frame with order by is now running rather than whole-partition (affects sum/avg/.. and last_value)
- Window functions can be nested in expressions, used with group by, select *, aliased joins and select lists made only of windows
- Unaliased window columns are named after the argument (sum(px) -> px), no longer after the order by column
- Window functions on partitioned tables threw 'rank when order by or partition by used the partition column; like q's sums/mavg, windows restart at each partition rather than carrying over
- values (..) can be queried directly or used as a from source; column alias lists (as t (a, b)) are supported
- Group by can refer to a select-list alias
- show <setting> hung the process on kdb-x 2026.10.02 and later

## 2026.07.15

- pgwire now supports the extended query protocol

## 2025.12.16

- Improved `like`, `ilike` and POSIX match performance

## 2025.06.27

- Support for `.Q.bv`

## 2025.05.22

- Feature flag update

## 2025.01.16

- `select` on keyed tables was broken since 2024.02.09

## 2024.07.30

- Improved Tableau compatibility

## 2024.05.31

- `.s.sp` now supports keyed table arguments
- Partitioned table queries accessing linked columns with predicate matching no rows failed with `'link`

## 2024.03.01

- Implemented `limit .. offset`

## 2024.02.09

- Improved performance for `select` on wide tables

## 2023.11.20

- Query compilation/execution no longer requires full metadata of the tables involved. Only the columns mentioned will be opened, similar to q-sql
- `timespan` can be cast to numeric types

## 2023.05.30

- Proper handling of empty queries to prevent JDBC crash
- Comparison of `char` against string could throw `'type`
- `ilike` now implements case-insensitive `like`

## 2023.03.20

- Array indexing works for array-returning functions like `current_schemas()`

## 2023.02.24

- Parser support for COPY subprotocol commands, `.s.ver` bumped to 1.1
- Conversions to type `text`, including pgwire, now return full data for array types, without literal type suffix
- Metadata retrieval could fail for tables containing dictionary rows
- Evaluation of empty (or comments only) statement threw `'parse`
- Default schema `public` is no longer case sensitive

## 2022.12.19

- pgwire now supports kdb+ IPC messages of up to 1TB for data returned. Previously threw `'limit` for >2GB
- Serialization into pgwire format (done in `s.k`) is now faster, parallel and memory-efficient, for example:
    ```q
    q)n:1000000;t:([]a:n?`8;b:til n;c:"f"$til n;d:n#.z.d;e:n#.z.z;f:n#.z.p;g:n#.z.t;h:n#.Q.a)
    q)\ts .s.spf[;1b]t / internal fn to serialize 1b is binary
    1087 134218480     / was: 2528 1069486336
    ```

- In pgwire, kdb+ types `minute` and `second` now mapped to Postgres `time`, linked columns to `bigint`, and arrays/nested data to text representation
- Improved compatibility with abInitio, DBeaver
- Fixed display of type `char` in PowerBI
- Lexer now reports errors, for example:
    ```q
    q)s)1.2g,1
    'lexer unexpected:g,1
    ```

## 2022.11.11

- `extract(epoch from time|timespan)` now uses 2010.01.01 as date to work around Grafana display bug
- Grafana query builder is able to list tables
- Support for implicit join notation (was previously executed as cross join)
    ```q
    s)select * from t0,t1,t2 where t0.a=t1.b and t1.c=t2.d
    ```

## 2022.10.07

- Improved compatibility with psqlodbc for pgwire. NB: psqlodbc option `UseServerSidePrepare=0` is necessary for queries with parameters

## 2022.10.03

- `select` without aggregates was slow
- Browsing tables in Spotfire information designer produced errors
- pgwire text format now has 1us precision timestamp
- q type `minute` now mapped to pgwire `time`

## 2022.08.03

- Compatibility with Tibco Spotfire 12.0
- Expose `xbar` q function
    ```q
    s)select xbar(10,x) from qt('([]1 12 23)')
    s)select xbar('0D00:10',x) from qt('([]0D+10:21 11:32 13:43)')
    ```
