pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Incompatibility Postgres 7.1 - Postgres 7.3
3+ messages / 2 participants
[nested] [flat]

* Incompatibility Postgres 7.1 - Postgres 7.3
@ 2002-05-31 17:57  Areski Belaid <areski5@hotmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Areski Belaid @ 2002-05-31 17:57 UTC (permalink / raw)
  To: pgsql-php

Someone can help me ....

I have a compatibility problem between Postgres 7.1 - Postgres 7.3...
Guess !!! It's  --- timestamptz ---

When I create a field with timestamp type... the new postgresql replace that
by
timestamptz.... I use phpPgAdmin, I don't know where is from  the problem...

Simple example, If I execute that :
    CREATE TABLE "statistic" (
           "Id" int4 NOT NULL,
           "DATE" timestamp);

I shall have that on the database:
      CREATE TABLE "statistic" (
           "Id" int4 NOT NULL,
           "DATE" timestamptz);

Grrrrrr, =)

Helpsssssss, Areski





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

* Re: Incompatibility Postgres 7.1 - Postgres 7.3
@ 2002-06-01 14:33  Dan Wilson <dan@acucore.com>
  parent: Areski Belaid <areski5@hotmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Dan Wilson @ 2002-06-01 14:33 UTC (permalink / raw)
  To: Areski Belaid <areski5@hotmail.com>; +Cc: pgsql-php

Postgres has two different timestamp types now.  There is "timestamp with 
timezone" and "timestamp without timezone".  Internally the "with timezone" is 
stored as timestamptz. And by default, a timestamp will have a timezone. You 
can think of timestamptz as the same as timestamp.

So there is really not a problem here unless you wanted a "timestamp without 
timezone".  If this is the case, currently phpPgAdmin doesn't provide for the 
creation of timestamp without timezone through the table create 
functionality.  You will have to do it manually through the "Run SQL" box in 
the DB Details page.

-Dan

Quoting Areski Belaid <areski5@hotmail.com>:

> Someone can help me ....
> 
> I have a compatibility problem between Postgres 7.1 - Postgres 7.3...
> Guess !!! It's  --- timestamptz ---
> 
> When I create a field with timestamp type... the new postgresql replace that
> by
> timestamptz.... I use phpPgAdmin, I don't know where is from  the problem...
> 
> Simple example, If I execute that :
>     CREATE TABLE "statistic" (
>            "Id" int4 NOT NULL,
>            "DATE" timestamp);
> 
> I shall have that on the database:
>       CREATE TABLE "statistic" (
>            "Id" int4 NOT NULL,
>            "DATE" timestamptz);
> 
> Grrrrrr, =)
> 
> Helpsssssss, Areski
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly






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

* Incompatibility Postgres 7.1 - Postgres 7.2.1
@ 2002-06-04 11:16  Areski Belaid <areski5@hotmail.com>
  parent: Dan Wilson <dan@acucore.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Areski Belaid @ 2002-06-04 11:16 UTC (permalink / raw)
  To: pgsql-php


----- Original Message -----
From: "Dan Wilson" <dan@acucore.com>
To: "Areski Belaid" <areski5@hotmail.com>
Cc: <pgsql-php@postgresql.org>
Sent: Saturday, June 01, 2002 4:33 PM
Subject: Re: [PHP] Incompatibility Postgres 7.1 - Postgres 7.3


> Postgres has two different timestamp types now.  There is "timestamp with
> timezone" and "timestamp without timezone".  Internally the "with
timezone" is
> stored as timestamptz. And by default, a timestamp will have a timezone.
You
> can think of timestamptz as the same as timestamp.
>
> So there is really not a problem here unless you wanted a "timestamp
without
> timezone".  If this is the case, currently phpPgAdmin doesn't provide for
the
> creation of timestamp without timezone through the table create
> functionality.  You will have to do it manually through the "Run SQL" box
in
> the DB Details page.
>
> -Dan
>
> Quoting Areski Belaid <areski5@hotmail.com>:
>
> > Someone can help me ....
> >
> > I have a compatibility problem between Postgres 7.1 - Postgres 7.3...
> > Guess !!! It's  --- timestamptz ---
> >
> > When I create a field with timestamp type... the new postgresql replace
that
> > by
> > timestamptz.... I use phpPgAdmin, I don't know where is from  the
problem...
> >
> > Simple example, If I execute that :
> >     CREATE TABLE "statistic" (
> >            "Id" int4 NOT NULL,
> >            "DATE" timestamp);
> >
> > I shall have that on the database:
> >       CREATE TABLE "statistic" (
> >            "Id" int4 NOT NULL,
> >            "DATE" timestamptz);
> >
> > Grrrrrr, =)
> >
> > Helpsssssss, Areski
> >


It's working if I introduce the sql command directly in the shell...

CREATE TABLE "statistic" (
          "Id" int4 NOT NULL,
          "DATE" timestamp without time zone);

One thing good, but I just realize That my  problem isn't coming of the time
zone
BUT of the precision...

EXAMPLE:
If I want know the number of day between two date ($lastdate -
$firstdate)...

Value of firstdate = 2002-05-31 12:27:05.121201
Value of lastdate = 2002-06-04 12:29:25.147232

$oneday = 60*60*24*1;
$number_day_between_two_date = intval(( strtotime($lastdate) -
strtotime($firstdate) )/$oneday);

I did that and It' was working without problem before the upgrate of
postgres (Postgres 7.1 - Postgres 7.2.1)

Someone have a idea... What I can do to know the number of day between two
date...


Areski'ch




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


end of thread, other threads:[~2002-06-04 11:16 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-05-31 17:57 Incompatibility Postgres 7.1 - Postgres 7.3 Areski Belaid <areski5@hotmail.com>
2002-06-01 14:33 ` Dan Wilson <dan@acucore.com>
2002-06-04 11:16   ` Incompatibility Postgres 7.1 - Postgres 7.2.1 Areski Belaid <areski5@hotmail.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