Re: [SQL] optimal sql

2003-01-22 Thread Michael Paesold
alue between 1000 and 1. See recent descussions on -performance and -hackers mailing lists. Best Regards, Michael Paesold ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] CHECKS vs. BEFORE INSERT OR UPDATE TRIGGER

2002-12-16 Thread Michael Paesold
... Regards, Michael Paesold ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] Getting current transaction id

2002-09-25 Thread Michael Paesold
Tom Lane wrote: > Michael Paesold <[EMAIL PROTECTED]> writes: [snip] > > If it's not working I will have to implement my own transactions table. > > That's what I'd recommend. Transaction IDs are internal to the database > and are not designed for u

[SQL] Getting current transaction id

2002-09-23 Thread Michael Paesold
transactions table. Thanks in advance, Michael Paesold -- Werden Sie mit uns zum "OnlineStar 2002"! Jetzt GMX wählen - und tolle Preise absahnen! http://www.onlinestar.de ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ?

Re: [SQL] Table Copy.

2002-09-19 Thread Michael Paesold
dc; You should change the where clause if you have a primary key on that table. I am presuming fileda/filedb/filedc are unique in combination... Read the section of the docs about RULEs for INSERT and UPDATE examples. Regards, Michael Paesold ---(end of broadcast)

[SQL] Assignments in PL/pgSQL

2002-09-13 Thread Michael Paesold
or warning, and the store procedure works very well! e.g. NEW.someval = rec.someother; works as well as NEW.someval := rec.someother; Can you confirm that both are valid? Can someone explain this? And is it safe to use the former syntax? Best Regards, Michael Paesold

Re: [SQL] Rules and Triggers: another question

2002-09-12 Thread Michael Paesold
Jerome Chochon wrote: > Thanks for your answer but i have another question. > Which one is the faster ? > > If i write this trigger... > CREATE TRIGGER trigger_name > BEFORE DELETE > ON table_name > FOR EACH ROW EXECUTE PROCEDURE function(); > > and this rule: > CREATE RULE name_rule AS > ON DE

Re: [SQL] reset sequence

2002-09-12 Thread Michael Paesold
set the current value to 1, which will result in a nextval of 2, which is perhaps not what Ricardo wanted. > Maybe setval(,,) doesn't exist in > 7.0.3. \df setval in psql should output all possible parameter combinations for setval. Regards, Michael Paesold

Re: [SQL] Rules and Triggers

2002-09-10 Thread Michael Paesold
Adam Erickson wrote: > Correct me if I'm wrong, but rules constrain the SQL (ie. validation). > Triggers are carried out after the SQL is executed and the data is modified. > So, to answer your question, I think rules come first. As to which order > the rules / triggers are executed probably de

[SQL] Rules and Triggers

2002-09-10 Thread Michael Paesold
Hi all, can you tell me in what order rules and triggers are executed? First, what comes first, the rules, or the triggers? And then, in what order are all the rules / triggers executed? Regards, Michael Paesold ---(end of broadcast)--- TIP 6

Re: [SQL] weird situation, BUG or I'm not doing it right

2002-08-25 Thread Michael Paesold
h char fields are padded with > blanks. Not a bug, but an feature of the SQL standard. > > Ross Then, why is 'PR' blank padded to char(?) and upper('pr') not? It seems that when comparing char with text, the comparision is done as text, not as bpchar. billing=# select

[SQL] [NOVICE] SET CONSTRAINTS question...

2002-07-22 Thread Michael Paesold
n_friend_fkey FOREIGN KEY(name) REFERENCES friend(name) ON UPDATE CASCADE ON DELETE RESTRICT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT conn_pkey PRIMARY KEY(id) ); CREATE INDEX conn_name_idx ON conn (name); INSERT INTO friend VALUES ('Michael Paesold', 'AT')