Re: how can I query for unset timestamps

From: "Gregory S(dot) Williamson" <gsw(at)globexplorer(dot)com>
To: "Bret Hughes" <bhughes(at)elevating(dot)com>, "postgresql sql list" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: how can I query for unset timestamps
Date: 2005-02-22 21:19:57
Message-ID: 71E37EF6B7DCC1499CEA0316A256832801D4BE98@loki.wc.globexplorer.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Bret --
A test for NULL uses the IS statement, e.g.:

SELECT * FROM tablefoo WHERE last_timestamp IS NULL;

HTH,

Greg Williamson
DBA
GlobeXPlorer LLC

-----Original Message-----
From: Bret Hughes [mailto:bhughes(at)elevating(dot)com]
Sent: Tue 2/22/2005 1:09 PM
To: postgresql sql list
Cc:
Subject: [SQL] how can I query for unset timestamps
I have a table that I recently altered by adding several timestamp
columns. I would like to query the table for those rows for which the
timestamp has not been set but am unable to find a way to do so. any
tips ? in psql the column appears empty and char_length returns
nothing.

Some of what I have tried

"" -> not valid

char_length(last_timestamp) > 0 -> returns the rows with the time
stamps

where NOT char_length(last_timestamp) > 0 -> returns 0 rows

where NOT (char_length(last_timestamp) > 0 ) -> returns 0 rows

where last_timestamp = NULL; -> 0 rows

this is kicking my butt, and starting to piss me off so if any one has
tips I would appreciate it.

Bret

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

!DSPAM:421b9fba271461201672223!

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Bret Hughes 2005-02-22 22:05:16 Re: how can I query for unset timestamps
Previous Message Bret Hughes 2005-02-22 21:09:54 how can I query for unset timestamps