how can I perform smth like
CREATE TABLE table_b AS SELECT * FROM table_a
using Django db API?
how can I perform smth like CREATE TABLE table_b AS SELECT * FROM table_a
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Django’s ORM isn’t intended for things like this. I would suggest you’re doing something the wrong way but you haven’t explained why you want to do this, so I can’t really comment.
Anyway. You can use Django’s raw SQL:
http://docs.djangoproject.com/en/dev/topics/db/sql/#executing-custom-sql-directly