Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Depending on how the constraint is set up in the create table clause, foreign keys can be null. They need to exist in the other table if they are non-null. See the create table statement [] in the PostgreSQL docs[].
    • From what I can figure out, I apparently had NOT NULL on my column definition. That threw me off.

      What I'm probably going to do is pull the reference to the country out of the customer table and use the state to look it up. However, this means we can't have NULL states, so I'll have to create "blank" states that refer back to the country. It's ugly, but this seems to be the cleanest way.

    • Looking again at the docs, 'MATCH PARTIAL' is not implemented yet, so you still have your California/France problem. Otherwise you would be able to have one constraint on country and another on a country/state combination.