Re: [SQL] ERROR: ExecEvalAggref: no aggregates in thisexpressioncontext

2000-07-05 Thread Paul McGarry
Tom Lane wrote: > View? Hmm, we know that views involving GROUP BY or aggregates > don't work very well. We hope to fix those problems in 7.2, but > right now there's probably not much that can be done about it. > I'd recommend avoiding views that use those features for now. Yes, I've just dis

Re: [SQL] ERROR: ExecEvalAggref: no aggregates in this expressioncontext

2000-07-05 Thread Tom Lane
Paul McGarry <[EMAIL PROTECTED]> writes: >> Yup. ExecEvalAggref is supposed to fetch the result of a (previously >> computed) aggregate function. It's unhappy because it's not finding >> anything to return. This is a bug --- can we see a complete example >> that causes it? > The view that I am

[SQL] ALTER TABLE ADD COLUMN syntax question.

2000-07-05 Thread Robert B. Easter
I used the command below to alter a table and it took with no problem, but the REFERENCES appears to have been ignored since I can put invalid numbers into last_post_id. Are there plans to add the ability to specify column constrainsts with ALTER TABLE ADD COLUMN in the future? For now, I suppo

Re: [SQL] ERROR: ExecEvalAggref: no aggregates in thisexpressioncontext

2000-07-05 Thread Paul McGarry
Paul McGarry wrote: > If I do a 'SELECT * from view_name' and get 8 rows of data, when I > do a 'SELECT count(*) from view_name' I get 8 rows of the > number 1 returned. I've attached a script which will generate a bunch of tables and a view then do a select * and select count(*) on that view.

Re: [SQL] ERROR: ExecEvalAggref: no aggregates in thisexpressioncontext

2000-07-05 Thread Paul McGarry
Hi Tom, Tom Lane wrote: > > ERROR: ExecEvalAggref: no aggregates in this expression context > > Does it mean that there aren't any aggregate in the expression > > context when there should be. > Yup. ExecEvalAggref is supposed to fetch the result of a (previously > computed) aggregate function.

Re: [SQL] ERROR: ExecEvalAggref: no aggregates in this expression context

2000-07-05 Thread Tom Lane
Paul McGarry <[EMAIL PROTECTED]> writes: > Can someone tell me what this error message means: > ERROR: ExecEvalAggref: no aggregates in this expression context > Does it mean that there aren't any aggregate in the expression > context when there should be. Yup. ExecEvalAggref is supposed to fet

Re: [SQL] Median

2000-07-05 Thread omid omoomi
Hi, I'll be glad if you describe more details about the problem. Is it a kind of statistical analysis or what? Omid Omoomi >From: "Kermani, Bahram" <[EMAIL PROTECTED]> >To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]> >Subject: [SQL] Median >Date: Fri, 30 Jun 2000 17:37:06 -0700 > >Hello, > >I am t

RE: [SQL] bug in using index scans? More Investigating

2000-07-05 Thread Martin, Sylvain R. (LNG)
just for the heck of it I decided to run the following in case it helped rvbs=# explain select count(*) from PI_Keywords where keyword like 'peripherals & access%'; NOTICE: QUERY PLAN: Aggregate (cost=35.98..35.98 rows=1 width=4) -> Index Scan using pi_keywords_idx on pi_keywords (cost=0.0

Re: [SQL] Aww, sorry (last day of month)

2000-07-05 Thread Thomas Lockhart
> What i ment was, that I have information about workers, and I have to make > report on them. Report should contain status about workers with the > restriction , that the data is about last day of the month. I use perl as > a scripting language, and how the hell should I know how many days were i

[SQL] bug in using index scans?

2000-07-05 Thread Martin, Sylvain R. (LNG)
I've notice on certain queries, I was waiting a long time for a return so I set out to troubleshoot something here's what I ran into... When I do a explain on a select looking for 'peripherals & access' it uses sequential scan but any other keyword uses index scan. I've ran the vacuum analyze on P

Re: [SQL] Problem with joins

2000-07-05 Thread Thomas Lockhart
> I want to get a list of data sources with the corresponding data, > if the data exists, or with null, if the data doesn't. But anyway > I need the data sources (all of them). You want an outer join. Postgres doesn't have that yet, but you can mimic it. > I have also tried: > select source_nam

[SQL] ERROR: ExecEvalAggref: no aggregates in this expression context

2000-07-05 Thread Paul McGarry
Hello, Can someone tell me what this error message means: == ERROR: ExecEvalAggref: no aggregates in this expression context == Does it mean that there aren't any aggregate in the expression context when there should be. Does it mean there are and there shouldn't be? For that ma

Re: Antw: [SQL] Problem with joins

2000-07-05 Thread Jean-Marc Libs
On Wed, 5 Jul 2000, Gerhard Dieringer wrote: > Jean-Marc Libs wrote: > >... > >I have also tried: > >select source_name,data_value from source,data where data_source_id=source_id union >select source_name,source_id,NULL from source,data > > >This is a bit better, in the sense that I get back al

[SQL] Median

2000-07-05 Thread Kermani, Bahram
Hello,   I am trying to do a Median or Trimmed-mean operation in postgreSQL. I was wondering if anybody knew how to do it. I appreciate it if you reply to my email address.   Thanks, Bahram Kermani [EMAIL PROTECTED]

Re: [SQL] GROUP by finish&&last day of month

2000-07-05 Thread Patrick Jacquot
Antti Linno wrote: > Ok, if I want to get non-aggregat data in groups, I use order by. This > group by seemed so logical though, but the fruit that u can't have, is > usually the most sweet. > > New question, how to get the last day of month(order data by last day of > month). And to prevent chai

Re: [SQL] GROUP by finish&&last day of month

2000-07-05 Thread [EMAIL PROTECTED]
Not quite sure what you mean, but how about this: select date_part('day', 'Jul 01 00:00:00 2000 PDT'::datetime-1); You must specify Jul for June, i.e. always the following month. You could get around that too, but since I don't know why you need to do what you asked, I'll leave it at this. Tr

[SQL] Aww, sorry (last day of month)

2000-07-05 Thread Antti Linno
I thought, I finished that group by theme. What i ment was, that I have information about workers, and I have to make report on them. Report should contain status about workers with the restriction , that the data is about last day of the month. I use perl as a scripting language, and how the he

Re: [SQL] Which procedural language to use for functions.

2000-07-05 Thread Jan Wieck
Saltsgaver, Scott wrote: > Which procedural language is best for writing PostgreSQL functions: > 'PL/pgSQL', 'PL/perl', or 'PL/Tcl'? > > I know that I can't do table creates in 'PL/pgSQL'? > > Is there an obvious choice as far speed and size? PL/Tcl has the advantage that it can do the table

Re: [SQL] GROUP by finish&&last day of month

2000-07-05 Thread Jerome Alet
On Wed, 5 Jul 2000, Antti Linno wrote: > New question, how to get the last day of month(order data by last day of > month). I'm sorry but I don't understand how you could order something by a value (last day of month). you can only order things by a field (e.g. a date field) or fields, in incr

[SQL] GROUP by finish&&last day of month

2000-07-05 Thread Antti Linno
Ok, if I want to get non-aggregat data in groups, I use order by. This group by seemed so logical though, but the fruit that u can't have, is usually the most sweet. New question, how to get the last day of month(order data by last day of month). And to prevent chain letter from misunderstanding

Re: [SQL] Group BY ...(cont.)

2000-07-05 Thread Jesus Aneiros
No, you don't you could say: SELECT workgroup, id FROM job GROUP BY workgroups; On Wed, 5 Jul 2000, Antti Linno wrote: > Ok, if I want to use group by, then I have to put every select field > afterwards to group by. But I do want to group by one field. > Hence > select workgroup,id from job gro

[SQL] PLPGSQL - does not support more than 8 args?

2000-07-05 Thread Grigori Soloviov
Hi. I just came accross the big trouble. " ERROR: Procedures cannot take more than 8 arguments" Really?!? Does anybody know what to do to make it take 9 and more argments. grishick [EMAIL PROTECTED]

Re: [SQL] Group BY ...(cont.)

2000-07-05 Thread [EMAIL PROTECTED]
E.g. select workgroup from job group by workgroup; will that do? Troy > > Ok, if I want to use group by, then I have to put every select field > afterwards to group by. But I do want to group by one field. > Hence > select workgroup,id from job group by workgroup,id; > would create groups o

Re: [SQL] GROUP by

2000-07-05 Thread Jesus Aneiros
You can use group by without having an aggregate operator but if you use an aggregate you have to put the group by column int the select. By the way what is after the AND? I hope it is not another workgroup condition because it doesn't have much sense, I think. If you are filtering different type

Antw: [SQL] GROUP by

2000-07-05 Thread Gerhard Dieringer
Antti Linno <[EMAIL PROTECTED]> wrote: > I have table job, and I want to select data from it, grouping by > workgroups. When I use > select id,name from job where workgroup='top leaders' AND ... group by > workgroup; > When I want to group, I get > ERROR: Illegal use of aggregates or non-gr

[SQL] Group BY ...(cont.)

2000-07-05 Thread Antti Linno
Ok, if I want to use group by, then I have to put every select field afterwards to group by. But I do want to group by one field. Hence select workgroup,id from job group by workgroup,id; would create groups of 1? But I want to group by workgroups. Sorry if my explanation is fuzzy. A.

Re: [SQL] GROUP by

2000-07-05 Thread Jerome Alet
On Wed, 5 Jul 2000, Antti Linno wrote: > I have table job, and I want to select data from it, grouping by > workgroups. When I use > select id,name from job where workgroup='top leaders' AND ... group by > workgroup; this query is probably incorrect: because of the "where workgroup=" the "gro

[SQL] GROUP by

2000-07-05 Thread Antti Linno
I have table job, and I want to select data from it, grouping by workgroups. When I use select id,name from job where workgroup='top leaders' AND ... group by workgroup; When I want to group, I get ERROR: Illegal use of aggregates or non-group column in target list I'm confused, why does quer

Antw: [SQL] Problem with joins

2000-07-05 Thread Gerhard Dieringer
Jean-Marc Libs wrote: >... >I have also tried: >select source_name,data_value from source,data where data_source_id=source_id union >select source_name,source_id,NULL from source,data >This is a bit better, in the sense that I get back all I need, but there >are too many lines: when there is da

[SQL] Problem with joins

2000-07-05 Thread Jean-Marc Libs
Hi all, I am trying to do something unusual (for me) and I can't quite find the relevant part in the documentation (no mention to joins in the insert section, or the index). I want to get a list of data sources with the corresponding data, if the data exists, or with null, if the data doesn't. B