Questions tagged [database-integrity]

48 questions
90
votes
14 answers

IntegrityError duplicate key value violates unique constraint - django/postgres

I'm following up in regards to a question that I asked earlier in which I sought to seek a conversion from a goofy/poorly written mysql query to postgresql. I believe I succeeded with that. Anyways, I'm using data that was manually moved from a…
40
votes
1 answer

Rails 3: Validate combined values

In Rails 2.x you can use validations to make sure you have a unique combined value like this: validates_uniqueness_of :husband, :scope => :wife In the corresponding migration it could look like this: add_index :family, [:husband, :wife], :unique =>…
31
votes
5 answers

Are there any difference between data integrity and data consistency?

I'm a little confused about data consistency and data integrity. From Oracle Database Concepts: data integrity -------------- Business rules that dictate the standards for acceptable data. These rules are applied to a database by using integrity…
Just a learner
  • 26,690
  • 50
  • 155
  • 234
26
votes
3 answers

SQL Server: How to make server check all its check constraints?

It seems that some scripts generated by Enterprise Manager* (or not, it doesn't matter) created check constraints WITH NOCHECK. Now when anyone modifies the table, SQL Server is stumbling across failed check constraints, and throwing errors. Can i…
12
votes
3 answers

"SET FOREIGN_KEY_CHECKS = 0;" Oracle Equivalent

Is there some equivalent to the Mysql specific instruction that disable the check of the foreign keys constraints ? SET FOREIGN_KEY_CHECKS = 0;
abderrahim_05
  • 445
  • 1
  • 4
  • 21
5
votes
8 answers

How can MyISAM tables be used more safely?

I like InnoDB's safety, consistency, and self-checking. But I need MyISAM's speed and light weight. How can I make MyISAM less prone to corruption due to crashes, bad data, etc.? It takes forever to go through a check (either CHECK TABLE or…
JBB
  • 4,543
  • 3
  • 24
  • 25
4
votes
1 answer

MySQL: Update a table in its own trigger

Apparently MySQL have the really annoying restriction of not being able to update a table inside a trigger defined for that same table. I'm using MySQL version 5.1 and I get the error: "Can't update table in stored function/trigger because it is…
GetFree
  • 40,278
  • 18
  • 77
  • 104
4
votes
1 answer

How to skip an existing object instance when creating resources in bulk python

I am trying to create a resources in bulk. While the resources are created I have the matric_no has to be unique. If the value of an existing matric_no is uploaded together with the some new entries, I get an integrity error 500 because the value…
4
votes
5 answers

How to fix possible db corruption?

I'm at a client doing some quick fixes to their access application. It was a while I had a go with access, but I'm recovering quickly. However, I've discovered an interesting problem: For some reports, I get a "Record is deleted" error. I've checked…
Jonas Lincoln
  • 9,567
  • 9
  • 35
  • 49
4
votes
1 answer

Model integrity check in django

I have a model named Entry that has the following fields from django.contrib.auth.models import User class Entry(models.Model): start = models.DateTimeField() end = models.DateTimeField() creator = models.ForeignKey(User) canceled =…
Apostolos
  • 7,763
  • 17
  • 80
  • 150
3
votes
2 answers

How to check MySQL integrity?

I have a big MySQL 5 Database for a drupal site on an old machine. After backing up and restoring on a fresh database, I got: ERROR 1064 (42000) at line **: You have an error in your SQL syntax; check the manual that corresponds to your MySQL…
qliq
  • 11,695
  • 15
  • 54
  • 66
3
votes
2 answers

Is it possible to integrate my database with a forum (SMF, phpBB) database?

I have a web application with a user base. I want to add a forum, but I don't want users to register there again. I'm using Rails/Postgresql. Is it possible to integrate the forum so that after registering in my site, a user will also be registered…
Alex
  • 34,581
  • 26
  • 91
  • 135
3
votes
1 answer

sqlite nomem error on integrity check

I have a embedded system which uses C/C++ api with a compiled version of SQLite v3. I get a SQLITE_NOMEM error on pragma integrity_check(10);. I asked the underlying system programmer what the applications heap size is and he tells me that the value…
Taha Paksu
  • 15,371
  • 2
  • 44
  • 78
2
votes
1 answer

Your Opinion? - linking tables by LinkTypeId

I have a web app that links files and notes to customers, users, projects, etc. Initially, I had tables such as customerNote, userNote, projectNote...etc. Design considerations: 1: I don't want to manage N squared tables (over 100 customerNote,…
bsod
  • 145
  • 5
2
votes
1 answer

Junction table referencing non existent entity

I have the following models in django class WorkSession(models.Model): pass class Invoice(models.Model): work_sessions = models.ManyToManyField(WorkSession, blank=True) what I noticed is that when i do the following: invoice =…
Amrou
  • 371
  • 1
  • 3
  • 18
1
2 3 4