O Neil Saunders έγραψε στις Nov 22, 2005 :
> And change AFER INSERT to BEFORE INSERT
1) it doesnt make any difference since we are updating
a different table than the trigger's one
2) Your email text comes really garbled
>
--
-Achilleus
---(end of broadcast)
On November 22, 2005 20:24, Tom Lane wrote:
> Luca Pireddu <[EMAIL PROTECTED]> writes:
> > I just tried it at home on a postgresql 8.0.3 server (debian package) and
> > it worked the way it's supposed to. Puzzling...
>
> Maybe you have more than one blast_evalue() function with different
> argumen
Luca Pireddu <[EMAIL PROTECTED]> writes:
> I just tried it at home on a postgresql 8.0.3 server (debian package) and it
> worked the way it's supposed to. Puzzling...
Maybe you have more than one blast_evalue() function with different
argument types?
regards, tom lane
-
On November 22, 2005 17:13, Stephan Szabo wrote:
> On Tue, 22 Nov 2005, Luca Pireddu wrote:
> [snip]
>
> I got the same answer (the second) for both calls from my 8.0 and 8.1
> setups, what version were you trying on?
>
I forgot to mention that. I'm using version 8.0.4, built from source.
I just
On Tue, 22 Nov 2005, Luca Pireddu wrote:
> I wrote a little function that has to work with big numbers
>
> CREATE OR REPLACE FUNCTION blast_evalue(seq_len bigint, db_size bigint,
> bit_score double precision)
> RETURNS double precision AS $$
> BEGIN
> RETURN 2^(bit_score) * db_size * seq_len;
I wrote a little function that has to work with big numbers
CREATE OR REPLACE FUNCTION blast_evalue(seq_len bigint, db_size bigint,
bit_score double precision)
RETURNS double precision AS $$
BEGIN
RETURN 2^(bit_score) * db_size * seq_len;
END;
$$
LANGUAGE 'plpgsql'
IMMUTABLE
RETURNS NULL ON N
Kyle Bateman <[EMAIL PROTECTED]> writes:
> Sorry, you're right. I have now confirmed that this only happens when
> updating via a view/rule (as you suspected). Attached is a minimalist
> sql file that demonstrates the same error message from a blank
> database. I'm using 8.1.0. I'm pretty su
Tom Lane wrote:
Kyle Bateman <[EMAIL PROTECTED]> writes:
I have a query:
insert into mtr_reg_v_wt (ropnum, inum, pnum, rquant, value, status,
ddate, fr_proj, to_proj) values (28985,1,1014,1,(select cost from
prd_part where pnum = 1014),'work','2005-Nov-15',50,75);
That used to w
<[EMAIL PROTECTED]> writes:
> So I can't help but wonder, can Postgres really guarantee a TEXT field to be
> UNIQUE... or is declaring a TEXT field UNIQUE something an uninformed, novice
> user would do?... or is it something indicative of the strength and/or
> weeknesses that separate the funct
On 11/22/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I am in the process re-implementing some pgsql table declarations into a
> MySQL database. I have this one line where I say
> ...
> fieldname TEXT UNIQUE,
> ...
> in my pgsql table because I want to ensure that no one enters the same thin
I am in the process re-implementing some pgsql table declarations into a MySQL
database. I have this one line where I say
...
fieldname TEXT UNIQUE,
...
in my pgsql table because I want to ensure that no one enters the same thing in
this field and I didn't choose VARCHAR type because I have no id
On Tuesday 22 November 2005 18:07, Achilleus Mantzios wrote:
>O Leif B. Kristensen ?? Nov 22, 2005 :
>> What am I missing?
>
>apparently some forgotten process_last_edited() function.
Yes -- an earlier attempt at the same thing ...
I finally managed to create my first trigger:
CREATE O
It's a low-tech solution but you could:
begin
update t1 set seq=-1 where id=5
update t1 set seq=5 where id=4
update t1 set seq=4 where id=-1
end
This is assuming that you don't naturally have -1 as a valid value of
that column.
chester c young wrote:
table t1:
id integer primary key,
And change AFER INSERT to BEFORE INSERT
On 11/22/05, Achilleus Mantzios <[EMAIL PROTECTED]> wrote:
> O Leif B. Kristensen έγραψε στις Nov 22, 2005 :
>
> > On Tuesday 22 November 2005 17:25, Achilleus Mantzios wrote:
> > >O Leif B. Kristensen έγραψε στις Nov 22, 2005 :
> > >> I'm trying to understa
table t1:
id integer primary key,
seq integer not null unique
the seq is for ordering the rows as the user likes. however, if the
rows are moved around, eg
begin
update t1 set seq=4 where id=5
update t1 set seq=5 where id=4
end
will bomb because the first update has two rows of seq=4
Try:
create or replace function update_last_edit() returns trigger as
$$
begin
new.last_edit=now();
return new;
end;
$$ language plpgsql;
On 11/22/05, Leif B. Kristensen <[EMAIL PROTECTED]> wrote:
> On Tuesday 22 November 2005 17:25, Achilleus Mantzios wrote:
> >O Leif B. Kristensen έγραψε στις N
O Leif B. Kristensen έγραψε στις Nov 22, 2005 :
> On Tuesday 22 November 2005 17:25, Achilleus Mantzios wrote:
> >O Leif B. Kristensen έγραψε στις Nov 22, 2005 :
> >> I'm trying to understand triggers. I have read the documentation in
> >> the manual as well as the few pages in the Douglas book ab
On Tuesday 22 November 2005 17:25, Achilleus Mantzios wrote:
>O Leif B. Kristensen έγραψε στις Nov 22, 2005 :
>> I'm trying to understand triggers. I have read the documentation in
>> the manual as well as the few pages in the Douglas book about the
>> subject, but I don't see how to implement a tr
However, if customers or suppliers can have multiple accounts, you are
going to need an intermediate table, as suggested by Neil.
Scratch that. If accounts can have multiple owners you'll need an
intermediate table.
---(end of broadcast)---
On Tue, 2005-11-22 at 16:24 +0100, Joost Kraaijeveld wrote:
> Hi,
>
> Is there a way to create a foreign key to 2 tables: e.g. a bankaccount
> table that has a column "owner", that must point to a record in either
> the customer or the supplier table?
No. What you need is an owner table that cust
I've never seen anything like that. I'm sure it's conceivable that you
could write a weird trigger for it, but you have to consider
maintainability, and what your queries are going to look like. I
haven't seen your datamodel, but it would seem that you could accomplish
what you're looking for
O Joost Kraaijeveld έγραψε στις Nov 22, 2005 :
> Hi,
>
> Is there a way to create a foreign key to 2 tables: e.g. a bankaccount
> table that has a column "owner", that must point to a record in either
> the customer or the supplier table?
While there are techniques to accomplish this,
i see a p
As far as I'm aware, not without using an intermediatary table (id,
cust_id, supplier_id) . Otherwise, how would you know which table the
foreign key was referencing?
That said, an intermediatary table isn't a very clean solution; What
problem are you trying to solve, exactly?
Kind Regards,
Neil
O Leif B. Kristensen έγραψε στις Nov 22, 2005 :
> I'm trying to understand triggers. I have read the documentation in the
> manual as well as the few pages in the Douglas book about the subject,
> but I don't see how to implement a trigger that simply updates a
> 'last_edit' date field in my 'p
Hi,
Is there a way to create a foreign key to 2 tables: e.g. a bankaccount
table that has a column "owner", that must point to a record in either
the customer or the supplier table?
TIA
--
Groeten,
Joost Kraaijeveld
Askesis B.V.
Molukkenstraat 14
6524NB Nijmegen
tel: 024-3888063 / 06-51855277
I'm trying to understand triggers. I have read the documentation in the
manual as well as the few pages in the Douglas book about the subject,
but I don't see how to implement a trigger that simply updates a
'last_edit' date field in my 'persons' table whenever I do an insert or
update into my
David Bath wrote:
> There are a couple of philosophical perspectives I've come across in
> previous
> work with cadastral data that may be useful...[snipped]
Thanks, David
In this particular application, structures such as postcode sectors,
administrative boundaries etc. are not really of much i
> I can't understand why you are doing this big cycle.. but certainly
> when constraints can't help you.. you can use triggers to enforce
> integrity..
In my system I have to have arbitrary contact info records about my users. I
mean not only fixed like names, email and phone but many many other
Richard Huxton wrote:
george young wrote:
Well, I don't have any need for it to correlate with the age of the
tuple. My use of step.ctid
How do you know there is only 1 duplicate?
Anyway, if (x,y) are the same but (z) is not then you can compare
against max(z) or min(z). Something like:
george young wrote:
Well, I don't have any need for it to correlate with the age of the
tuple. My use of step.ctid
How do you know there is only 1 duplicate?
Anyway, if (x,y) are the same but (z) is not then you can compare
against max(z) or min(z). Something like:
SELECT t1.x AS update_me_
30 matches
Mail list logo