Thread: Problems to be solved as soon as possible

Problems to be solved as soon as possible

From
"The Guardian"
Date:
Dear Support Team,We are hosting a website which was originally designed in some version of
Debian Linux and having PostgreSQL as back end. The developers have made a
script which creates several tables in the database. Some of the tables have
datatypes like DateTime. When i run those scripts in PostgreSQL of Red hat
Linux 7.2, they run perfectly. But when i run the same scrips in PostgreSQL
of Redhat Linux 9.0, it displays an error message of "data type DATETIME not
found."So can you please guide me what changes i have to make in the script of
creating tables at my end as a customer so that my application runs
smoothly.

Regards,
The Guardian.
Ph: 31074723 / 32511869.
Website: www.guardianindia.com
Email:   theguardian@vsnl.net




Re: Problems to be solved as soon as possible

From
Tomasz Myrta
Date:
> Dear Support Team,
>     We are hosting a website which was originally designed in some version of
> Debian Linux and having PostgreSQL as back end. The developers have made a
> script which creates several tables in the database. Some of the tables have
> datatypes like DateTime. When i run those scripts in PostgreSQL of Red hat
> Linux 7.2, they run perfectly. But when i run the same scrips in PostgreSQL
> of Redhat Linux 9.0, it displays an error message of "data type DATETIME not
> found."
>     So can you please guide me what changes i have to make in the script of
> creating tables at my end as a customer so that my application runs
> smoothly.

It looks like Postgresql problem, not a Redhat problem. Probably 
datetime is some not longer supported datatype. General date and time 
datatype is "timestamp". Try to change your "datetime" to "timestamp" - 
it should help. Anyway, what versions your Postgresql rpm's have?

Regards,
Tomasz Myrta



Re: Problems to be solved as soon as possible

From
Tom Lane
Date:
Tomasz Myrta <jasiek@klaster.net> writes:
>> datatypes like DateTime. When i run those scripts in PostgreSQL of Red hat
>> Linux 7.2, they run perfectly. But when i run the same scrips in PostgreSQL
>> of Redhat Linux 9.0, it displays an error message of "data type DATETIME not
>> found."

> It looks like Postgresql problem, not a Redhat problem. Probably 
> datetime is some not longer supported datatype.

Yes, "datetime" is an ancient name for what we now call by the
SQL-standard name "timestamp with time zone".

If changing to the standard name makes for too many changes in your
application code, you could use a domain as a kind of type alias:
create domain datetime as timestamp with time zone;
        regards, tom lane


Re: Problems to be solved as soon as possible

From
Josh Berkus
Date:
"The Guardian",

> Dear Support Team,

We are not a "support team".  We are your fellow PostgreSQL users, and are
helping you out of our personal generosity and desire to promote Postgres
use.   Nobody on this list is paid to answer your question.

You are expected to "pay" for this support by, in turn, helping other users
who are less experienced than you.   This peer-to-peer help strategy has kept
PostgreSQL going for 16 years, and is often faster than traditional
commercial support.   However, you should remember that the people you are
talking to are not paid support staff, and remember that the people answering
your questions are doing you a favor.

>     We are hosting a website which was originally designed in some version of
> Debian Linux and having PostgreSQL as back end. The developers have made a
> script which creates several tables in the database. Some of the tables have
> datatypes like DateTime. When i run those scripts in PostgreSQL of Red hat
> Linux 7.2, they run perfectly. But when i run the same scrips in PostgreSQL
> of Redhat Linux 9.0, it displays an error message of "data type DATETIME not
> found."
The DATETIME data type was included in PostgreSQL versions 6.5 to 7.1 (as I
recall) in order to provide compatibility with certain commercial database
products.  Before 7.2, the core developers decided that it was silly to
maintain support for a data type which was not SQL-standard just for
compatibility with 2 commercial databases, and so support for DATETIME was
phased out over the next two versions.
You can fix your scripts by doing a search-and-replace on DATETIME and
replacing it with TIMESTAMP, which provides the same functionality.

--
-Josh BerkusAglio Database SolutionsSan Francisco