No Interval Conversion Function in 7.2?!!?

Поиск
Список
Период
Сортировка
Искать

No Interval Conversion Function in 7.2?!!?

От:
"Josh Berkus" <josh@agliodbs.com>
Дата:
Folks,

Please help!  I just upgraded a production database to PostgreSQL 7.2,and discovered that INTERVAL() is no longer a function.  What replacedit?  How can I convert VARCHAR to Interval?

-Josh

______AGLIO DATABASE SOLUTIONS___________________________                                      Josh Berkus Complete information technology      josh@agliodbs.com  and data management solutions       (415) 565-7293 for law firms, small businesses        fax 621-2533   and non-profit organizations.      San Francisco

Re: No Interval Conversion Function in 7.2?!!?

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
"Josh Berkus"  writes:
> Please help!  I just upgraded a production database to PostgreSQL 7.2,
>  and discovered that INTERVAL() is no longer a function.  What replaced
>  it?  How can I convert VARCHAR to Interval?

It's still there, but INTERVAL is a reserved word these days.
"INTERVAL"(varcharvalue)
varcharvalue::interval
CAST(varcharvalue AS interval)

should all give the same results.  Only the last of these is actually
standard.
		regards, tom lane

Re: No Interval Conversion Function in 7.2?!!?

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
I said:
> 	"INTERVAL"(varcharvalue)

Sigh, that one should be
"interval"(varcharvalue)
		regards, tom lane

FAQ