Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

I tried updating django_site row to change the name but I have gotten ERROR: column "alt native" does not exist

I tried updating django_site to change the name (and later domain) to something more appropriate so that i could use these strings for email sending operations.

I understand it is based on this: https://docs.djangoproject.com/en/4.0/ref/contrib/sites/
but I do not know what they are really talking about.

Any help much appreciated.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

What I tried:

postgres=# update django_site set django_site.name = "alt native";  
ERROR:  column "alt native" does not exist  
LINE 1: update django_site set django_site.name = "alt native";  
                                                  ^  
postgres=# select * from django_site

 id |   domain    |    name       
----+-------------+-------------  
  1 | example.com | example.com
(1 row)    

>Solution :

In PostgreSQL double quotes (") are used to denoted delimited identifiers, not string literals. Single quotes (') are used for string literals, so you update with:

UPDATE django_site SET name = 'alt native' WHERE id=1;

You probably should also add a WHERE … clause to prevent updating all records.

You should also use name as column, not django_site.name.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading