> Not *one* table. I never advocated that. It is perfectly normal to split
> your data into different tables *vertically* (i.e. things that do not
> have any intersection between their data, should go into different
> tables), but it very rarely (if at all) makes any sense to split it
> *horizontal
> Your programmers must be really smart :-)
> Are you saying that you have never seen a person writing a piece of sql
> like:
> insert into mytable (id, data) select max(id) + 1 from mytable, 'mydata'
> ???
>
> If so, you must be really lucky :-)
>
I would never hire such a person.
> Exactly. But
Jonathan Bartlett wrote:
NOTE - after writing all this, I did think of a possible solution, but I'm
not sure if PG can handle it. If I made a table called "object" with one
column, the object_id, and then had EVERY table inherit from this table.
Then, I could have my constraints set up against th
NOTE - after writing all this, I did think of a possible solution, but I'm
not sure if PG can handle it. If I made a table called "object" with one
column, the object_id, and then had EVERY table inherit from this table.
Then, I could have my constraints set up against this master table. (I'm
not
Jonathan Bartlett wrote:
In the few instances where I go the other way, it's limited to 2
or 3 tables, and I do separate joins combined with a UNION.
If you can combine your queries with a union, your table layouts must be
very similar if not identical.
Why not put everything into the same tab
> So, how can you possibly tell when looking at your note which entry it
> applies to?
That's easy - these are always referred from the table, never to the
table. In the few instances where I go the other way, it's limited to 2
or 3 tables, and I do separate joins combined with a UNION.
> When y
Do you know of a better way to handle multitable references?
Sure.
SET CONSTRAINTS DEFERRED;
BEGIN;
insert this
insert that
END;
That only handles single table references.
For example, I have a database with a "notes" table. This table is used
to store annotations on ANY record
Why not just drop the "references" clause? I mean, the point of having
transactions is to guarantee integrity within a transaction, if you're not
going to have that, why even bother with the clause?
Most of my databases don't even user "references", just because I like the
flexibility, and I have
Jonathan Bartlett wrote:
Why not just drop the "references" clause? I mean, the point of having
transactions is to guarantee integrity within a transaction, if you're not
going to have that, why even bother with the clause?
Quite the opposite - the point is to guaratee the integrity *outside*
th
Stephan Szabo wrote:
On Mon, 28 Jul 2003, kay-uwe.genz wrote:
i've a little problem with two tables and FOREIGN KEYs. I've read about
this long time ago, but didn't remember me where. Well, I hope you can
help me.
I've create two TABLEs "counties" and "cities". "Countries" have a
On Mon, 28 Jul 2003, kay-uwe.genz wrote:
> i've a little problem with two tables and FOREIGN KEYs. I've read about
> this long time ago, but didn't remember me where. Well, I hope you can
> help me.
>
> I've create two TABLEs "counties" and "cities". "Countries" have a row
> "capital" is REFERENCE
kay-uwe.genz wrote:
Hi @ all,
i've a little problem with two tables and FOREIGN KEYs. I've read
about this long time ago, but didn't remember me where. Well, I hope
you can help me.
I've create two TABLEs "counties" and "cities". "Countries" have a row
"capital" is REFERENCEd "cities". "citie
kay-uwe.genz wrote:
Hi @ all,
i've a little problem with two tables and FOREIGN KEYs. I've read about
this long time ago, but didn't remember me where. Well, I hope you can
help me.
I've create two TABLEs "counties" and "cities". "Countries" have a row
"capital" is REFERENCEd "cities". "citie
Hi @ all,
i've a little problem with two tables and FOREIGN KEYs. I've read about
this long time ago, but didn't remember me where. Well, I hope you can
help me.
I've create two TABLEs "counties" and "cities". "Countries" have a row
"capital" is REFERENCEd "cities". "cities" have a row countr
14 matches
Mail list logo