Agrupe por cláusula no mySQL e no postgreSQL, por que o erro no postgreSQL?

Suponha que eu tenha esta tabela: named =a mesa cuja estrutura é:

postgreSQL:

 create table the_table (col3 SERIAL, col2 varchar, col1 varchar, PRIMARY KEY(col3));

MySQL:

create table the_table ( col3 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, col2 varchar(20), col1 varchar(20) )

Então eu inseri a tabela:

INSERT INTO the_table (col2,col1) VALUES 
('x','a'),
('x','b'),
('y','c'),
('y','d'),
('z','e'),
('z','f');

Agora a tabela fica assim:

col3 | col2 | col1 
------+------+------
    1 | x    | a
    2 | x    | b
    3 | y    | c
    4 | y    | d
    5 | z    | e
    6 | z    | f

Quando faço essa consulta:

select * from the_table group by col2

então no mysql eu recebo:

1 x a
3 y c
5 z e

e no postgreSQL, estou recebendo erro:

ERROR:  column "the_table.col3" must appear in the GROUP BY clause or be used in an aggregate function
LINE 1: select * from the_table group by col2;

Minhas perguntas:

O que esse erro significa? O que é função agregada?

Quando funciona no MySQL, por que não pode funcionar no postgreSQL?

questionAnswers(3)

yourAnswerToTheQuestion