# Problem with PostgreSQL execution sleep

**URL:** <https://community.integray.com/t/problem-with-postgresql-execution-sleep/186>\
**Category:** Platform discussions\
**Created:** [October 18, 2023, 2:40pm UTC](https://community.integray.com/t/problem-with-postgresql-execution-sleep/186 "2023-10-18T14:40:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Moerani](https://avatars.discourse-cdn.com/v4/letter/m/e79b87/32.png) [@Moerani](https://community.integray.com/u/Moerani)\
**Post date:** [October 18, 2023, 2:40pm UTC](https://community.integray.com/t/problem-with-postgresql-execution-sleep/186/1 "2023-10-18T14:40:34Z")

</div>

Hi, my Postgre query is SELECT pg\_sleep(‘10’);  
But it failed with this errors:  
Processing failed.  
Failed to execute SQL statement.  
Invalid storage type: DBNull.

What is wrong? Can you help me, please?

---

<div class="post-metadata">

**Author:** ![Moerani](https://avatars.discourse-cdn.com/v4/letter/m/e79b87/32.png) [@Moerani](https://community.integray.com/u/Moerani)\
**Post date:** [October 19, 2023, 7:21am UTC](https://community.integray.com/t/problem-with-postgresql-execution-sleep/186/2 "2023-10-19T07:21:37Z")

</div>

DO-block helped:  
DO $$  
BEGIN  
perform pg\_sleep(10);  
END $$;

---

<div class="post-metadata">

**Author:** ![tomas](https://avatars.discourse-cdn.com/v4/letter/t/439d5e/32.png) [@tomas](https://community.integray.com/u/tomas)\
**Post date:** [October 19, 2023, 11:23am UTC](https://community.integray.com/t/problem-with-postgresql-execution-sleep/186/3 "2023-10-19T11:23:42Z")

</div>

Yes, if you want to execute “non-SQL” code co called PLSQL then you have to use ` do $$ begin end $$;` block. Nice postgresql tutorial is here: [https://www.postgresqltutorial.com](https://www.postgresqltutorial.com)

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.integray.com/u/system)\
**Post date:** [October 26, 2023, 11:23am UTC](https://community.integray.com/t/problem-with-postgresql-execution-sleep/186/4 "2023-10-26T11:23:53Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
