Re: [SQL] When is a shared library unloaded?

2007-08-15 Thread Jon Horsman
> "Jon Horsman" <[EMAIL PROTECTED]> writes: > > I'm randomly having issues with my triggers not firing (it turns out > > they are getting removed) and when i turned INFO logs on i saw the > > following > > > 2007-08-14 13:41:44.740305500 LOCATION: _fini, medbevent_init.c:129 > > 2007-08-14 13:41:4

[SQL] Boolean without default declared

2007-08-15 Thread Jon Collette
If a column with a boolean datatype doesn't have a default value. What type of value is set if nothing is inserted into that column? Here is my test table and the queries I have tried. I can't seem to be able to select the rows where happy has no value. Table "public.users" Colum

Re: [SQL] Boolean without default declared

2007-08-15 Thread Richard Broersma Jr
--- Jon Collette <[EMAIL PROTECTED]> wrote: > If a column with a boolean datatype doesn't have a default value. What > type of value is set if nothing is inserted into that column? Here is > my test table and the queries I have tried. I can't seem to be able to > select the rows where happy

Re: [SQL] Boolean without default declared

2007-08-15 Thread Richard Broersma Jr
--- Jon Collette <[EMAIL PROTECTED]> wrote: > Thanks that was it exactly. I did notice another strange thing. When > using IS NULL in an plpgsql IF statement you have to use ISNULL. Same > with NOT NULL. Does this mean that ISNULL is more proper than IS NULL? Good question, I am not sure

[SQL] Problem with phone list.

2007-08-15 Thread Mike Diehl
Hi all. I've qot a problem I need to solve. I'm sure it's pretty simple; I just can't seem to get it, so here goes... I've got a table, actually a view that joins 3 tables, that contains a phone number, a unique id, and a call duration. The phone number has duplicates in it but the unique id

Re: [SQL] Problem with phone list.

2007-08-15 Thread Fernando Hevia
Try this: Select * from view v1 where duration = (select max(duration) from view v2 where v2.phone_number = v1.phone_number) You could get more than one call listed for the same number if many calls match max(duration) for that number. -Mensaje original- De: [EMAIL PROTECTED] [mailto:[E

Re: [SQL] Problem with phone list.

2007-08-15 Thread Rodrigo De León
On 8/15/07, Mike Diehl <[EMAIL PROTECTED]> wrote: > Any hints would be much appreciated. DDL + sample data, please... ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] Problem with phone list.

2007-08-15 Thread Richard Broersma Jr
--- Mike Diehl <[EMAIL PROTECTED]> wrote: > I've qot a problem I need to solve. I'm sure it's pretty simple; I just > can't > seem to get it, so here goes... > > I've got a table, actually a view that joins 3 tables, that contains a phone > number, a unique id, and a call duration. > > The

Re: [SQL] Problem with phone list.

2007-08-15 Thread Michael Glaesemann
On Aug 15, 2007, at 15:28 , Mike Diehl wrote: I've got a table, actually a view that joins 3 tables, that contains a phone number, a unique id, and a call duration. The phone number has duplicates in it but the unique id is unique. I need to get a list of distinct phone numbers and the co

Re: [SQL] Boolean without default declared

2007-08-15 Thread Tom Lane
Richard Broersma Jr <[EMAIL PROTECTED]> writes: > --- Jon Collette <[EMAIL PROTECTED]> wrote: >> Thanks that was it exactly. I did notice another strange thing. When >> using IS NULL in an plpgsql IF statement you have to use ISNULL. Same >> with NOT NULL. Does this mean that ISNULL is more p

Re: [SQL] Problem with phone list.

2007-08-15 Thread Mike Diehl
Yup, that did it. I don't know why I made it harder than it had to be. Thank you. Mike. On Wednesday 15 August 2007 02:58:22 pm Fernando Hevia wrote: > Try this: > > Select * > from view v1 > where duration = (select max(duration) from view v2 where v2.phone_number = > v1.phone_number) > > You