On Thu, Feb 18, 2010 at 2:53 PM, Richard Huxton wrote:
> On 17/02/10 15:18, Amitabh Kant wrote:
>
>>
>> CREATE OR REPLACE FUNCTION update_data() RETURNS TRIGGER AS $update_data$
>> BEGIN
>> IF NEW.t1f4> t2.t2f4
>> UPDATE t2 set t2f2=NEW.t1f2, t2f3=NEW.t1f3, t2f4=NEW.t1f4 where
>> t2f
On 17/02/10 15:18, Amitabh Kant wrote:
CREATE OR REPLACE FUNCTION update_data() RETURNS TRIGGER AS $update_data$
BEGIN
IF NEW.t1f4> t2.t2f4
UPDATE t2 set t2f2=NEW.t1f2, t2f3=NEW.t1f3, t2f4=NEW.t1f4 where
t2f1=NEW.d1;
RETURN NEW;
END IF;
END;
$update_data$ LANGUAGE pl
Hi
I have the following table structure for which I am trying to set a AFTER
INSERT or UPDATE trigger:
CREATE OR REPLACE FUNCTION update_data() RETURNS TRIGGER AS $update_data$
BEGIN
IF NEW.t1f4 > t2.t2f4
UPDATE t2 set t2f2=NEW.t1f2, t2f3=NEW.t1f3, t2f4=NEW.t1f4 where
t2f1=NEW.d1;
Hey all!
I'm having some trouble with a simple update on a table that only has
about 250,000 rows in it. The table itself looks something like:
CREATE TABLE price_details (
price_detail_id int PRIMARY KEY,
private bool
) ;
There is one table that references price_details, but isn't affected
[EMAIL PROTECTED] wrote:
Quoting Daryl Richter <[EMAIL PROTECTED]>:
[EMAIL PROTECTED] wrote:
> Quoting Daryl Richter <[EMAIL PROTECTED]>:
>> It's hard to say without knowing more precisely what you are trying to
>> model, but I think this push you in the right direction:
>>
> Okay, but referenc
Quoting Daryl Richter <[EMAIL PROTECTED]>:
[EMAIL PROTECTED] wrote:
> Quoting Daryl Richter <[EMAIL PROTECTED]>:
>> It's hard to say without knowing more precisely what you are trying to
>> model, but I think this push you in the right direction:
>>
> Okay, but references between (output/input) a
[EMAIL PROTECTED] wrote:
> Quoting Daryl Richter <[EMAIL PROTECTED]>:
>
>> It's hard to say without knowing more precisely what you are trying to
>> model, but I think this push you in the right direction:
>>
[snipped old schema]
>
> Okay, but references between (output/input) and ACTIVITY table
Quoting Daryl Richter <[EMAIL PROTECTED]>:
It's hard to say without knowing more precisely what you are trying
to model, but I think this push you in the right direction:
-- This table takes the place of both SEND and BUY
create table activity(
id serial primary key,
prod
[EMAIL PROTECTED] wrote:
Ok,
But the problem is becouse the "buy" and "send" tables referencing with other
father table, wich is different.
I shoud not create a spent table to put the "buy" and "send" values
becouse the
entire database is more complex than it. look:
create table output(
id seria
Ok,
But the problem is becouse the "buy" and "send" tables referencing with other
father table, wich is different.
I shoud not create a spent table to put the "buy" and "send" values
becouse the
entire database is more complex than it. look:
create table output(
id serial primary key,
client integ
Hi.
Is there a way to references dynamic tables? I.E:
I have a table called "buy" that create some records in "financial" table, but
there is other table called "send" that create other records in "financial".
"Financial" table have the moneys' movements and needs to be referenciable by
"buy or sen
Patrick,
> I tried recently (pgsql 7.1.2) to establish the oid of one table as
> foreign key
> in another.
> To no avail : there was no uniqueness constraint on that column
> Naturally, it seems impossible to add a uniqueness constraint to such
> a system
> column.
> As far as i know, the oid
On Tue, 11 Sep 2001 [EMAIL PROTECTED] wrote:
> hello all
> I tried recently (pgsql 7.1.2) to establish the oid of one table as foreign key
> in another.
> To no avail : there was no uniqueness constraint on that column
> Naturally, it seems impossible to add a uniqueness constraint to such a sys
hello all
I tried recently (pgsql 7.1.2) to establish the oid of one table as foreign key
in another.
To no avail : there was no uniqueness constraint on that column
Naturally, it seems impossible to add a uniqueness constraint to such a system
column.
As far as i know, the oid is by nature uniqu
Andreas Joseph Krogh writes:
> Hi, this is my first post to this list so please...
> I have problems getting this query to work, any ideas?
>
> select article.title_text_key,
> (select on_text.text_value from on_text where
> on_text.text_key = title_text_key
> AND NOT title_text_key i
Thomas Good wrote:
>
> On Wed, 8 Aug 2001, Andreas Joseph Krogh wrote:
>
> > Hi, this is my first post to this list so please...
> > I have problems getting this query to work, any ideas?
> >
> > select article.title_text_key,
> > (select on_text.text_value from on_text where
> > on_text.t
On Wed, 8 Aug 2001, Andreas Joseph Krogh wrote:
> Hi, this is my first post to this list so please...
> I have problems getting this query to work, any ideas?
>
> select article.title_text_key,
> (select on_text.text_value from on_text where
> on_text.text_key = title_text_key
> AND
Hi, this is my first post to this list so please...
I have problems getting this query to work, any ideas?
select article.title_text_key,
(select on_text.text_value from on_text where
on_text.text_key = title_text_key
AND NOT title_text_key is NULL
AND on_text.lang_id = (s
James,
> However, I came to the realization that if somebody changes their
> address, I
> don't want it to be changed on previous orders. So I think i'll
> change the
> orders table to contain the actual address information and use an
> INSERT ...
> SELECT instead. That way I can be sure I have
Jul 13, 09:41 -0400, James Orr wrote:
> Thanks for all the responses! The one from Grigoriy was particularly
> interesting, I hadn't thought of that approach.
>
> However, I came to the realization that if somebody changes their address, I
> don't want it to be changed on previous orders. So I
Thanks for all the responses! The one from Grigoriy was particularly
interesting, I hadn't thought of that approach.
However, I came to the realization that if somebody changes their address, I
don't want it to be changed on previous orders. So I think i'll change the
orders table to contain th
Jul 12, 16:25 -0400, James Orr wrote:
Much better will be change database structure - you have absolutely
identical tables, so is not good from normalization point of view.
Better use one table for address, and link it to one table for
"entity" - both person and company, and "entity" link to spec
On Thu, 12 Jul 2001, James Orr wrote:
> Hi,
>
> Is there anyway that you can reference a column in a view for
> referential integrity? The problem is with the unique thing,
> obviously I can't create a unique index on a view. Here is what I
> have:
Not right now, and actually you still wouldn
Hi,
Is there anyway that you can reference a column in
a view for referential integrity? The problem is with the unique thing,
obviously I can't create a unique index on a view. Here is what I
have:
CREATE SEQUENCE
"addresses_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1
c
On 21 Jul 2000, at 9:41, Markus Wagner wrote:
> which data type should be used to hold references to SERIALs in
external
> tables?
integer I believe.
Actually if you \d a table with a serial you'll see that it's an integer
with DEFAULT clause specified.
Hello,
which data type should be used to hold references to SERIALs in external
tables?
I tried to use SERIAL, but then a sequence is created for the
referencing table.
Markus
26 matches
Mail list logo