Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9168593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:39:42+00:00 2026-06-17T15:39:42+00:00

Hey guys i have a problem. There is an application that i built using

  • 0

Hey guys i have a problem. There is an application that i built using django and it runs on postgresql. The application works perfectly but until recently , i was asked to push particular table data in the models of the django application to a remote oracle database. For example i have a model that looks like this:

 class SimRegistrationForm(models.Model):
    mobile_number = models.IntegerField('Mobile Number',max_length=10, null=False, blank=False)
    alternative_number = models.IntegerField('Alternative Number',max_length=10, blank=True, null=True)
    date = models.DateField('Date', blank=False, null=False)
    honorifics = models.CharField('Honorific', max_length=10, choices=HONORIFIC, blank=False, null=False)
    first_name = models.CharField('First Name',max_length=30, blank=False, null=False)
    middle_name = models.CharField('Middle Name',max_length=30, blank=True, null=True)
    last_name = models.CharField('Last Name',max_length=30, blank=False, null=False)
    dob = models.DateField('Date of Birth', blank=False, null=False)
    nationality = models.CharField(max_length=30, null=False, blank=False)

I have asked this question before on this forum but have not had as much help with very little response. How can i be able to achieve this ? I know django supports multiple database connections basing on what i have read here
https://docs.djangoproject.com/en/dev/topics/db/multi-db/
I would like such that it pushes some of the table data to the remote oracle database in realtime and data should also remain on the postgres database too. How can i achieve this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T15:39:43+00:00Added an answer on June 17, 2026 at 3:39 pm

    Seems like you want to replicate the data from postgresql to oracle for some particular model.

    MultiDB is not conceived for replication, but with a recent version of Django you can be able to pull this stunt.

    Configure Django with two databases, the postgresql as default and the oracle as a second database. Lets say you called the second database database “orcl”:

    1. create the same table you want to replicate in the oracle database
    2. write a custom “save” method in the Django model that calls the super() “save” method and also super(YourModel, self).save(using='orcl')

    Should be something like this (untested):

    def save(self, *args, **kwargs):
        super(YourModelName, self).save(*args, **kwargs)
        kwargs.update({'using' : 'orcl'})
        super(YourModelName, self).save(*args, **kwargs)
    

    [update]

    comment from OP: But now the problem is i dont want to send all the data of the table to the remote database. I just want to send some columns to the remote database. Is it possible to achieve this with a similar method

    I think it is possible. Keeping the same pk on both databases will make your life easier:

    def save(self, *args, **kwargs):
        super(YourModelName, self).save(*args, **kwargs)
        remote = OtherModel(
            id = self.id,
            some_field = self.some_field,
            another_field = self.another_field,
        )
        remote.save(using='orcl')
    

    Let me know if this works. You have to either 1) define the OtherModel and create the corresponding table in the remote database or 2) create the remote table and use manage.py inspectdb to create the model.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys, I have a weird problem. I have an update system that refreshes
hey guys having this really simple problem but cant seem to figure out have
Hey guys I have one more question lol. I am using a script that
Hey guys, I have another really annoying problem in IE. I am using a
Hey guys, I have a problem with a code that I've been writing. I
Hey Guys I have a big problem that I have no Idea why.. I
Hey guys i have a problem. I have a listview that is dynamically filled.
hey guys m running into a problem, i have a forloop n in that
Hey guys I have an admin page that checks if you are admin before
Hey guys I have a query that currently finds the latest comment for each

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.