# Creating postgresql schemas and tables

**URL:** <https://forum.inductiveautomation.com/t/creating-postgresql-schemas-and-tables/92024>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [June 18, 2024, 2:19pm UTC](https://forum.inductiveautomation.com/t/creating-postgresql-schemas-and-tables/92024 "2024-06-18T14:19:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Josh\_Hoover](https://avatars.discourse-cdn.com/v4/letter/j/65b543/32.png) [@Josh\_Hoover](https://forum.inductiveautomation.com/u/Josh_Hoover)\
**Post date:** [June 18, 2024, 2:19pm UTC](https://forum.inductiveautomation.com/t/creating-postgresql-schemas-and-tables/92024/1 "2024-06-18T14:19:02Z")

</div>

So, I'm attempting to use ignition scripting to create schemas and tables in postgres and am stuck. Part of my code is below (the part that gives an error):

![Snag_40d921a](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/7/57a356bdb6c09284508a68dc12662caf815dde1a.png)

I'm not sure what else to try. Any feedback will be appreciated.

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [June 18, 2024, 2:34pm UTC](https://forum.inductiveautomation.com/t/creating-postgresql-schemas-and-tables/92024/2 "2024-06-18T14:34:09Z")

</div>

Can you post the error that is being generated?

---

<div class="post-metadata">

**Author:** ![Josh\_Hoover](https://avatars.discourse-cdn.com/v4/letter/j/65b543/32.png) [@Josh\_Hoover](https://forum.inductiveautomation.com/u/Josh_Hoover)\
**Post date:** [June 18, 2024, 2:46pm UTC](https://forum.inductiveautomation.com/t/creating-postgresql-schemas-and-tables/92024/3 "2024-06-18T14:46:38Z")

</div>

Here is the error. I just changed the command from runUpdateQuery to runPrepQuery and my schema was created when using the script console. However, I get the same error as when using the runUpdateQuery command.

 ![Snag_425b964](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/4/24a1da9a8f3ecc3f401eac16594521a5717f7c51.png)

---

<div class="post-metadata">

**Author:** ![Josh\_Hoover](https://avatars.discourse-cdn.com/v4/letter/j/65b543/32.png) [@Josh\_Hoover](https://forum.inductiveautomation.com/u/Josh_Hoover)\
**Post date:** [June 18, 2024, 5:31pm UTC](https://forum.inductiveautomation.com/t/creating-postgresql-schemas-and-tables/92024/4 "2024-06-18T17:31:49Z")

</div>

I got it to work by using runPrepUpdate instead.
