# Multi-Value Variable PostgreSQL

**URL:** <https://community.grafana.com/t/multi-value-variable-postgresql/11670>\
**Category:** PostgreSQL\
**Tags:** postgres\
**Created:** [October 31, 2018, 10:15am UTC](https://community.grafana.com/t/multi-value-variable-postgresql/11670 "2018-10-31T10:15:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![millaw](https://avatars.discourse-cdn.com/v4/letter/m/7993a0/32.png) [@millaw](https://community.grafana.com/u/millaw)\
**Post date:** [October 31, 2018, 10:15am UTC](https://community.grafana.com/t/multi-value-variable-postgresql/11670/1 "2018-10-31T10:15:08Z")

</div>

Hello guys!

I use Grafana with PostgreSQL as data source. For a dashboard, I have defined a Multi-value variable named $sdtype which selects distinct values from a column called “servicedeliverytype”. I am trying to use it as part of a query: …WHERE servicedeliverytype = ($sdtype);

It properly displays a graph when I choose the variable to be just one value in the dropdown menu, but when I want it to be several values, the error: “pq: operator does not exist: character varying = record” arises. Is anyone familiar with this kind of problem and might help? I would highly appreciate 🙂

Kind regards, Milla

---

<div class="post-metadata">

**Author:** ![jangaraj](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/jangaraj/32/39197_2.png) [@jangaraj](https://community.grafana.com/u/jangaraj)\
**Post date:** [October 31, 2018, 10:30am UTC](https://community.grafana.com/t/multi-value-variable-postgresql/11670/2 "2018-10-31T10:30:57Z")

</div>

Use the IN comparison operator rather than = to match against multiple values.

This and other good tips are mentioned in the doc [http://docs.grafana.org/features/datasources/postgres/](http://docs.grafana.org/features/datasources/postgres/)

---

<div class="post-metadata">

**Author:** ![millaw](https://avatars.discourse-cdn.com/v4/letter/m/7993a0/32.png) [@millaw](https://community.grafana.com/u/millaw)\
**Post date:** [November 5, 2018, 5:08pm UTC](https://community.grafana.com/t/multi-value-variable-postgresql/11670/3 "2018-11-05T17:08:49Z")

</div>

Thanks a lot for your help! 🙂
