CREATE VIEW blah AS SELECT DISTINCT etc

Поиск
Список
Период
Сортировка
Искать
От
Moray McConnachie
Тема
CREATE VIEW blah AS SELECT DISTINCT etc
Дата
Msg-id
001801bf1c6d$c1404190$760e01a3@oucs.ox.ac.uk
Список
Дерево обсуждения
Re: [GENERAL] User defined function "Moray McConnachie" <moray.mcconnachie@computing-services.oxford.ac.uk>
Re: [GENERAL] User defined function "Aaron J. Seigo" <aaron@gtv.ca>
Re: [GENERAL] User defined function Herouth Maoz <herouth@oumail.openu.ac.il>
Re: [GENERAL] User defined function Moray McConnachie <Moray.McConnachie@computing-services.oxford.ac.uk>
I don't see implement SELECT DISTINCT in views on the To Do list?

I'm using 6.5.2, and on doing
CREATE VIEW blahview AS SELECT DISTINCT bleurgh,blaagh FROM blah;

I get
ERROR: DISTINCT not supported in views.

However, the \h command in psql gives
CREATE VIEW view_name AS
SELECT [DISTINCT [ON attrN]]
etc.

I can't find the bug report form on the WWW to submit a bug report for
psql on this. The FAQ merely says

1.13) How do I submit a bug report?

Fill out the "bug-template" file and send it to: bugs@postgreSQL.org

No indication of how to get hold of the bug-template file...

Thanks,
Moray

----------------------------------------------------------------------
----------------
Moray.McConnachie@computing-services.oxford.ac.uk
----- Original Message -----
From: Aaron J. Seigo 
To: Moray McConnachie
;

Cc: 
Sent: Friday, October 15, 1999 7:58 PM
Subject: Re: [GENERAL] User defined function


> hi...
>
> >
> > >  CREATE FUNCTION startofregyear(date) RETURNS date AS '
> > >  SELECT text_datetime(''01/12/''
> > float8_text(datepart(''year'',$1)-1))
> > >  AS answer;
> >  > ' LANGUAGE 'SQL';
> >
> > absolutely not, I tried that already.
> > I get "attribute not found" error  wherever the opening
double-quotes
> > are during the create of the function.
>
> try this (it works quite nicely):
>  select (''12-1-'' || date_part(''year'',$1) - 1)::date;
>
> your problem is 2 fold. first, you need double quotes. second, it
isn't
> datepart, its date_part. that's the "attribute not found" error.
>
> as a suggestion, try doing the select statement from the command
line outside
> of a function first to make sure it works. i.e:
>   select ('12-1-' || date_part('year','now'::date) - 1)::date;
>
> once you know that your select works, pop it into the function.
functions don't
> return the most helpful error messages =) the command line in psql
is much
> better for debugging selects/inserts/etc/etc...
>
>
>  --
> Aaron J. Seigo
> Sys Admin
>
> ************
>
>

В списке pgsql-general по дате отправления
От: Gene Selkov, Jr.
Дата:
От: Bob Kline
Дата:
FAQ