Re: [SQL] where'd the spaces come from

2001-08-02 Thread Bruce Momjian
Does anyone have a fix for this? > From: "Gary Stainburn" <[EMAIL PROTECTED]> > > > psql -c "select t.tregion || '/' || to_char(t.tnumber,'000') || '-' || > > to_char(m.mnumber,'00') as unitno from teams t, members m > > where m.mteam = t.tid;" > >unitno > > - > > SW/ 041- 03

[SQL] More Database Design Stuff

2001-08-02 Thread Jimmie Fulton
This may seem like a newbie type of question: for what reason would you need a multi-column primary key. None of the books that I have read explain why or why not. It seems that the more normalized your database is, the less need for multi-column primary keys. Are multi-column primary keys con

Re: [SQL] More Database Design Stuff

2001-08-02 Thread Chris Ruprecht
Well, consider this: You have a customer list, each customer with his own unique customer number. Each of your customers has at least one address but some of them have 2 or more. Therefore, you have to create two tables, say one is called 'cust' the other 'cust_addr'. The 'cust_addr' table now ne

Re: [SQL] Foreign key

2001-08-02 Thread Jan Wieck
Lorenzo De Vito wrote: > What's the best way to build a relation between two tables ? > I know that Foreign key is no longer supported. Who told you so? Jan -- #==# # It's easier to get forgiveness for being wrong than fo

Re: [SQL] converting timestamps to ints

2001-08-02 Thread Tom Lane
"Josh Berkus" <[EMAIL PROTECTED]> writes: > Hmmm... apparently the docs on date/time data types could use some work. > Or some highlighting. Or something. We get this question every week. > I'll do it -- can I submit a FAQ in plain text? Go for it --- more docs always welcome ;-)