Daniel Caune wrote:
Hi,
Is there any way to define a SQL stored function that inserts a row in a
table and returns the serial generated?
CREATE TABLE matchmaking_session
(
session_id bigint NOT NULL DEFAULT
nextval('seq_matchmaking_session_id'),
...
);
CREATE FUNCTION
On Jan 11, 2008 4:23 AM, Daniel Caune [EMAIL PROTECTED] wrote:
Hi,
Is there any way to define a SQL stored function that inserts a row in a
table and returns the serial generated?
Maybe you just need INSERT ... RETURNING?
http://www.postgresql.org/docs/8.2/interactive/sql-insert.html
On Jan 11, 2008 4:23 AM, Daniel Caune [EMAIL PROTECTED] wrote:
Please ignore my post. I havent' read your message carefully enough.
---(end of broadcast)---
TIP 7: You can help support the PostgreSQL project by donating at
What about
$$
INSERT INTO ;
select currval('seq_matchmaking_session_id');
$$ language sql;
?
Indeed... :-( For some reason, I thought that it was not possible to
have to SQL statement in an SQL stored function.
By the way, is there any performance difference between pure SQL and
On Jan 11, 2008, at 2:24 AM, Richard Huxton wrote:
Tom Lane wrote:
Alvaro Herrera [EMAIL PROTECTED] writes:
My thinking is that a TRUNCATE trigger is a per-statement trigger
which
doesn't have access to the set of deleted rows (Replicator uses
it that
way -- we replicate the truncate
Added to TODO:
* Add ability to trigger on TRUNCATE
http://archives.postgresql.org/pgsql-sql/2008-01/msg00050.php
---
Simon Riggs wrote:
On Fri, 2008-01-11 at 08:24 +, Richard Huxton wrote:
I've always
On Fri, 2008-01-11 at 08:24 +, Richard Huxton wrote:
I've always considered TRUNCATE to be DDL rather than DML. I mentally
group it with DROP TABLE rather than DELETE
DDL/DML probably isn't the right split, since its then arguable as to
which group of commands it belongs in.
I see we
Hello
By the way, is there any performance difference between pure SQL and
PL/pgSQL stored functions? If I remember correctly there was such a
distinction between pure SQL statement and PL/PLSQL stored procedures
(Oracle), in the sense that PL/PLSQL stored procedures are executed
within the
Hi,
I have the following table which holds the result of 1 on 1 matches:
FName1, LName1, Score1, FName2, LName2, Score2, Date
John, Doe,85 Bill, Gates, 20 Jan 1.
John, Archer, 90 John, Doe,120 Jan 5
Bob,Barker, 70 Calvin, Klien 8 Jan 8
John,
Kevin Jenkins wrote:
Hi,
I have the following table which holds the result of 1 on 1 matches:
FName1, LName1, Score1, FName2, LName2, Score2, Date
John, Doe,85 Bill, Gates, 20 Jan 1.
John, Archer, 90 John, Doe,120 Jan 5
Bob,Barker, 70 Calvin, Klien
Thanks! How would I find the highest score in the union of the two tables?
I tried this but it can't find unionTable:
SELECT * FROM
(select fnam1 as fname,lname1 as lname, score1 as score
from myscorestable
union
select fnam2 as fname,lname2 as lname, score2 as score
from myscorestable) as
On Jan 12, 2008 1:26 AM, Tom Lane [EMAIL PROTECTED] wrote:
Rajesh Kumar Mallah [EMAIL PROTECTED] writes:
looks like constraint exclusion is being too aggressive in excluding null
values
Hmm, you're right. Looks like I broke it here:
12 matches
Mail list logo