# Issue with the Varchar type in postgresql

**URL:** <https://community.grafana.com/t/issue-with-the-varchar-type-in-postgresql/37645>\
**Category:** General\
**Created:** [October 7, 2020, 7:29pm UTC](https://community.grafana.com/t/issue-with-the-varchar-type-in-postgresql/37645 "2020-10-07T19:29:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mercadofelipe87](https://avatars.discourse-cdn.com/v4/letter/m/7ea924/32.png) [@mercadofelipe87](https://community.grafana.com/u/mercadofelipe87)\
**Post date:** [October 7, 2020, 7:29pm UTC](https://community.grafana.com/t/issue-with-the-varchar-type-in-postgresql/37645/1 "2020-10-07T19:29:55Z")

</div>

hi im new in grafana and when i try to put the sql in the query editor it bring me this message

> Column metric must be of type UNKNOWN, TEXT, VARCHAR, CHAR. metric column name: metric type: VARCHAR but datatype is

betwen the \<\> is nil  
the sql i tried is this

> select  
> now() as “time”,  
> count(\*) as cnt,  
> estado as metric  
> from owner.table  
> group by estado;

if you can help me, i would appreciate you

---

<div class="post-metadata">

**Author:** ![mercadofelipe87](https://avatars.discourse-cdn.com/v4/letter/m/7ea924/32.png) [@mercadofelipe87](https://community.grafana.com/u/mercadofelipe87)\
**Post date:** [October 8, 2020, 4:01pm UTC](https://community.grafana.com/t/issue-with-the-varchar-type-in-postgresql/37645/2 "2020-10-08T16:01:00Z")

</div>

the solution was to put a is not null in the metric

select  
now() as “time”,  
count(\*) as cnt,  
estado as metric  
from owner.table  
group by estado  
where estado is not null;
