c == [EMAIL PROTECTED] writes:
c> I set up a stored procedure to do this for Slony-I... Replace
c> @NAMESPACE@ with your favorite namespace, and slon_quote_brute can
c> likely be treated as an identity function unless you use silly
c> namespace names :-).
Thanks.
--
Brandon
--
"Ferindo Middleton Jr" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Is there some reason why the SERIAL data type doesn't automatically have a
> UNIQUE CONSTRAINT. It seems that the main reason for using it is so that
> the value for this field keeps changing automatically and
I've learned that one can't use temporary tables within the function
unless
EXECUTE'd the SELECTS from that temp table.
So, I have a function like this:
CREATE FUNCTION Foo1(int4, int4) RETURNS SETOF myType
AS
'
DECLARE
aDataId ALIAS FOR $1;
aBid ALIAS FOR $2;
return myTyp
"Mario Splivalo" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I've learned that one can't use temporary tables within the function
> unless
> EXECUTE'd the SELECTS from that temp table.
>
> So, I have a function like this:
>
> CREATE FUNCTION Foo1(int4, int4) RETURNS SETOF myType
I have a function declared as such:
CREATE OR REPLACE FUNCTION thread_sync() RETURNS trigger AS $$
BEGIN
IF TG_OP = 'DELETE' AND OLD.deleted = FALSE THEN
UPDATE member SET total_threads=total_threads-1 WHERE id=OLD.member_id;
RETURN OLD;
ELSEIF TG_OP = 'INSERT' THEN
UPDATE member S
Ian Meyer <[EMAIL PROTECTED]> writes:
> IF TG_OP = 'DELETE' AND OLD.deleted = FALSE THEN
> ERROR: record "old" is not assigned yet
> DETAIL: The tuple structure of a not-yet-assigned record is indeterminate.
> CONTEXT: PL/pgSQL function "thread_sync" line 2 at if
> What am I failing to under
Dear pgsql-admin members:
Having 2 tables:
CREATE TABLE T2 (
idserial PRIMARY KEY,
T2_name text
);
CREATE TABLE T1 (
idserial PRIMARY KEY,
T1_name text,
fk_t2 int4REFERENCES t2
);
And some rows:
INSERT INTO T2 (T2_name) VALUES('T2-N1');
INSERT INTO T2 (T2_name) V
Ferindo Middleton Jr wrote:
Is there a way to change the position attribute of a column in a table?
I have data that I need to import into various tables in my db on a
consistent basis... I usually us e the COPY ... FROM query but I can't
control the -order- of the fields my client dumps the da
On 9/28/05, Tom Lane <[EMAIL PROTECTED]> wrote:
> Ian Meyer <[EMAIL PROTECTED]> writes:
> > IF TG_OP = 'DELETE' AND OLD.deleted = FALSE THEN
>
> > ERROR: record "old" is not assigned yet
> > DETAIL: The tuple structure of a not-yet-assigned record is indeterminate.
> > CONTEXT: PL/pgSQL functi
On Sep 29, 2005, at 4:38 , Daryl Richter wrote:
Ferindo Middleton Jr wrote:
Is there a way to change the position attribute of a column in a
table? I have data that I need to import into various tables in my
db on a consistent basis... I usually us e the COPY ... FROM query
but I can't c
---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster
please take me out from this group.
---(end of broadcast)---
TIP 4: Have you searched our list archives?
http://archives.postgresql.org
On Thursday 29 Sep 2005 11:47 am, [EMAIL PROTECTED] wrote:
> please take me out from this group.
ask the guy who put you in the group to do it
--
regards
kg
http://www.livejournal.com/users/lawgon
tally ho! http://avsap.org.in
ಇಂಡ್ಲಿನಕ್ಸ வாழ்க!
---(end of broadcast)-
On Wed, 2005-09-28 at 10:01 -0700, codeWarrior wrote:
> >
> > ---(end of
broadcast)---
> > TIP 5: don't forget to increase your free space map settings
> >
>
> FOR rec IN EXECUTE ''SELECT COUNT(col1) AS num FROM tmpTbl WHERE col2
= " ||
> aBid || ''
> Is there a way to assing variable a value returned from query that
> accesses the temporary table in a way you explained above?
>
> For instance, I can do:
>
> myValue := col2 FROM tmpTbl WHERE someValue = somethingElse...
If I'm parsing this correctly, all you need do is:
SELECT col2 INTO my
15 matches
Mail list logo