# Cannot insert into table I created

**URL:** <https://community.cratedb.com/t/cannot-insert-into-table-i-created/1873>\
**Category:** CrateDB\
**Created:** [October 2, 2024, 11:44am UTC](https://community.cratedb.com/t/cannot-insert-into-table-i-created/1873 "2024-10-02T11:44:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ness](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/ness/32/1292_2.png) [@ness](https://community.cratedb.com/u/ness)\
**Post date:** [October 2, 2024, 11:44am UTC](https://community.cratedb.com/t/cannot-insert-into-table-i-created/1873/1 "2024-10-02T11:44:49Z")

</div>

Using http interface, eg via Crash CLI, I see strange behaviour.

cr\> create table logs5(pid varchar(10), process varchar(10));  
CREATE OK, 1 row affected (0.255 sec)

cr\> insert into logs5(pid, process) VALUES (“a”,“b”);  
MissingPrivilegeException[Missing privilege for user ‘xyz’]

If I manually

grant all on TABLE doc.logs5 to xyz;

it makes no difference.

This seems to be different from what happens using the postgres interface.

What am I missing here?

Thank you.

---

<div class="post-metadata">

**Author:** ![hernanc](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/hernanc/32/676_2.png) [@hernanc](https://community.cratedb.com/u/hernanc)\
**Post date:** [October 2, 2024, 11:48am UTC](https://community.cratedb.com/t/cannot-insert-into-table-i-created/1873/2 "2024-10-02T11:48:08Z")

</div>

Hi,  
Could you try again with single quotes around `a` and `b` in the `VALUES`?

---

<div class="post-metadata">

**Author:** ![ness](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/ness/32/1292_2.png) [@ness](https://community.cratedb.com/u/ness)\
**Post date:** [October 2, 2024, 11:57am UTC](https://community.cratedb.com/t/cannot-insert-into-table-i-created/1873/3 "2024-10-02T11:57:44Z")

</div>

Thanks for prompt reply. Yes that worked - I’m kicking myself for such a silly mistake - but obviously the privilige error threw me… is that catchall error that can mean many things?

---

<div class="post-metadata">

**Author:** ![hernanc](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/hernanc/32/676_2.png) [@hernanc](https://community.cratedb.com/u/hernanc)\
**Post date:** [October 2, 2024, 12:01pm UTC](https://community.cratedb.com/t/cannot-insert-into-table-i-created/1873/4 "2024-10-02T12:01:47Z")

</div>

The issue here is that `"a"` could refer to a function in one of the schemas in your `search_path`.  
If you check `SHOW search_path;` there may be some schema to which user xyz does not have access.

---

<div class="post-metadata">

**Author:** ![ness](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/ness/32/1292_2.png) [@ness](https://community.cratedb.com/u/ness)\
**Post date:** [October 2, 2024, 3:25pm UTC](https://community.cratedb.com/t/cannot-insert-into-table-i-created/1873/5 "2024-10-02T15:25:18Z")

</div>

Much appreciated @hernanc
