;
END;
$$ language plpgsql;
create trigger b_del before delete on b for each row execute procedure f();
insert into a values(5);
insert into b values(5);
delete from a where i=5;
select * from a; -- 0 rows
select * from b; -- 1 row containing '5'
--
---> Dirk Jagdmann
> http://cubic.
know if the current order of deletions in PostgreSQL
is intended in the top-down way or if that could be changed?
--
---> Dirk Jagdmann
> http://cubic.org/~doj
-> http://llg.cubic.org
---(end of broadcast)---
TIP 4: Have you searched our list archives?
http://archives.postgresql.org
ma I'd recommend using a
view to calculate the R_RETAILPRICE column:
CREATE TABLE PART
(
P_PARTKEY int4 NOT NULL,
CONSTRAINT PART_PRIMARY PRIMARY KEY (P_PARTKEY)
);
create view PARTV as
select P_PARTKEY, 9 + P_PARTKEY::numeric / 10 + P_PARTKEY::numeric / 100 as
from PART;
--
---> Dirk Ja
read:
create view PARTV as
select P_PARTKEY, 9 + P_PARTKEY::numeric / 10 + P_PARTKEY::numeric
/ 100 as P_RETAILPRICE
from PART;
--
---> Dirk Jagdmann
> http://cubic.org/~doj
-> http://llg.cubic.org
---(end of broadcast)---
TIP 4:
of 30 Entries in this table anyway. So
even the most unoptimized select and delete combinations should be
very fast...
--
---> Dirk Jagdmann
> http://cubic.org/~doj
-> http://llg.cubic.org
---(end of broadcast)---
TIP 3: Have y
cle
should look similar to PostgreSQL use the char(1). If you have lots of
application code the int is probably better, since you can just use
the created programming language variable (presumably an integer as
well) in your programming language expressions (if, while).
--
---> Dirk Jagd
.5' ~ e'\\d+\\.\\d+';
?column?
--
t
--
---> Dirk Jagdmann
> http://cubic.org/~doj
-> http://llg.cubic.org
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
some plpgsql code.
--
---> Dirk Jagdmann
> http://cubic.org/~doj
-> http://llg.cubic.org
---(end of broadcast)---
TIP 6: explain analyze is your friend
Hello Aaron,
thank you for your suggestion. I will have to think if something
similar would be of any benefit for my data.
--
---> Dirk Jagdmann
> http://cubic.org/~doj
-> http://llg.cubic.org
---(end of broadcast)---
TIP 1: i
Hello George,
And don't forget that \COPY and especially COPY are usually much faster
(and, IMHO, easier to compose/maintain) than gobs of INSERTs.
I did not forget, but my application uses embedded SQL (with the epcg
preprocessor) and I don't think it can handle COPYs :(
--
ith the
standard foreign key triggers/functions so you would have to write
your own plpgsql triggers if this is a mandatory requirement.
--
---> Dirk Jagdmann
> http://cubic.org/~doj
-> http://llg.cubic.org
---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster
create the hashsums.
--
---> Dirk Jagdmann
> http://cubic.org/~doj
-> http://llg.cubic.org
---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column
stable strict;
comment on FUNCTION md5(id oid) is 'Calculates the md5 sum of a large object.';
I vote for this function beeing included either somewhere in the
contrib directories, as you often don't need the full power of
pgcrypto is md5 suffices for your hashing needs.
--
---
y application and if I'm satisfied
with this solution I'll post something on pgsql-hackers of pgfoundry.
--
---> Dirk Jagdmann
> http://cubic.org/~doj
-> http://llg.cubic.org
---(end of broadcast)---
TIP 7: You can help sup
avoid using explicit for/loop constructs in your
stored procedures if the action can be solved by a single SQL
statement, because the optimizer can make a better execution plan.
--
---> Dirk Jagdmann
> http://cubic.org/~doj
-> http://llg.cubic.org
---(e
_unique_username
before update
on sites
for each row
execute procedure sites_check_unique_username();
--
---> Dirk Jagdmann
> http://cubic.org/~doj
-> http://llg.cubic.org
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
her way.
> Thank you for your taking the time to write this up, it's very much
> appreciated.
Most people reading this list like to think about/learn from other
people's problems.
--
---> Dirk Jagdmann
> http://cubic.org/~doj
-> http://llg.cubic.org
--
S
rbaz', E'(.)(?!$)', E'\\1 ', 'g');
regexp_replace
---
f o o b a r b a z
(1 row)
--
---> Dirk Jagdmann
> http://cubic.org/~doj
-> http://llg.cubic.org
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
uld work, I'm interested in a working example code :-)
--
---> Dirk Jagdmann
> http://cubic.org/~doj
-> http://llg.cubic.org
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
uld work, I'm interested in a working example code :-)
--
---> Dirk Jagdmann
> http://cubic.org/~doj
-> http://llg.cubic.org
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
nteger,
code_value integer,
code_type text not null references code_type
);
--
---> Dirk Jagdmann
> http://cubic.org/~doj
-> http://llg.cubic.org
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
21 matches
Mail list logo