Reference Manual

Поиск
Список
Период
Сортировка
От Jose' Soares Da Silva
Тема Reference Manual
Дата
Msg-id Pine.LNX.3.96.980330145248.417B-100000@proxy.bazzanese.com
обсуждение исходный текст
Ответы Re: [HACKERS] Reference Manual]  (Bruce Momjian <maillist@candle.pha.pa.us>)
Список pgsql-hackers
Hi, all

I'm writing Reference Manual and I have two questions:

1 - Why PostgreSQL accept HOUR, MINUTE and SECOND to extract if from a
    date ?

   EXTRACT (field FROM date_expression)

   There are no such fields on a date!

   It make sense only for SQL92 syntax because it uses also time and interval
   types:

   EXTRACT -- extract a datetime field from a datetime or interval.

        The possible values for field are:
           - YEAR
           - MONTH
           - DAY
           - HOUR
           - MINUTE
           - SECOND
           - TIMEZONE_HOUR
           - TIMEZONE_MINUTE

------------------------------------------------------------------------

2. - Seems that optional ALL keyword of UNION doesn't work.
     The following query prints always the same result with and without
     the ALL clause.

*    UNION of two tables:

mytable:            yourtable:
         id|name               id|name
         --+------             --+------
          1|Smith               1|Soares
          2|Jones               2|Panini
          3|Soares


SELECT mytable.id, mytable.name
FROM mytable
WHERE mytable.name LIKE 'S%'
   UNION
       SELECT yourtable.id, yourtable.name
       FROM yourtable
       WHERE yourtable.name LIKE 'S%';

this is the result even if I don't specify ALL.
                     id|name
                     --+------
                      1|Smith
                      1|Soares
                      3|Soares
---------
SQL92 says that result does not contain any duplicate rows anless
      the ALL keyword is specified.

What's wrong with my example ?
                                                  Thanks, Jose'


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

Предыдущее
От: "Vadim B. Mikheev"
Дата:
Сообщение: Re: [HACKERS] Optimizer fails?
Следующее
От: Zeugswetter Andreas SARZ
Дата:
Сообщение: AW: [HACKERS] Optimizer fails?