Re: [SQL] unique constraint instead of primary key? what

2006-02-09 Thread BigSmoke
I mean that you can't easily base a foreign key constraint on a field that is not NOT NULL UNIQUE. - Rowan ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PRO

Re: [SQL] unique constraint instead of primary key? what disadvantage(ODBC usage)?

2006-02-09 Thread BigSmoke
If my tables have one or more UNIQUE constraints/indices, I still add a "id SERIAL PRIMARY KEY" field to most of my tables. This makes referencing easier and faster. It also improves consistency, which is never a bad thing in my opinion. As far as I know, though, PRIMARY KEY does the same thing as

Re: [SQL] Non Matching Records in Two Tables

2006-02-09 Thread BigSmoke
You can use an EXCEPT clause. ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [SQL] regarding debugging?

2006-02-08 Thread BigSmoke
Checking how your PgSQL statements are executed, can be done using EXPLAIN [1]. EXPLAIN ANALYZE will also execute (but not dry-run!) your statement. I work with a seperate development and production database. Once the changes to the schema in the development DB are done, I commit them to the prod

Re: [SQL] (NONE)

2006-02-08 Thread BigSmoke
Your question is not clear at all. ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cle

Re: [SQL] Delete with join -- deleting related table entries?

2006-02-08 Thread BigSmoke
I'm not sure if this is true for you as I can't see your complete table definitions, but I'd usually do this by using issue_id INTEGER REFERENCES issue ON DELETE CASCADE in my column definition. See [1] for more information. [1]http://www.postgresql.org/docs/current/interactive/ddl-constraint