Re: [SQL] ROUND function ??

2001-10-09 Thread Allan Engelhardt
Tom Lane wrote: > [...]Because the IEEE float math standard says so. Round-to-nearest-even > is considered good practice. I learn something new every day. :-) While it is true that IEEE 754 defaults to "round-to-nearest", which means rounding midway points to even, it is slightly confusing t

Re: [SQL] Loading current_user and current_timestamp using COPY

2001-10-09 Thread Josh Berkus
Herb, > I'm trying to load the current_user and current timestamp (as an > audit) > in a set of data using the COPY FROM... statement. > I cannot get the session_user, current_user or user to give me > anything > but the text itself...I even tried the obsolete getpgusername() and > thats exact

Re: [SQL] Linking against null-fields.

2001-10-09 Thread Stephan Szabo
> SELECT f.ID, d.NAME FROM FILE f, DRIVER d WHERE (d.ID = f.DRIVER); > > However, the only reason I have this query set up as this is to get the name > of the driver easily, if one is set. > > How can this be helped? Should I just get the driver ID as a field, and then > do a second query on that?

Re: [SQL] Problem with n to n relation

2001-10-09 Thread Janning Vygen
Am Dienstag, 9. Oktober 2001 17:38 schrieb Stephan Szabo: > > Yes you are right! It doesnt work. i thought i have tested it... > > > > But i dont understand your solution. Why did you insert foo in > > the person table? Dou want to use it as a foreign key? Maybe you > > just mistyped your alter t

Re: [SQL] Problem with n to n relation

2001-10-09 Thread Stephan Szabo
> Yes you are right! It doesnt work. i thought i have tested it... > > But i dont understand your solution. Why did you insert foo in the > person table? Dou want to use it as a foreign key? Maybe you just > mistyped your alter table statement i guess. you create a unique > person2address id a

Re: [SQL] Linking against null-fields.

2001-10-09 Thread david
Hi Alex, For this you need an outer join (Made easy as of postgresql 7.1) Alexander Deruwe Wrote: > Hey all, > > I'm sorry if this question came up before, I couldn't find it in the > archives.. > > Suppose I have two tables: > > table File: contains alot of fields + 'driver' field, which refe

[SQL] Linking against null-fields.

2001-10-09 Thread Alexander Deruwe
Hey all, I'm sorry if this question came up before, I couldn't find it in the archives.. Suppose I have two tables: table File: contains alot of fields + 'driver' field, which refers to another table. I did not 'reference' it when creating the database because null-values have to be possible

Re: [SQL] Problem with n to n relation

2001-10-09 Thread Janning Vygen
Am Montag, 8. Oktober 2001 19:33 schrieb Stephan Szabo: > On Mon, 8 Oct 2001, Janning Vygen wrote: > > Am Montag, 8. Oktober 2001 18:09 schrieb Stephan Szabo: > > > On Mon, 8 Oct 2001, Janning Vygen wrote: > > > > but how do i reach my goal. It should not be allowed to have > > > > a person with