Hi
I would like to calculate a product of a field's values of a relation,
this function may multiply each value and give the result as a single
float number.
For example:
CREATE table imaginary(id INTEGER NOT NULL, some_field FLOAT
NULL,primary key(id));
INSERT INTO imarginary(1,0.333);I
At the moment I have two probable solutions, the first makes use of
cursors and requires looping though each record, the other a
not-so-elegant solution (and may be unfavourable for large datasets)
makes use of arrays and the EXECUTE command (in plpgsql).
The second solution is as follows.
Try this command separately.
# service postgresql stop
and then
# service postgresql start
On Воскресенье 03 мая 2009 23:01:24 Grzegorz Buś wrote:
> postgresql restart
> Stopping postgresql service: [ OK ]
> Starting postgresql service:
In response to Allan Kamau :
> Hi
>
> I would like to calculate a product of a field's values of a relation,
> this function may multiply each value and give the result as a single
> float number.
>
> For example:
>
>
> CREATE table imaginary(id INTEGER NOT NULL, some_field FLOAT
> NULL,prim
On Mon, May 4, 2009 at 10:42 AM, A. Kretschmer
wrote:
> In response to Allan Kamau :
>> Hi
>>
>> I would like to calculate a product of a field's values of a relation,
>> this function may multiply each value and give the result as a single
>> float number.
>>
>> For example:
>>
>>
>> CREATE t
On 2009-05-04, Allan Kamau wrote:
> Hi
>
> I would like to calculate a product of a field's values of a relation,
> this function may multiply each value and give the result as a single
> float number.
>
> For example:
>
>
> CREATE table imaginary(id INTEGER NOT NULL, some_field FLOAT
> NULL,pr
On 2009-05-03, Scott Marlowe wrote:
> On Sun, May 3, 2009 at 9:38 AM, Wojtek wrote:
>> Hi,
>>
>> I have a question on transactions/isolation levels/etc...
>> In my PL/pgSQL function main loop goes through inventory list of active
>> devices, for each one executing processing applicable for given
In response to Jasen Betts :
> > Is there an already existing function that does this.
>
> here's one way to cheat: logarythms.
>
> select exp(sum(ln( thiscolumn ))) from foo;
>
> :^)
nice ;-)
Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header
Hi!
I want to implement a versioning system for text columns of a table
inside a PostgreSQL 8.3 database. As some of the changes to a text field
might be very small compared to the total text size, I'd prefer storing
diffs instead of full previous versions of the text and use a patch-like
function
> > # cat /var/lib/pgsql/data/pgstartup.log
> > LOG: could not bind IPv4 socket: Address already in use
> > HINT: Is another postmaster already running on port 5432? If not,
> wait a
> > few seconds and retry.
>
> Did you heed the HINT and see if there is another instance of Postgres
> running?
When I run separately start/stop commands I still get "could not bind socket"
message:
# service postgresql stop
Stopping postgresql service: [ OK ]
# netstat -plunt | grep 5432
# ps -A | grep postmaster
# rm /var/lib/pgsql/pgstartup.log
rm: remove regular file `/v
Hi,
How can I add automatic backup easily?
Is it possible with pgadmin ?
Also, I would like to know whether those options (Blobs(checked), OIDS,
Insert Commands, Disable Quoting is for) .. as it is now, it works great
without them.
Thanks in advance / Moe
In response to Bill Moseley :
> On Sun, May 03, 2009 at 09:08:29PM -0400, Tom Lane wrote:
> > > There are no other updates to that account table in the transaction, so
> > > I'm
> > > confused how that is causing a deadlock.
> >
> > Is there more than one row with the target id?
>
> No. It's a
In response to Bill Moran :
> In response to Bill Moseley :
>
> > On Sun, May 03, 2009 at 09:08:29PM -0400, Tom Lane wrote:
> > > > There are no other updates to that account table in the transaction, so
> > > > I'm
> > > > confused how that is causing a deadlock.
> > >
> > > Is there more than
Hello,
i'm writting some functions for parsing urls and handling strings. But i
have problems with the result set.
I already figured out how to return a single record/row. But i need
more. A good example for what i want is ts_debug();
cse=> SELECT alias, token from
ts_debug('http://www.pos
Hello
http://www.postgres.cz/index.php/PL/pgSQL_(en)#Functions_which_return_tables
regards
Pavel Stehule
2009/5/4 Torsten Zühlsdorff :
> Hello,
>
> i'm writting some functions for parsing urls and handling strings. But i
> have problems with the result set.
>
> I already figured out how to retur
On Mon, May 04, 2009 at 12:26:13PM +0200, Markus Wollny wrote:
> So far I have been playing around with PL/PerlU for diff/path
> functionality, using CPAN modules Text::Diff and Text::Patch, but
> haven't been too successful, as there seems to be some issue with this
> mechanism if the text data do
"Markus Wollny" writes:
> So far I have been playing around with PL/PerlU for diff/path
> functionality, using CPAN modules Text::Diff and Text::Patch, but
> haven't been too successful, as there seems to be some issue with this
> mechanism if the text data doesn't contain newlines.
Almost all di
On Monday 04 May 2009 4:29:27 am Grzegorz Buś wrote:
> When I run separately start/stop commands I still get "could not bind
> socket" message:
>
> # service postgresql stop
> Stopping postgresql service: [ OK ]
> # netstat -plunt | grep 5432
> # ps -A | grep postmas
Ok., that's it. After deleting this files everything works fine. Thanks ;)
--
Kind Regards,
Grzegorz Bus
-Original Message-
From: Adrian Klaver [mailto:akla...@comcast.net]
Sent: Monday, May 04, 2009 3:19 PM
To: pgsql-general@postgresql.org
Cc: Grzegorz Buś
Subject: Re: [GENERAL] could n
Moe wrote:
Hi,
How can I add automatic backup easily?
Is it possible with pgadmin ?
Also, I would like to know whether those options
(Blobs(checked), OIDS, Insert Commands, Disable Quoting is for) .. as
it is now, it works great without them.
Thanks in advance /
Hi!
> -Ursprüngliche Nachricht-
> Von: Martijn van Oosterhout [mailto:klep...@svana.org]
> Gesendet: Montag, 4. Mai 2009 15:30
> I've used the Algorithm::Diff module in the past with
> success. It works on sequences of objects rather than just
> text but it works well. That means you
Hi!
> -Ursprüngliche Nachricht-
> Von: Tom Lane [mailto:t...@sss.pgh.pa.us]
> Gesendet: Montag, 4. Mai 2009 15:04
> "Markus Wollny" writes:
> > So far I have been playing around with PL/PerlU for diff/path
> > functionality, using CPAN modules Text::Diff and Text::Patch, but
> > have
> These reports seem to come up a bit, with disk full issues resulting in
> the need to pg_resetxlog, dump, and re-initdb, but I wouldn't be too
> shocked if they all turned out to be on xfs or something like that.
>
My particular disk-full condition was on ext2. Nothing exotic. Also,
the proces
Hi guys, this is my first approach to postgresql..
Well, lets say that i have 3 tables: orders, customer, and order_item.
The tables are really simple:
---
CREATE TABLE customer (
id integer NOT NULL,
name character(50)
);
---
CREATE TABLE orders (
id integer NOT NULL,
id_customer
In response to DaNieL :
> Hi guys, this is my first approach to postgresql..
>
> Well, lets say that i have 3 tables: orders, customer, and order_item.
> The tables are really simple:
>
> ---
> CREATE TABLE customer (
> id integer NOT NULL,
> name character(50)
> );
> ---
> CREATE TABLE
On Mon, 4 May 2009 09:27:30 -0700 (PDT)
DaNieL wrote:
[snip]
> Every id in every table is a PRIMARY KEY, UNIQUE, NOT NULL and
> serial type..
> The query that i have problem with is:
> ---
> SELECT
> orders.code,
> customer.name,
> SUM(order_item.price)
> FROM
> orders
> INNER JOIN customer
DaNieL wrote:
Hi guys, this is my first approach to postgresql..
Well, lets say that i have 3 tables: orders, customer, and order_item.
The tables are really simple:
---
CREATE TABLE customer (
id integer NOT NULL,
name character(50)
);
---
CREATE TABLE orders (
id integer NOT NULL,
On Mon, May 04, 2009 at 09:27:30AM -0700, DaNieL wrote:
> Hi guys, this is my first approach to postgresql..
>
> Well, lets say that i have 3 tables: orders, customer, and order_item.
> The tables are really simple:
>
> ---
> CREATE TABLE customer (
> id integer NOT NULL,
> name character
On Mon, May 4, 2009 at 12:27 PM, DaNieL wrote:
> Hi guys, this is my first approach to postgresql..
>
> Well, lets say that i have 3 tables: orders, customer, and order_item.
> The tables are really simple:
>
> ---
> CREATE TABLE customer (
> id integer NOT NULL,
> name character(50)
> );
>
To get a postgresql behavior similar to mysql's you need to use distinct on:
select distinct on (a) a,b,c from sometable; (or something like that)
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-
On Mon, 2009-05-04 at 12:30 -0500, Andy Colson wrote:
> Yes, that query works in mysql, but only in mysql... and probably not in
> any other db anywhere. It is not standard sql. My guess is that mysql
> is "helping" you out by adding the customer.name for you... but maybe
> not? Maybe its ret
Jeff Davis writes:
> Section 4.18 of SQL200n, "Functional Dependencies", shows some
> interesting ways that the DBMS can make the proper inferences (I think
> this is an optional feature, so I don't think PostgreSQL violates the
> standard here).
Just for the record, this is something that was ad
I asked this on the ODBC list, but there doesn't seem to be much
traffic there, so I thought I'd try it here.
Is anyone using the ODBC driver with tables with the uuid data type? I
can't seem to get it to work. I keep getting "Received an unsupported
type from Postgres. (#14)".
Thanks,
A
On Mon, May 4, 2009 at 12:53 PM, Jasen Betts wrote:
> select exp(sum(ln( thiscolumn ))) from foo;
Keep in mind that it won't work when the table containts negative
numbers, though (or zeros, but since in this case the product is also
zero, it doesn't matter)
--
Sent via pgsql-general mailing li
On Mon, May 04, 2009 at 10:42:01AM +0200, A. Kretschmer wrote:
> No, you need a own aggregate function, but it is easy:
>
> test=# CREATE FUNCTION multiply_aggregate(float,float) RETURNS float AS
> ' select $1 * $2; ' language sql IMMUTABLE STRICT; CREATE AGGREGATE
> multiply (basetype=float, sfun
Dennis Brakhane writes:
> On Mon, May 4, 2009 at 12:53 PM, Jasen Betts wrote:
>> select exp(sum(ln( thiscolumn ))) from foo;
> Keep in mind that it won't work when the table containts negative
> numbers, though (or zeros, but since in this case the product is also
> zero, it doesn't matter)
Its
I seemed to have resolved this issue by a:
LOCK TABLE account IN EXCLUSIVE MODE;
at the very start of the transaction to prevent that transaction
from running in parallel.
The transaction has quite a few selects and inserts and a few updates.
I was hoping to not lock at the start of the tran
Bill Moseley wrote:
> I seemed to have resolved this issue by a:
>
> LOCK TABLE account IN EXCLUSIVE MODE;
>
> at the very start of the transaction to prevent that transaction
> from running in parallel.
>
> The transaction has quite a few selects and inserts and a few updates.
> I was hopin
39 matches
Mail list logo