# Restore error -- database escape problem?

**URL:** https://meta.discourse.org/t/restore-error-database-escape-problem/49585
**Category:** Support
**Created:** [September 1, 2016, 10:07pm UTC](https://meta.discourse.org/t/restore-error-database-escape-problem/49585 "2016-09-01T22:07:08Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [September 1, 2016, 10:07pm UTC](https://meta.discourse.org/t/restore-error-database-escape-problem/49585/1 "2016-09-01T22:07:08Z")

</div>

I’m having trouble restoring to a hosted site. It restored fine on my Droplet, but not at the place that’s hosting Discourse for a client. I suppose it’s their problem to figure out, but I’m curious about what it could be.

> [@](#):
>
> [2016-09-01 21:58:56] Current version: 20160727233044  
> [2016-09-01 21:58:56] Restored version: 20160727233044

. . .

> [@](#):
>
> [2016-09-01 21:59:05] ERROR: unrecognized configuration parameter “row\_security”  
> [2016-09-01 21:59:05] ERROR: current transaction is aborted, commands ignored until end of transaction block

. . .  
A bunch of these:

> [@](#):
>
> [2016-09-01 21:59:09] invalid command \N

and stuff like this:

> [@](#):
>
> [2016-09-01 21:59:09] ERROR: syntax error at or near “2”  
> [2016-09-01 21:59:09] LINE 1: 2 ‘discuss’:2 ‘jewelri’:1 Jewelry Discussion en

> [@](#):
>
> [2016-09-01 21:59:10] ERROR: syntax error at or near “your”  
> [2016-09-01 21:59:10] LINE 1: your content is not getting advertised via unwanted electron…

It looks like somehow the database is configured such that stuff isn’t getting escaped properly?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [September 1, 2016, 11:20pm UTC](https://meta.discourse.org/t/restore-error-database-escape-problem/49585/2 "2016-09-01T23:20:52Z")

</div>

Any ideas here @tgxworld?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [September 2, 2016, 12:27am UTC](https://meta.discourse.org/t/restore-error-database-escape-problem/49585/3 "2016-09-02T00:27:40Z")

</div>

I have seen this before … I think its related to trying to restore incompatible versions of pg.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [September 2, 2016, 12:42am UTC](https://meta.discourse.org/t/restore-error-database-escape-problem/49585/4 "2016-09-02T00:42:13Z")

</div>

Oh. Golly. That sounds painful to resolve. But that sounds like a likely explanation. Thanks.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [September 2, 2016, 1:04am UTC](https://meta.discourse.org/t/restore-error-database-escape-problem/49585/5 "2016-09-02T01:04:57Z")

</div>

So check Postgres versions on both sides and make sure they match.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [September 2, 2016, 9:13pm UTC](https://meta.discourse.org/t/restore-error-database-escape-problem/49585/6 "2016-09-02T21:13:18Z")

</div>

The hosting company switched to the same Postgres I had used.

It’s troublesome that PG is so finicky about restoring across versions. I guess it happens rarely enough that it’s not worth trying to catch it.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [September 2, 2016, 10:34pm UTC](https://meta.discourse.org/t/restore-error-database-escape-problem/49585/7 "2016-09-02T22:34:50Z")

</div>

I think it’s the `row security` from last version that made the dumps not compatible.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [June 8, 2024, 12:45pm UTC](https://meta.discourse.org/t/restore-error-database-escape-problem/49585/8 "2024-06-08T12:45:20Z")

</div>

This topic was automatically closed after 2836 days. New replies are no longer allowed.
