> In normal SQL terminology a constraint is a restriction on a column. It
> could be to bind it to always refer to another table's and column (i.e.
> a foreign) key or the other standard things (trying to establish my
> baseline, not teach you to suck eggs). It just happens that you can name
> constraints, but you don't have to (in which case, the database server
> may or may not give it an internal name). Constraint names are really
> only useful for debugging (they pop up in error messages when you really
> screw up) and sometimes if you are tweaking a manually created index (on
> some databases; haven't done much Oracle low-level optimisation work, so
> I'm not sure of all the possibilities there).
>
> Your query above looks like you are just doing joins on columns from
> tables. Are you saying that some of those things in the "from" clause
> are not actually tables or views?
nope, i wasn't saying that - i was just saying that Oracle constraint
names are more than just psudo-documentation, they are the primary key
of the constraint in the oracle data dictionary. That's why, in Oracle,
constraints must have a (unique) name.
> I've done a fair bit of Oracle
> database programming and haven't ever come across that, since it's
> always seemed like Oracle used constraints just like every other
> database: as a restriction condition on columns.
agreed.
<snip>
> Modulo the fact that you can't tell whether it's a table name or column
> name you are quoting, your understanding is correct. You'll never get a
> constraint name passed into quote_name(), since we never need to refer
> to those; only column and table names.
manage.py DOES pass a constraints name to quote_name.
during a syncdb - it explicitly creates the constraint name. This fixed
it:
def quote_name(name):
"""given a string that will be used for a table, column, or
constraint name
returns a modified version of that string which is appropriate for
this backend.
Should do something smarter than just truncate long names, like
recusrively
replace a few choice words with shorter phrases until word is short
enough,
and only truncate if that fails to get it short enough.
"""
if name.startswith("`") and name.endswith("`"):
quoted=1
else:
quoted=0
if (len(name) - 2*quoted) > 30: # it's to long!
if quoted:
return '%s' name[1:30]
return "'%s'" % name[:29]
if quoted:
return name
return "'%s'" % name
and i got past that bit. While that's nasty, I at least now know that I
have to deal with two more accursed Oracle problems and a bug:
- no serial/autoincrementing type, sequence + trigger required.
- it's not OK to use 'long' for 'TextField', a table can only have one
'long' column - CLOBs required, kludging with varchar(4000) for the
moment
- why is syncdb trying (and failing) to create tables that already
exist?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-developers
-~----------~----~----~----~------~----~------~--~---