# Postgres and Recipe Addition

**URL:** <https://forum.inductiveautomation.com/t/postgres-and-recipe-addition/7402>\
**Category:** 3rd Party Modules\
**Created:** [October 11, 2013, 11:20pm UTC](https://forum.inductiveautomation.com/t/postgres-and-recipe-addition/7402 "2013-10-11T23:20:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![gekkoman](https://avatars.discourse-cdn.com/v4/letter/g/c89c15/32.png) [@gekkoman](https://forum.inductiveautomation.com/u/gekkoman)\
**Post date:** [October 11, 2013, 11:20pm UTC](https://forum.inductiveautomation.com/t/postgres-and-recipe-addition/7402/1 "2013-10-11T23:20:42Z")

</div>

Am trying to get recipe module working under postgres and MES

Have upgraded to 7.6.4\_rc1

I can create defaults etc and they look fine in the production model.

If I use the recipe editor I can choose “add recipe” and give a recipe a name…however it then disappears and does not show up.

I can see the recipe of the same name created in the database.

Similarly the list and combo do not show added recipe.

If I tick “show item defaults” I can see the defaults correctly.

If I however add an “item path filter” it allways shows the whole enterprise in the defaults tree which also seems incorrect.

Am I missing something?

---

<div class="post-metadata">

**Author:** ![Pete.Low](https://avatars.discourse-cdn.com/v4/letter/p/f05b48/32.png) [@Pete.Low](https://forum.inductiveautomation.com/u/Pete.Low)\
**Post date:** [October 16, 2013, 3:02pm UTC](https://forum.inductiveautomation.com/t/postgres-and-recipe-addition/7402/2 "2013-10-16T15:02:37Z")

</div>

Hi,  
What version of PostGres are you using?  
I will try to replicate here and see if I can find out what is happening.

---

<div class="post-metadata">

**Author:** ![Pete.Low](https://avatars.discourse-cdn.com/v4/letter/p/f05b48/32.png) [@Pete.Low](https://forum.inductiveautomation.com/u/Pete.Low)\
**Post date:** [October 16, 2013, 7:28pm UTC](https://forum.inductiveautomation.com/t/postgres-and-recipe-addition/7402/3 "2013-10-16T19:28:25Z")

</div>

Hello,  
I assume you are running 9.3. Our validation is against 9.0.  
I have tested 9.3 and found the same issue, but I do have a work around.

- open the pgADmin console
- select the PostgreSQL 9.3 under the server that you are using
- under the “Tools” menu select “Server Configuration” -\> postgresql.conf
- scroll down to “standard\_conforming\_strings” and enable it and set it to “off”
- under the “File” menu select Save then Reload Server

PostgreSQL had a driver change from 9.0 to 9.3 and we are looking how to handle both but this should work for you now.

---

<div class="post-metadata">

**Author:** ![gekkoman](https://avatars.discourse-cdn.com/v4/letter/g/c89c15/32.png) [@gekkoman](https://forum.inductiveautomation.com/u/gekkoman)\
**Post date:** [October 25, 2013, 10:07am UTC](https://forum.inductiveautomation.com/t/postgres-and-recipe-addition/7402/4 "2013-10-25T10:07:26Z")

</div>

Thanks,

will try this.

---

<div class="post-metadata">

**Author:** ![gekkoman](https://avatars.discourse-cdn.com/v4/letter/g/c89c15/32.png) [@gekkoman](https://forum.inductiveautomation.com/u/gekkoman)\
**Post date:** [October 25, 2013, 11:24am UTC](https://forum.inductiveautomation.com/t/postgres-and-recipe-addition/7402/5 "2013-10-25T11:24:03Z")

</div>

PS I suspect this may also address some of the other issues with MES pathing I had been experiencing but had been ignoring to date.

Will let you know how i get on.

Suspect the easiest solution may be to use a "SET standard\_conforming\_strings = 0; " when you establish JDBC connection to force option to known state thus avoiding changes to current code.

As far as I am aware all the options available to combat this are:

1. check for standard\_conforming\_strings flag status and modify string as needed (standard SQL approach but messy)

2. check for standard\_conforming\_strings flag status and then escape as required with the E’Pre 9.1 string’ syntax when standard\_conforming\_strings = 1. (saves having to do parsing yourself but still messy, postgres centric)

3. use a "SET standard\_conforming\_strings = 0; and then use ‘Pre 9.1 string’ (not standard conforming, but likely avoids significant code change)

4. use a "SET standard\_conforming\_strings = 1; and then modify current code to provide ‘Post 9.0 string’ ( standard conforming, but string handling needs to be upgraded to \>=9.1)

5. Use $$ escaping. (postgres centric, simple and works always, as well as handling single quotes without escape, will require code changes)

I found the link [http://stackoverflow.com/questions/6229508/sql-how-to-escape-parentheses-in-postgresql](http://stackoverflow.com/questions/6229508/sql-how-to-escape-parentheses-in-postgresql) which shows all these variants.

---

<div class="post-metadata">

**Author:** ![Pete.Low](https://avatars.discourse-cdn.com/v4/letter/p/f05b48/32.png) [@Pete.Low](https://forum.inductiveautomation.com/u/Pete.Low)\
**Post date:** [October 25, 2013, 2:33pm UTC](https://forum.inductiveautomation.com/t/postgres-and-recipe-addition/7402/6 "2013-10-25T14:33:10Z")

</div>

Good info, thanks for the input.

---

<div class="post-metadata">

**Author:** ![gekkoman](https://avatars.discourse-cdn.com/v4/letter/g/c89c15/32.png) [@gekkoman](https://forum.inductiveautomation.com/u/gekkoman)\
**Post date:** [October 28, 2013, 12:08am UTC](https://forum.inductiveautomation.com/t/postgres-and-recipe-addition/7402/7 "2013-10-28T00:08:23Z")

</div>

Putting

SET standard\_conforming\_strings = 0;

Into the database “Connection Initialization Commands” (advanced config) seems to do the trick.
