pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Datetime and pgtypes.c
4+ messages / 3 participants
[nested] [flat]

* Datetime and pgtypes.c
@ 2002-12-02 18:47  alexandre :: aldeia digital <alepaes@aldeiadigital.com.br>
  0 siblings, 1 reply; 4+ messages in thread

From: alexandre :: aldeia digital @ 2002-12-02 18:47 UTC (permalink / raw)
  To: pgsql-odbc

Mr. Hiroshi and all,

Sorry for report this bug again...The ODBC does not
convert 'datetime' type to 'timestamp without timezone'
for PostgreSQL 7.3
The MyLog output the correct version:
[2560]Extracted PostgreSQL version number: '7.3'

In pgtypes.c (annotate version), we have:


momjian  1.22                  case PG_TYPE_DATETIME:
hinoue  1.52                          if (PG_VERSION_GE(conn, 7.0))
hinoue  1.52                                  return "timestamp with time
zone";
hinoue  1.52                          else
hinoue  1.52                                  return "datetime";
inoue  1.47                  case PG_TYPE_TIMESTAMP_NO_TMZONE:
hinoue  1.52                          return "timestamp without time zone";


To correct this, I will need only to change the function
PG_VERSION_GE(conn, 7.3) or is a bug in the PG_VERSION_GE check
the GreatEqual version passed ???

Thank's again.






^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Datetime and pgtypes.c
@ 2002-12-03 00:40  Hiroshi Inoue <Inoue@tpf.co.jp>
  parent: alexandre :: aldeia digital <alepaes@aldeiadigital.com.br>
  0 siblings, 1 reply; 4+ messages in thread

From: Hiroshi Inoue @ 2002-12-03 00:40 UTC (permalink / raw)
  To: aldeia digital <alepaes@aldeiadigital.com.br>; +Cc: pgsql-odbc

alexandre :: aldeia digital wrote:
> 
> Mr. Hiroshi and all,
> 
> Sorry for report this bug again...The ODBC does not
> convert 'datetime' type to 'timestamp without timezone'
> for PostgreSQL 7.3

How do you convert the 'datetime' type concretely ?
Is the converted type still 'datetime' or 'timestamp with
time zone' ? Note that 'datetime' is never converted to
'timetstamp without time zone'.

regards,
Hiroshi Inoue
	http://w2422.nsk.ne.jp/~inoue/



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Datetime and pgtypes.c
@ 2002-12-03 12:35  alexandre :: aldeia digital <alepaes@aldeiadigital.com.br>
  parent: Hiroshi Inoue <Inoue@tpf.co.jp>
  0 siblings, 1 reply; 4+ messages in thread

From: alexandre :: aldeia digital @ 2002-12-03 12:35 UTC (permalink / raw)
  To: pgsql-odbc

Hi,

First, the correct is ´timestamp with time zone´ and not
'timestamp without timezone'... Sorry.

I have a lot of CREATE scripts using ´datetime´
correctly in PG <= 7.2.3...PG convert automaticaly
to ´timestamp with time zone´.
But I can´t change the ´datetime´ in these scripts and
PG 7.3 remove this type.
If I send a "create foo (foo datetime)", PG 7.3 reports
´datetime´ does not exist. I only execute this statments
in win-odbc and not directly in psql.

Can ODBC convert automatically ´datetime´
to timestamp with time zone' or I have to create this type in PG 7.3
to convert it ?

Very thank´s, Mr. Hiroshi.


> alexandre :: aldeia digital wrote:
>>
>> Mr. Hiroshi and all,
>>
>> Sorry for report this bug again...The ODBC does not
>> convert 'datetime' type to 'timestamp without timezone'
>> for PostgreSQL 7.3
>
> How do you convert the 'datetime' type concretely ?
> Is the converted type still 'datetime' or 'timestamp with
> time zone' ? Note that 'datetime' is never converted to
> 'timetstamp without time zone'.
>
> regards,
> Hiroshi Inoue
> 	http://w2422.nsk.ne.jp/~inoue/






^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Datetime and pgtypes.c
@ 2002-12-03 14:45  Tom Lane <tgl@sss.pgh.pa.us>
  parent: alexandre :: aldeia digital <alepaes@aldeiadigital.com.br>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2002-12-03 14:45 UTC (permalink / raw)
  To: alexandre :: aldeia digital <alepaes@aldeiadigital.com.br>; +Cc: pgsql-odbc

"alexandre :: aldeia digital" <alepaes@aldeiadigital.com.br> writes:
> I have a lot of CREATE scripts using ´datetime´
> correctly in PG <= 7.2.3...PG convert automaticaly
> to ´timestamp with time zone´.
> But I can´t change the ´datetime´ in these scripts and
> PG 7.3 remove this type.

If you can't afford the time to fix your scripts, you could use a DOMAIN
as a form of type alias:

regression=# create domain datetime timestamp with time zone;
CREATE DOMAIN
regression=# create table fooey (f1 datetime);
CREATE TABLE
regression=# select datetime('now');
           datetime
-------------------------------
 2002-12-03 09:44:46.458992-05
(1 row)

There might be some cases where this doesn't help, but I think it will
work for most of the common uses.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2002-12-03 14:45 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-12-02 18:47 Datetime and pgtypes.c alexandre :: aldeia digital <alepaes@aldeiadigital.com.br>
2002-12-03 00:40 ` Hiroshi Inoue <Inoue@tpf.co.jp>
2002-12-03 12:35   ` alexandre :: aldeia digital <alepaes@aldeiadigital.com.br>
2002-12-03 14:45     ` Tom Lane <tgl@sss.pgh.pa.us>

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