Skip site navigation (1) Skip section navigation (2)

Reference Manual

From: "Jose' Soares Da Silva" <sferac(at)proxy(dot)bazzanese(dot)com>
To: pgsql-hackers(at)postgreSQL(dot)org, pgsql-docs(at)postgreSQL(dot)org
Subject: Reference Manual
Date: 1998-03-30 15:19:05
Message-ID: Pine.LNX.3.96.980330145248.417B-100000@proxy.bazzanese.com (view raw or flat)
Thread:
Lists: 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'


Responses

pgsql-hackers by date

Next:From: Bruce MomjianDate: 1998-03-30 15:25:03
Subject: Re: [HACKERS] Reference Manual]
Previous:From: Zeugswetter Andreas SARZDate: 1998-03-30 12:20:42
Subject: AW: [HACKERS] Optimizer fails?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group