Re: Is it possible to use keywords (date units) in a function definition?

Поиск
Список
Период
Сортировка
От Alistair Johnson
Тема Re: Is it possible to use keywords (date units) in a function definition?
Дата
Msg-id CAKHmqNDF=yKXQ7ML3L9sMC0xCtJDYtdDQcS68GSV9NtqW9nyFA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Is it possible to use keywords (date units) in a function definition?  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general
I think you need to be more specific as to what "this" means.

Looking again after Andrian's comment are you trying to write, in the script file:

datetime_diff('start time as string'::timestamp, 'end time as string'::timestamp, HOUR)

and get PostgreSQL to recognize the value HOUR as a custom type value without single quotes surrounding it

If that is the question the answer is no.  The only type literals that can be written without single quotes are numbers.

The parsing of SQL can handle some standard mandated non-quoted constants but they are basically keywords, not values.

David J.

Thanks David - that was exactly my question - and it's nice to have a clear answer even if it wrinkles my plans a bit!

-Alistair

В списке pgsql-general по дате отправления:

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: Is it possible to use keywords (date units) in a function definition?
Следующее
От: Peter
Дата:
Сообщение: 12.2: Why do my Redo Logs disappear??