pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedhow can I query for unset timestamps
3+ messages / 2 participants
[nested] [flat]
* how can I query for unset timestamps
@ 2005-02-22 21:09 Bret Hughes <bhughes@elevating.com>
0 siblings, 0 replies; 3+ messages in thread
From: Bret Hughes @ 2005-02-22 21:09 UTC (permalink / raw)
To: pgsql-sql
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
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: how can I query for unset timestamps
@ 2005-02-22 21:19 Gregory S. Williamson <gsw@globexplorer.com>
0 siblings, 1 reply; 3+ messages in thread
From: Gregory S. Williamson @ 2005-02-22 21:19 UTC (permalink / raw)
To: Bret Hughes <bhughes@elevating.com>; 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@elevating.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!
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: how can I query for unset timestamps
@ 2005-02-22 22:05 Bret Hughes <bhughes@elevating.com>
parent: Gregory S. Williamson <gsw@globexplorer.com>
0 siblings, 0 replies; 3+ messages in thread
From: Bret Hughes @ 2005-02-22 22:05 UTC (permalink / raw)
To: Gregory S. Williamson <gsw@globexplorer.com>; +Cc: pgsql-sql
Well, thank you very much. works perfectly, I guess I have not done
much NULL value stuff.
Bret
On Tue, 2005-02-22 at 15:19, Gregory S. Williamson wrote:
> 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@elevating.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!
>
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2005-02-22 22:05 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-02-22 21:09 how can I query for unset timestamps Bret Hughes <bhughes@elevating.com>
2005-02-22 21:19 Re: how can I query for unset timestamps Gregory S. Williamson <gsw@globexplorer.com>
2005-02-22 22:05 ` Bret Hughes <bhughes@elevating.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox