# SQL not available in segment filtering

**URL:** <https://community.forestadmin.com/t/sql-not-available-in-segment-filtering/6689>\
**Category:** Help me!\
**Tags:** howtos, typescript\
**Created:** [September 21, 2023, 12:21pm UTC](https://community.forestadmin.com/t/sql-not-available-in-segment-filtering/6689 "2023-09-21T12:21:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vit](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/vit/32/6507_2.png) [@vit](https://community.forestadmin.com/u/vit)\
**Post date:** [September 21, 2023, 12:21pm UTC](https://community.forestadmin.com/t/sql-not-available-in-segment-filtering/6689/1 "2023-09-21T12:21:34Z")

</div>

![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/a/a8ed598fb9ee93e84c994d07f5c4f0eeab50f0ca.png)

## Feature(s) impacted

Creating segments

## Observed behavior

I create a new segment and want to add a filter using SQL. But this option is unavaiable, I can’t switch to SQL, there’s no such button. According to the documentation, I should have had this option as my database is postgres.

## Expected behavior

Have a button to switch from integrated filters/SQL and to be able to filter data using SQL.

## Context

- Agent (forest package) name & version:  
“@forestadmin/agent”: “^1.10.0”,  
“@forestadmin/datasource-sql”: “^1.6.6”,  
node 16.16.0  
typescript 4.8.4
- Database type: postgres

---

<div class="post-metadata">

**Author:** ![GuillaumeGautreau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/guillaumegautreau/32/557_2.png) [@GuillaumeGautreau](https://community.forestadmin.com/u/GuillaumeGautreau)\
**Post date:** [September 21, 2023, 12:38pm UTC](https://community.forestadmin.com/t/sql-not-available-in-segment-filtering/6689/2 "2023-09-21T12:38:47Z")

</div>

Hello @vit,

This feature is not compatible with `@forestadmin/agent` at the moment.

You can either use the filters that are displayed in the UI, or create a [segment directly in the code](https://docs.forestadmin.com/developer-guide-agents-nodejs/agent-customization/segments), where you have full control of the requested elements.

I’ll add this feedback to our product board in order to have it prioritized.
