I wrote:
> Hmm, this seems like a plpgsql deficiency. It feels it can generate a
> separate parameter symbol ($n) for each occurrence of each variable it
> passes into a SQL query. But for this query to be legal, the two
> instances of IntervalMinutes have to be represented by the *same*
> parame
> Daniel Caune wrote:
>> Is there any suggestion against using OUT parameter for local
>> calculation such as using a local variable?
In plpgsql (at least in the current implementation) an OUT parameter is
pretty much just a local variable, and so there's no efficiency argument
against using it as
Title: Function Parameters in GROUP BY clause cause errors
Just Put aggregate function to the fields
you selected.
Like this:
select
to_char(to_timestamp(EXTRACT(HOUR FROM max(em.email_creation_datetime))
|| ':' || (EXTRACT(MINUTE FROM max(em.email_creation_datetime))::integer/30)
* 30
Daniel Caune wrote:
> Is there any suggestion against using OUT parameter for local
> calculation such as using a local variable?
>
> CREATE OR REPLACE FUNCTION foo(a IN int,
>b1 OUT int,
>b2 OUT int)
> AS $$
> BEGIN
> FOR (...) LO
Hi,
Is there any suggestion against using OUT parameter for local
calculation such as using a local variable?
CREATE OR REPLACE FUNCTION foo(a IN int,
b1 OUT int,
b2 OUT int)
AS $$
BEGIN
FOR (...) LOOP
b1 = (...);
b2 = (...);
"Davidson, Robert" <[EMAIL PROTECTED]> writes:
> ERROR: column "em.email_creation_datetime" must appear in the GROUP BY =
> clause or be used in an aggregate function
> CONTEXT: SQL statement " select to_char(to_timestamp(EXTRACT(HOUR FROM =
> em.email_creation_datetime) || ':' || (EXTRACT(MINUTE
> > Hi,
> >
> > How can I enter description for my custom types?
> >
> > \dT provides information such as schema, name, and description for
all
> > the registered types and custom types. I would like to provide a
> > description for each custom type I create.
> >
> > Thanks,
> >
> >
> > --
> > D
Terry Lee Tucker wrote:
> rnd=# \h comment
> Command: COMMENT
> Description: define or change the comment of an object
> ..I believe this is what you need.
>
Cool!
That's a great feature. Though it would be even nicer if the comment
showed when
you "\d" a table::
stage=# comment on table
On Wednesday 22 March 2006 03:25 pm, Daniel Caune saith:
> Hi,
>
> How can I enter description for my custom types?
>
> \dT provides information such as schema, name, and description for all
> the registered types and custom types. I would like to provide a
> description for each custom type I cr
Hi,
How can I enter description for my custom types?
\dT provides information such as schema, name, and description for all
the registered types and custom types. I would like to provide a
description for each custom type I create.
Thanks,
--
Daniel CAUNE
Ubisoft Online Technology
(514) 4090
Title: Function Parameters in GROUP BY clause cause errors
When I use a parameter in a query which aggregates it fails with a GROUP BY error. What syntax can I use to avoid this error?
CREATE TABLE test (email_creation_datetime timestamp);
INSERT INTO test VALUES ('2006-03-20 09:00');
INSE
Hello Markus,
Wednesday, March 22, 2006, 8:35:33 PM, you wrote:
MB>Send an EXPLAIN ANALYZE of the query along with the description of the
MB>involved tables. Also hardware information (RAM, disks, CPU), what
MB>other applications are running on that box and the parameter values in
MB>postgresql.c
Hello Markus,
Wednesday, March 22, 2006, 8:12:35 PM, you wrote:
MB> Well, send the table descriptions, please.
\d towar
max3 | smallint | default 0
max4 | smallint | default 0
typik | character varying(1) | default '_'::c
Maciej Piekielniak wrote:
Hello Markus,
Oryginal query return 7881 rows , your query only 729 rows.
But it's faster!
---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if
Hello Markus,
Oryginal query return 7881 rows , your query only 729 rows.
--
Best regards,
Maciejmailto:[EMAIL PROTECTED]
---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster
Hello Markus,
Sorry, I try this:
SELECT
towar.id_towar,
towar.key2,
towar.nazwa,
0 AS min,
0 AS max,
towar.ilosc_jed,
towar.ilosc_nom,
towar.ilosc_paczkowa,
dostawcy.id_dostawcy,
jednostka_miary.jednostka,
0.0
Hello Markus,
ERROR: column "foo.z_zamowien" must appear in the GROUP BY clause or be used
in an aggregate function
--
Best regards,
Maciejmailto:[EMAIL PROTECTED]
---(end of broadcast)---
TIP 5: don't forget to inc
Hello Markus,
Wednesday, March 22, 2006, 7:32:11 PM, you wrote:
MB> foo.z_zamowien,
MB> ) AS foo ON (foo.id_towar = towar.id_towar)
foo?
--
Best regards,
Maciejmailto:[EMAIL PROTECTED]
---(end of broadcast)-
In the meantime, try this:
SELECT
towar.id_towar,
towar.key2,
towar.nazwa,
0 AS min,
0 AS max,
towar.ilosc_jed,
towar.ilosc_nom,
towar.ilosc_paczkowa,
dostawcy.id_dostawcy,
jednostka_miary.jednostka,
0.0 AS ilo
That's an explain. We need explain analyze.
2006/3/23, Maciej Piekielniak <[EMAIL PROTECTED]>:
> Hello Markus,
>
> Wednesday, March 22, 2006, 6:58:44 PM, you wrote:
>
> MB> Send an EXPLAIN ANALYZE of the query along with the description of the
> MB> involved tables. Also hardware information (RAM,
Hello Markus,
Wednesday, March 22, 2006, 6:58:44 PM, you wrote:
MB> Send an EXPLAIN ANALYZE of the query along with the description of the
MB> involved tables. Also hardware information (RAM, disks, CPU), what
MB> other applications are running on that box and the parameter values in
MB> postgres
Send an EXPLAIN ANALYZE of the query along with the description of the
involved tables. Also hardware information (RAM, disks, CPU), what
other applications are running on that box and the parameter values in
postgresql.conf that you changed from the defaults would be
interesting.
Markus
2006/3/2
Hello pgsql-sql,
I have postgresql 8.1.3 and database with about 2,7GB (90% large
objects).
When I execute this query postgresql calculate this 2min 50sec. How
can I optimize this query?
select towar.id_towar,towar.key2,towar.nazwa,0 as min,0 as
max,towar.ilosc_jed,towar.ilosc
ivan marchesini <[EMAIL PROTECTED]> writes:
> I have a .txt file, containing some tabular data, where data are
> delimited by TABs.
> there are 3 columns:
> column1 int4, column2 float8, column3 float8
> the problem is that column3 contains also null values (i.e. sometimes is
> empty)
This should
That worked perfectly - thanks!
CREATE OR REPLACE FUNCTION Testing(TrailingWeeks int) RETURNS date AS $$
BEGIN
RETURN current_date - (TrailingWeeks || ' weeks')::INTERVAL;
END;
$$ LANGUAGE plpgsql;
select * from testing(1);
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMA
yup... Replace the empty spaces in the file with some other value...
replace null values with \N
then try COPYing againOn 3/22/06, Luckys <[EMAIL PROTECTED]> wrote:
On 3/22/06, Achilleus Mantzios <
[EMAIL PROTECTED]> wrote:
O ivan marchesini έγραψε στις Mar 22, 2006 :> Dear users,> I'm working
On 3/22/06, Achilleus Mantzios <[EMAIL PROTECTED]> wrote:
O ivan marchesini έγραψε στις Mar 22, 2006 :> Dear users,> I'm working on a Postgres 7.4
server>> I have a .txt file, containing some tabular data, where data are> delimited by TABs.> there are 3 columns:>> column1 int4, column2 float8, co
O ivan marchesini έγραψε στις Mar 22, 2006 :
> Dear users,
> I'm working on a Postgres 7.4 server
>
> I have a .txt file, containing some tabular data, where data are
> delimited by TABs.
> there are 3 columns:
>
> column1 int4, column2 float8, column3 float8
>
> the problem is that column3 con
Dear users,
I'm working on a Postgres 7.4 server
I have a .txt file, containing some tabular data, where data are
delimited by TABs.
there are 3 columns:
column1 int4, column2 float8, column3 float8
the problem is that column3 contains also null values (i.e. sometimes is
empty)
so when I try to
[EMAIL PROTECTED] wrote:
Hello,
I've got 2 tables, "url" (U), and "bookmark" (B), with "bookmark" pointing to
"url" via FK.
Somehow I ended up with some rows in B referencing non-existent rows in U.
This sounds super strange and dangerous to me, and it's not clear to me how/why
PG let this ha
30 matches
Mail list logo