# Error when running env CCHQ\_IS\_FRESH\_INSTALL=1 ./manage.py migrate --noinput

**URL:** <https://forum.dimagi.com/t/error-when-running-env-cchq-is-fresh-install-1-manage-py-migrate-noinput/2730>\
**Category:** Developers\
**Created:** [May 12, 2016, 9:48pm UTC](https://forum.dimagi.com/t/error-when-running-env-cchq-is-fresh-install-1-manage-py-migrate-noinput/2730 "2016-05-12T21:48:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Donald\_Lobo](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/d/85f322/32.png) [@Donald\_Lobo](https://forum.dimagi.com/u/Donald_Lobo)\
**Post date:** [May 12, 2016, 9:48pm UTC](https://forum.dimagi.com/t/error-when-running-env-cchq-is-fresh-install-1-manage-py-migrate-noinput/2730/1 "2016-05-12T21:48:23Z")

</div>

hey folks:

i'm trying to install commcare-hq from github. I've made it quite far, but  
am stumbling on this command:

$ env CCHQ\_IS\_FRESH\_INSTALL=1 ./manage.py migrate --noinput

The above command results in the following error (omitting the stack trace)

django.db.utils.ProgrammingError: function to\_regclass(unknown) does not  
exist  
LINE 1: SELECT (SELECT to\_regclass('"phonelog\_devicereportentry\_doma...  
^  
HINT: No function matches the given name and argument types. You might  
need to add explicit type casts.  
QUERY: SELECT (SELECT  
to\_regclass('"phonelog\_devicereportentry\_domain\_10959f20fea53534\_idx"') is  
NULL)  
CONTEXT: PL/pgSQL function "inline\_code\_block" line 1 at IF

I've tried reading the documentation on to\_regclass in psql and could not  
really figure things out. executing the same command in psql shell gives an  
error also

am using psql 9.4.7, ubuntu 15.10

any help would be great. A big tip of hat to dimagi to having all its code  
open source. this is really awesome 🙂

lobo

---

<div class="post-metadata">

**Author:** ![Ben\_Rudolph](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/b/51bf81/32.png) [@Ben\_Rudolph](https://forum.dimagi.com/u/Ben_Rudolph)\
**Post date:** [May 13, 2016, 2:54am UTC](https://forum.dimagi.com/t/error-when-running-env-cchq-is-fresh-install-1-manage-py-migrate-noinput/2730/2 "2016-05-13T02:54:26Z")

</div>

Hi Donald,

Good to hear that you're finding HQ useful! 9.4.7 may be the version of the  
psql application, which I believe is usually the same as the postgres  
server but may not be. What command are you using to get the version of  
postgres? Try: pg\_config --version. If that's not 9.4 then that is probably  
the issue.

Also, if you continue to have difficulties, I'd recommend using our docker  
setup which will ensure the correct versions of all the services are being  
used. You can read more about it here:  
[commcare-hq/docker at master · dimagi/commcare-hq · GitHub](https://github.com/dimagi/commcare-hq/tree/master/docker).

Ben

> **···**
>
> On Thu, May 12, 2016 at 5:48 PM, Donald Lobo wrote:
> 
> > hey folks:
> > 
> > i'm trying to install commcare-hq from github. I've made it quite far, but  
> > am stumbling on this command:
> > 
> > $ env CCHQ\_IS\_FRESH\_INSTALL=1 ./manage.py migrate --noinput
> > 
> > The above command results in the following error (omitting the stack trace)
> > 
> > django.db.utils.ProgrammingError: function to\_regclass(unknown) does not  
> > exist  
> > LINE 1: SELECT (SELECT to\_regclass('"phonelog\_devicereportentry\_doma...  
> > ^  
> > HINT: No function matches the given name and argument types. You might  
> > need to add explicit type casts.  
> > QUERY: SELECT (SELECT  
> > to\_regclass('"phonelog\_devicereportentry\_domain\_10959f20fea53534\_idx"') is  
> > NULL)  
> > CONTEXT: PL/pgSQL function "inline\_code\_block" line 1 at IF
> > 
> > I've tried reading the documentation on to\_regclass in psql and could not  
> > really figure things out. executing the same command in psql shell gives an  
> > error also
> > 
> > am using psql 9.4.7, ubuntu 15.10
> > 
> > any help would be great. A big tip of hat to dimagi to having all its code  
> > open source. this is really awesome 🙂
> > 
> > lobo
> > 
> > --
> > 
> > * * *
> > 
> > You received this message because you are subscribed to the Google Groups  
> > "CommCare Developers" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [commcare-developers+unsubscribe@googlegroups.com](mailto:commcare-developers+unsubscribe@googlegroups.com).  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Donald\_Lobo](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/d/85f322/32.png) [@Donald\_Lobo](https://forum.dimagi.com/u/Donald_Lobo)\
**Post date:** [May 13, 2016, 4:51am UTC](https://forum.dimagi.com/t/error-when-running-env-cchq-is-fresh-install-1-manage-py-migrate-noinput/2730/3 "2016-05-13T04:51:08Z")

</div>

you were right, the postgres server version was 9.1.x

i fixed that and things proceeded smoothly

lobo

> **···**
>
> On Thursday, May 12, 2016 at 7:54:46 PM UTC-7, Ben Rudolph wrote: \> \> Hi Donald, \> \> Good to hear that you're finding HQ useful! 9.4.7 may be the version of \> the psql application, which I believe is usually the same as the postgres \> server but may not be. What command are you using to get the version of \> postgres? Try: pg\_config --version. If that's not 9.4 then that is probably \> the issue. \> \> Also, if you continue to have difficulties, I'd recommend using our docker \> setup which will ensure the correct versions of all the services are being \> used. You can read more about it here: \> https://github.com/dimagi/commcare-hq/tree/master/docker. \> \> Ben \> \> On Thu, May 12, 2016 at 5:48 PM, Donald Lobo \<donal...@gmail.com \> wrote: \> \>\> \>\> hey folks: \>\> \>\> i'm trying to install commcare-hq from github. I've made it quite far, \>\> but am stumbling on this command: \>\> \>\> $ env CCHQ\_IS\_FRESH\_INSTALL=1 ./manage.py migrate --noinput \>\> \>\> The above command results in the following error (omitting the stack \>\> trace) \>\> \>\> \>\> django.db.utils.ProgrammingError: function to\_regclass(unknown) does not \>\> exist \>\> LINE 1: SELECT (SELECT to\_regclass('"phonelog\_devicereportentry\_doma... \>\> ^ \>\> HINT: No function matches the given name and argument types. You might \>\> need to add explicit type casts. \>\> QUERY: SELECT (SELECT \>\> to\_regclass('"phonelog\_devicereportentry\_domain\_10959f20fea53534\_idx"') is \>\> NULL) \>\> CONTEXT: PL/pgSQL function "inline\_code\_block" line 1 at IF \>\> \>\> \>\> I've tried reading the documentation on to\_regclass in psql and could not \>\> really figure things out. executing the same command in psql shell gives an \>\> error also \>\> \>\> am using psql 9.4.7, ubuntu 15.10 \>\> \>\> any help would be great. A big tip of hat to dimagi to having all its \>\> code open source. this is really awesome :) \>\> \>\> lobo \>\> \>\> -- \>\> \>\> --- \>\> You received this message because you are subscribed to the Google Groups \>\> "CommCare Developers" group. \>\> To unsubscribe from this group and stop receiving emails from it, send an \>\> email to commcare-developers+unsubscribe@googlegroups.com . \>\> For more options, visit https://groups.google.com/d/optout. \>\> \> \>
