Re: [SQL] Timestamp with timezone with Default value

2009-07-19 Thread Jasen Betts
On 2009-07-18, Gianvito Pio wrote: > This is a multi-part message in MIME format. > > --=_NextPart_000_0017_01CA0791.49E30EB0 > Content-Type: text/plain; > charset="iso-8859-1" > Content-Transfer-Encoding: quoted-printable > > Hi all, > how can I define a column of timestamp with timezon

Re: [SQL] Timestamp with timezone with Default value

2009-07-18 Thread Jasmin Dizdarevic
Hi, i think: create. ...( myCol timestamp with timezone default now() ) the function now() returns a timestamp with timezone ( http://www.postgresql.org/docs/8.4/static/functions-datetime.html) i currently have no db to test it - but it should work. jasmin 2009/7/18 Gianvito Pio > Hi all,

[SQL] Timestamp with timezone with Default value

2009-07-18 Thread Gianvito Pio
Hi all, how can I define a column of timestamp with timezone type...with a default value? Thanks

Re: [SQL] Timestamp, epoch and a bit confusion

2008-03-12 Thread Valter Douglas Lisbôa Jr.
Thank you, very much. I pass through extract(epoch from x). On Wednesday 12 March 2008 19:58:07 Aurynn Shaw wrote: > Valter Douglas Lisbôa Jr. wrote: > > Hello all. > > > > I working with postgreSQL for a couple of months, and now I trying to > > convert timestamp columns in epoch and epoch to ti

Re: [SQL] Timestamp, epoch and a bit confusion

2008-03-12 Thread Aurynn Shaw
Valter Douglas Lisbôa Jr. wrote: Hello all. I working with postgreSQL for a couple of months, and now I trying to convert timestamp columns in epoch and epoch to timestamp columns. So far I could reach, all SQL I find by 'googling' returns an error. SELECT extract (epoch from your_time_field

[SQL] Timestamp, epoch and a bit confusion

2008-03-12 Thread Valter Douglas Lisbôa Jr.
Hello all. I working with postgreSQL for a couple of months, and now I trying to convert timestamp columns in epoch and epoch to timestamp columns. So far I could reach, all SQL I find by 'googling' returns an error. Where can I find some documentation with this convertions fo 8.2.x branch? I

Re: [SQL] TIMESTAMP comparison problem

2008-01-22 Thread Tom Lane
Michael Glaesemann <[EMAIL PROTECTED]> writes: > Well, you can't get better than microsecond precision with timestamps > in Postgres. And the only way you can rely on that level of precision > is to compile with --enable-integer-datetimes. There is more precision in there, but the output routi

Re: [SQL] TIMESTAMP comparison problem

2008-01-22 Thread Stuart Brooks
If I reduce the precision to 3 for the timestamps it appears to work although it makes me nervous. With float timestamps, you're fooling yourself if you think those numbers past the decimal are reliable. Should I just recompile to use integer datetimes? I would like to have at least micros

Re: [SQL] TIMESTAMP comparison problem

2008-01-22 Thread Michael Glaesemann
On Jan 22, 2008, at 3:05 , Stuart Brooks wrote: If I reduce the precision to 3 for the timestamps it appears to work although it makes me nervous. With float timestamps, you're fooling yourself if you think those numbers past the decimal are reliable. Should I just recompile to use integ

[SQL] TIMESTAMP comparison problem

2008-01-22 Thread Stuart Brooks
I have a problem in comparing a TIMESTAMP field with a timestamp literal. I presume it is to do with the floating point representation of the timestamp but I was wondering if there is an easy work around without having to recompile postgres to use integer datetimes. Basically if I issue a "SEL

Re: [SQL] timestamp (MS SQLServer's rowversion) functionality

2006-08-11 Thread Andrew Hammond
On 8/11/06, Aaron Bono <[EMAIL PROTECTED]> wrote: I put a create_dt and modify_dt column on every table and set the default to now(). Then I use this trigger: CREATE OR REPLACE FUNCTION "public"."modify_date_stamp_fn" () RETURNS SETOF opaque AS ' BEGIN -- if a trigger insert or update oper

Re: [SQL] timestamp (MS SQLServer's rowversion) functionality

2006-08-11 Thread Aaron Bono
On 10 Aug 2006 06:28:30 -0700, Andrew Hammond <[EMAIL PROTECTED]> wrote: Tomski wrote:> Hello!> As many of you know, SQL Server (2000) has peculiar data type "timestamp"> which is not SQL standard timestamp. In fact it is "rowversion" type. It> makes tha field to be updated with current timestamp w

Re: [SQL] timestamp (MS SQLServer's rowversion) functionality

2006-08-10 Thread Andrew Hammond
Tomski wrote: > Hello! > As many of you know, SQL Server (2000) has peculiar data type "timestamp" > which is not SQL standard timestamp. In fact it is "rowversion" type. It > makes tha field to be updated with current timestamp when row is updated or > inserted. > Is there any similiar functionali

Re: [SQL] timestamp query doesn't use an index ...

2006-05-21 Thread Tom Lane
"Marc G. Fournier" <[EMAIL PROTECTED]> writes: > -> Bitmap Heap Scan on page_schedule ps2 (cost=573.65..2822.86 > rows=91614 width=16) (actual time=149.788..505.438 rows=94798 loops=1) > Recheck Cond: (timezone('MST7MDT'::text, start_time) <= '2006-05-17 > 08:09:18'::timestamp wit

Re: [SQL] timestamp query doesn't use an index ...

2006-05-21 Thread Marc G. Fournier
On Sun, 21 May 2006, Tom Lane wrote: "Marc G. Fournier" <[EMAIL PROTECTED]> writes: I'm trying to figure out some way to speed up the following query: select ps2.page_id, ps2.template_component_id, max(ps2.start_time) from page_schedule ps2 where ps2.start_time at time zone 'MST7

Re: [SQL] timestamp query doesn't use an index ...

2006-05-21 Thread Tom Lane
"Marc G. Fournier" <[EMAIL PROTECTED]> writes: > I'm trying to figure out some way to speed up the following query: >select ps2.page_id, ps2.template_component_id, max(ps2.start_time) > from page_schedule ps2 > where ps2.start_time at time zone 'MST7MDT' <= '2006-5-17 8:9:18' > group

Re: [SQL] timestamp query doesn't use an index ...

2006-05-20 Thread Marc G. Fournier
On Sun, 21 May 2006, Michael Glaesemann wrote: On May 21, 2006, at 10:42 , Marc G. Fournier wrote: -> Seq Scan on page_schedule ps2 (cost=0.00..2364.95 rows=33110 width=16) (actual time=0.021..623.363 rows=94798 loops=1) I don't know about rewriting the query, but it appears your statis

Re: [SQL] timestamp query doesn't use an index ...

2006-05-20 Thread Michael Glaesemann
On May 21, 2006, at 10:42 , Marc G. Fournier wrote: -> Seq Scan on page_schedule ps2 (cost=0.00..2364.95 rows=33110 width=16) (actual time=0.021..623.363 rows=94798 loops=1) I don't know about rewriting the query, but it appears your statistics are a little out of date (e.g., rows exp

[SQL] timestamp query doesn't use an index ...

2006-05-20 Thread Marc G. Fournier
I'm trying to figure out some way to speed up the following query: select ps2.page_id, ps2.template_component_id, max(ps2.start_time) from page_schedule ps2 where ps2.start_time at time zone 'MST7MDT' <= '2006-5-17 8:9:18' group by ps2.page_id, ps2.template_component_id When run throug

Re: [SQL] timestamp SQL question

2005-11-17 Thread codeWarrior
WHERE event_type < NOW() - interval '30 days'; "Brian Doyle" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I have a table like: > > events > visitor_uid varchar(32) > event_type varchar(32) > event_type timestamp > > I would like to select events from the table that are olde

[SQL] timestamp SQL question

2005-11-17 Thread Brian Doyle
I have a table like: events visitor_uid varchar(32) event_type varchar(32) event_type timestamp I would like to select events from the table that are older than 30 days from right now. How would I do that in one query? Thanks. ---(end of broadcast)---

Re: [SQL] TIMESTAMP / summertime

2005-04-07 Thread Christoph Haller
T E Schmitz wrote: > > Hello, > > I *detest* British summertime. This year it took me two days to adjust. > Now I am realizing that my program might need some adjusting too: > > Joking aside, I need some advice regarding TIMESTAMP colums and I can't > quite get my head round this at the moment:

[SQL] TIMESTAMP / summertime

2005-04-06 Thread T E Schmitz
Hello, I *detest* British summertime. This year it took me two days to adjust. Now I am realizing that my program might need some adjusting too: Joking aside, I need some advice regarding TIMESTAMP colums and I can't quite get my head round this at the moment: I created a table TRANSAKTION with a

Re: [SQL] timestamp precision - can I control precision at select time

2005-03-26 Thread [EMAIL PROTECTED]
thanks, christoph. i did go ahead and retool all the tables, but glad to know about the casting option. ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] timestamp precision - can I control precision at select time

2005-03-22 Thread Christoph Haller
"[EMAIL PROTECTED]" wrote: > > I have a database with several tables that use timestamp without time > zone type. I upgraded from an older pgsql and have code that does not > expect the precision in the select output. Is there a way I can get the > effect of zero precision without modifying all th

[SQL] timestamp precision - can I control precision at select time or set for all time?

2005-03-20 Thread [EMAIL PROTECTED]
I have a database with several tables that use timestamp without time zone type. I upgraded from an older pgsql and have code that does not expect the precision in the select output. Is there a way I can get the effect of zero precision without modifying all the tables? The docs say it usees "defa

Re: [SQL] Timestamp with timezone question.

2005-02-21 Thread Achilleus Mantzios
O Bruno Wolff III έγραψε στις Feb 22, 2005 : > On Mon, Feb 21, 2005 at 16:16:04 +0200, > Achilleus Mantzios <[EMAIL PROTECTED]> wrote: > > > > Since pgsql always converts a timestamptz to UTC, we have lost > > the information of the Sender's local timezone. > > > > Should i go with a separete

Re: [SQL] Timestamp with timezone question.

2005-02-21 Thread Bruno Wolff III
On Mon, Feb 21, 2005 at 16:16:04 +0200, Achilleus Mantzios <[EMAIL PROTECTED]> wrote: > > Since pgsql always converts a timestamptz to UTC, we have lost > the information of the Sender's local timezone. > > Should i go with a separete date and timetz ? Someone else gave you a recommended solut

Re: [SQL] Timestamp with timezone question.

2005-02-21 Thread Achilleus Mantzios
O Andrew - Supernews έγραψε στις Feb 21, 2005 : > On 2005-02-21, Achilleus Mantzios <[EMAIL PROTECTED]> wrote: > > Consider a schema designed to store internet mail. > > > > Since pgsql always converts a timestamptz to UTC, we have lost > > the information of the Sender's local timezone. > > > > S

Re: [SQL] Timestamp with timezone question.

2005-02-21 Thread Andrew - Supernews
On 2005-02-21, Achilleus Mantzios <[EMAIL PROTECTED]> wrote: > Consider a schema designed to store internet mail. > > Since pgsql always converts a timestamptz to UTC, we have lost > the information of the Sender's local timezone. > > Should i go with a separete date and timetz ? No. Consider inst

[SQL] Timestamp with timezone question.

2005-02-21 Thread Achilleus Mantzios
AFAIK, the input for a timestamptz is converted and stored as UTC. And outputing a timezonetz value converts the internally stored UTC value to the current locale's timezone. So there is not a way to actually store the original TZ itself, whereas the timetz type clearly does that. Consider a sch

Re: [SQL] SQL timestamp to date cast

2005-01-20 Thread Michael Fuhr
On Thu, Jan 20, 2005 at 11:41:41AM +0200, Andrei Bintintan wrote: > >Another possibility would be to create a functional index on datetime: > > > >CREATE INDEX user_action_date_idx ON user_action (date(datetime)); > > GREAT!!! I thought it is possible but I didn't knew how to make such > indexes.

Re: [SQL] SQL timestamp to date cast

2005-01-20 Thread Andrei Bintintan
chael Fuhr" <[EMAIL PROTECTED]> To: "Andrei Bintintan" <[EMAIL PROTECTED]> Cc: Sent: Thursday, January 20, 2005 11:33 AM Subject: Re: [SQL] SQL timestamp to date cast On Thu, Jan 20, 2005 at 10:52:50AM +0200, Andrei Bintintan wrote: SELECT DISTINCT(nummer) FROM user_action

Re: [SQL] SQL timestamp to date cast

2005-01-20 Thread Michael Fuhr
On Thu, Jan 20, 2005 at 10:52:50AM +0200, Andrei Bintintan wrote: > SELECT DISTINCT(nummer) > FROM user_action > WHERE datetime::date='11/11/2004' AND id_action IN (5,6,9) > > Now, datetime has the type timestamp. How can I make an index or write > different this query so that it runs faster? Yo

[SQL] SQL timestamp to date cast

2005-01-20 Thread Andrei Bintintan
Hi,   I have the following query:   SELECT DISTINCT(nummer) FROM user_action WHERE datetime::date='11/11/2004' AND id_action IN (5,6,9)   Now, datetime has the type timestamp. How can I make an index or write different this query so that it runs faster? It really takes some time sometimes.

[SQL] Timestamp manipulation

2004-03-31 Thread Stephen Quinney
I am having a bit of difficulty trying to find a solution to this problem of manipulating timestamps and dates so I hope someone can enlighten me. I have a table which contains a column of type timestamp. For each row I want to find out the dates for the beginning and end of the week within which

Re: [SQL] Timestamp

2003-10-22 Thread Theodore Petrosky
Check this out http://www.postgresql.org/docs/7.3/static/functions-formatting.html to_char(departure, 'MM-DD- HH24:MI:SS') as newformatdeparture Ted --- Abdul Wahab Dahalan <[EMAIL PROTECTED]> wrote: > Hi ! > In my database I've a field "departure" with > timestamp without time zone >

Re: [SQL] Timestamp

2003-10-22 Thread achill
On Wed, 22 Oct 2003, Abdul Wahab Dahalan wrote: > Hi ! > In my database I've a field "departure" with timestamp without time zone > data type. > eg : > departure > 2003-11-01 14:29:46 Maybe SET DateStyle TO 'German' ; SELECT replace(departure,'.','-') from ; is close to what you want, but be

Re: [SQL] Timestamp

2003-10-22 Thread Tomasz Myrta
Dnia 2003-10-22 10:02, Użytkownik Abdul Wahab Dahalan napisał: Hi ! In my database I've a field "departure" with timestamp without time zone data type. eg : departure 2003-11-01 14:29:46 Now I want to select it as in this format 01-11-2003 14:29:46 How should I do it?. You can find it in docume

[SQL] Timestamp

2003-10-22 Thread Abdul Wahab Dahalan
Hi ! In my database I've a field "departure" with timestamp without time zone data type. eg : departure 2003-11-01 14:29:46 Now I want to select it as in this format 01-11-2003 14:29:46 How should I do it?. Thank you for any help. ---(end of broadcast)--

Re: [SQL] Timestamp in PG - 7.1 & 7.2

2003-08-14 Thread Tom Lane
"Anagha Joshi" <[EMAIL PROTECTED]> writes: > Here is output from PostgreSQL 7.2.4: > =20 > trapdb=3D# select cast(datetime(1057637700) as timestamp); > timestamp > --- > 2003-07-07 22:45:00+05:30 > (1 row) > =20 > I've migrated from PG - 7.1.2 to 7.2.4. Not sure w

[SQL] Timestamp in PG - 7.1 & 7.2

2003-08-06 Thread Anagha Joshi
Hi, I’ve observed this: Here is output from PostgreSQL 7.1.2:   trapdb=# select cast(datetime(1057637700) as timestamp); ?column?  ---  2003-07-08 09:45:00+05:30 (1 row)   Here is output from PostgreSQL 7.2.4:   trapdb=# select cast(datetime

[SQL] Timestamp problem

2003-07-19 Thread Raymond Chui
I am use PostgreSQL 7.2.1 in Redhat Linux 7.2 Java 1.4.x When I do JDBC String sql = "SELECT datetime_column FROM mytable"; Timestamp ts = resultSet.getTimestamp(2); If the timestamp return format like 2003-07-15 13:20:00.20+00 then is OK. But if timestamp return like 2003-07-15 13:20:00.

Re: [SQL] timestamp with postgresql 7.3

2003-04-04 Thread Claude
Thanks, that made the trick. On Fri, 4 Apr 2003, Stephan Szabo wrote: > > On Fri, 4 Apr 2003, Claude wrote: > > > I have a table a field with timestamps in seconds since epoch and I would > > like to get a human readable date... but it seems that postgresql 7.3 does > > not support the datetime(

Re: [SQL] timestamp with postgresql 7.3

2003-04-04 Thread Stephan Szabo
On Fri, 4 Apr 2003, Claude wrote: > I have a table a field with timestamps in seconds since epoch and I would > like to get a human readable date... but it seems that postgresql 7.3 does > not support the datetime(), timestamp(), timestamptz() functions... I'd say probably something like: CAST(

Re: [SQL] timestamp with postgresql 7.3

2003-04-04 Thread Dan Langille
On 4 Apr 2003 at 22:18, Claude wrote: > > Hi, > > I have a table a field with timestamps in seconds since epoch and I > would like to get a human readable date... but it seems that > postgresql 7.3 does not support the datetime(), timestamp(), > timestamptz() functions... > > I tried the exampl

[SQL] timestamp with postgresql 7.3

2003-04-04 Thread Claude
Hi, I have a table a field with timestamps in seconds since epoch and I would like to get a human readable date... but it seems that postgresql 7.3 does not support the datetime(), timestamp(), timestamptz() functions... I tried the example in: http://archives.postgresql.org/pgsql-bugs/2002-07/m

Re: [SQL] timestamp

2002-10-07 Thread Dan Langille
On Sun, 6 Oct 2002, Brian Ward wrote: And Brian, since this *is* a mailing list, it would be polite to use a valid email address. I suggest that you either unsubscribe or fix the email address. Mail to [EMAIL PROTECTED] bounces with the message: '550 Invalid recipient: <[EMAIL PROTECTED]>'.

Re: [SQL] timestamp

2002-10-07 Thread Dan Langille
On Sun, 6 Oct 2002, Brian Ward wrote: > How do I create a time stamp column in a table that default to the current > time > when a row is inserted? > I tried putting in now() as the default but I have something wrong > with the syntax or something I think > Any one have an example of a table crea

Re: [SQL] timestamp

2002-10-07 Thread Larry Rosenman
On Sun, 2002-10-06 at 09:41, Brian Ward wrote: > How do I create a time stamp column in a table that default to the current > time > when a row is inserted? > I tried putting in now() as the default but I have something wrong > with the syntax or something I think > Any one have an example of a ta

[SQL] timestamp

2002-10-07 Thread Brian Ward
How do I create a time stamp column in a table that default to the current time when a row is inserted? I tried putting in now() as the default but I have something wrong with the syntax or something I think Any one have an example of a table creation script that has a timestamp column? ---

Re: [SQL] timestamp

2002-10-07 Thread Brian Ward
I think I got it but I'm not sure if it's correct. I put the default as CURRENT_TIMESTAMP but I though I had read that was being taken out and only now was supported? Does anyone know? "Brian Ward" <[EMAIL PROTECTED]> wrote in message anphrb$24se$[EMAIL PROTECTED]">news:anphrb$24se$[EMAIL PROTEC

Re: [SQL] Timestamp Error - 7.2

2002-09-25 Thread Josh Berkus
Keith, > We have moved from 7.1 to 7.2 and get the following error when > extracting dates. > > Bad timestamp external representation ' ' > > > eg. INSERT INTO mytable VALUES('1', '2001-09-24') The error, as you have described it, is highly unlikely. You will need to provide more informatio

[SQL] Timestamp Error - 7.2

2002-09-24 Thread Keith Gray
We have moved from 7.1 to 7.2 and get the following error when extracting dates. Bad timestamp external representation ' ' eg. INSERT INTO mytable VALUES('1', '2001-09-24') Seems to accept dd/mm/ (What about ISO default?) -- Keith Gray Technical Services Manager Heart Consulting Servi

[SQL] timestamp parse error

2002-09-20 Thread Tomas Lehuta
Hello! i'm using PostgreSQL 7.2.1 and got strange parse errors.. could somebody tell me what's wrong with this timestamp query example? PostgreSQL said: ERROR: parser: parse error at or near "date" Your query: select timestamp(date '1998-02-24', time '23:07') example is from PostgreSQL help an

[SQL] timestamp conversion to unisgned long?

2001-06-22 Thread pierre
All, Perhaps I'm not sing hte correct datatype, but I'd like to be able to convert a timestamp over to an unsigned long to be used within C code and compare to the output of time(). I can't seem to see any easy way of doing this using the built in stuff for postgresql. Ideas? Perhaps I'

[SQL] timestamp bug

2001-05-20 Thread Cedar Cox
There appears to be a bug in timestamp/interval addition. It happens in both PG version 7.0.2 and 7.1. There is a duplicate day (2001 Sep 07) and a missing day (2002 Apr 04). I discovered this by accident when I asked the interface I'm writing for a 365 day long calendar.. Interestingly, the

Re: [SQL] timestamp- milliseconds since epoch output

2001-02-06 Thread Tom Lane
[EMAIL PROTECTED] writes: > I've tried using variations of to_char and to_timestamp but can't seem > to get the timestamp as a value of milliseconds since the Epoch (Jan > 1, 1970). regression=# select date_part('epoch','2001-02-05 17:23:26.123456-08'::timestamp); date_part --

Re: [SQL] timestamp- milliseconds since epoch output

2001-02-06 Thread Karel Zak
On Tue, 6 Feb 2001 [EMAIL PROTECTED] wrote: > Hi, > > I'm using a timestamp field called date_created. Whenever I select it > I get: > > select date_created from tbl_user; > date_created > > 2001-02-05 17:23:26-08 > 2001-02-05 17:45:39-08 > 2001-02-03 0

[SQL] timestamp- milliseconds since epoch output

2001-02-06 Thread jkakar
Hi, I'm using a timestamp field called date_created. Whenever I select it I get: select date_created from tbl_user; date_created 2001-02-05 17:23:26-08 2001-02-05 17:45:39-08 2001-02-03 03:58:53-08 (3 rows) I've tried using variations of to_char and to_t

[SQL] Timestamp accuracy

2001-02-03 Thread Florian Steffen
Hi, The user manual said the Timestamp type has a microsecond accuracy, but how can I display the results of a query with microseconds ? Without formatting the output has an accuracy of 10^-2 second, and with formatting it is even worse since the formatting strings do not accept anything under t

[SQL] timestamp difference in hours? (fwd)

2000-09-29 Thread Alessandro Rossi
-- Forwarded message -- Date: Sat, 23 Sep 2000 15:58:06 +0200 (CEST) From: Alessandro Rossi <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: timestamp difference in hours? I found in a post from Jeff MacDonald the following example: bignose=> \d foo Table "foo"

Re: [SQL] Timestamp indexes

2000-07-21 Thread Tom Lane
"Mitch Vincent" <[EMAIL PROTECTED]> writes: > Looks like that index scan is very unattractive... Yes, though not as bad as the cost estimator thinks (almost a 5:1 ratio in estimated cost, but hardly any difference in real runtime). Still have some work to do in tweaking the estimates, obviously.

Re: [SQL] Timestamp indexes

2000-07-21 Thread Mitch Vincent
ive... I'll look for some other ways to speed up the query a bit.. Thanks! -Mitch - Original Message - From: "Tom Lane" <[EMAIL PROTECTED]> To: "Mitch Vincent" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, July 21, 2000 1:26 PM S

Re: [SQL] Timestamp indexes

2000-07-21 Thread Tom Lane
"Mitch Vincent" <[EMAIL PROTECTED]> writes: > select * from applicants as a where (a.created::date > '05-01-2000' or > a.resubmitted::date > '05-01-2000') order by (case when a.resubmitted > > a.created then a.resubmitted else a.created end) desc limit 10 offset 0 > There is one of the queries..

Re: [SQL] Timestamp indexes

2000-07-21 Thread Mitch Vincent
select * from applicants as a where (a.created::date > '05-01-2000' or a.resubmitted::date > '05-01-2000') order by (case when a.resubmitted > a.created then a.resubmitted else a.created end) desc limit 10 offset 0 There is one of the queries.. I just remembered that the order by was added since

Re: [SQL] Timestamp indexes

2000-07-21 Thread Tom Lane
"Mitch Vincent" <[EMAIL PROTECTED]> writes: > A while back I as told (by Tom Lane I *think*) that timestamp (previously > datetime) fields couldn't be indexed as such That's certainly not true now, if it ever was... regression=# create table applicants(resubmitted timestamp); CREATE regression=#

[SQL] Timestamp indexes

2000-07-21 Thread Mitch Vincent
A while back I as told (by Tom Lane I *think*) that timestamp (previously datetime) fields couldn't be indexed as such and that I should index them using this method : CREATE INDEX "applicants_resubmitted" on "applicants" using btree ( date ("resubmitted") "date_ops" ); Since almost all the que

Re: [SQL] Timestamp problem

2000-07-10 Thread Ed Loehr
Bernie Huang wrote: > > table > - > ... > borrow timestamp > return timestamp > > Now, I thought timestamp is in sec eg; 35434434, but in PostgreSQL, it > shows up as datetime datatype eg; 2000-06-07 17:00:05-07. > > I was wondering is this format a correct one for timestamp, or is it a

[SQL] Timestamp problem

2000-07-10 Thread Bernie Huang
Hi, I have Postgres 7.0, and I created a table table - ... borrow timestamp return timestamp Now, I thought timestamp is in sec eg; 35434434, but in PostgreSQL, it shows up as datetime datatype eg; 2000-06-07 17:00:05-07. I was wondering is this format a correct one for timestamp, or i