Re: [GENERAL] trigger question

2000-07-03 Thread Anatoly K. Lasareff
ll it. I suppose you have to use TG_OP variable in your triggers. Here is a bit from documentation: -- TG_OP Datatype text; a string of 'INSERT', 'UPDATE' or 'DELETE' telling for which operation the trigger is actually fired. - So, you can type something about if TG_OP <> 'UPDATE' then ... ops for insert only else ... ops for update only end if; ... ops for both of them -- Anatoly K. Lasareff Email: [EMAIL PROTECTED]

Re: [GENERAL] PL/pgSQL help

1999-06-03 Thread Anatoly K. Lasareff
h a select) MH> e.g. (this would be nice if it worked (networkID is the PKey)) MH> INSERT into Network (parentID, networkName) values (pid, mname); MH> netid := new.networkID; Yes. 'serial' type implements as 'int' type for field and sequence, which mane is __se

Re: [GENERAL] Trying to make functions in 'C'

1999-05-16 Thread Anatoly K. Lasareff
anyone tell where did I make a mistake? fb> I have a linux on a PC. Pehaps not 'int', but 'int4' in argument and return type? Except this I think your example is right. -- Anatoly K. Lasareff Email: [EMAIL PROTECTED] Senior programmer

Re: [GENERAL] timestamps

1999-02-24 Thread Anatoly K. Lasareff
': the_time timestamp NOT NULL CONSTRAINT df_now DEFAULT (timestamp('now'::datetime)) s> And one more question: How does one construct a foreign key relationship in s> postgres? In 6.4 there are no really 'primary ney - foreign key' constraint. If you wont have this feature you must use 'refint' from postgres contribs. -- Anatoly K. Lasareff Email: [EMAIL PROTECTED] Senior programmer

Re: [GENERAL] Conditioned access to a database

1999-02-12 Thread Anatoly K. Lasareff
where tag = 3; revoke all on a from public; grant select on v1 to user1, user2...; grant select on v2 to group gr1, ...; . . . -- Anatoly K. Lasareff Email: [EMAIL PROTECTED] Senior programmer

Re: [GENERAL] Triggers and sql functions not working...

1999-01-05 Thread Anatoly K. Lasareff
nature 'xxx() returns opaque', but not '... returns int'. Pehaps this is your mistake? -- Anatoly K. Lasareff Email: [EMAIL PROTECTED] Senior programmer

Re: [GENERAL] Typecasting datetype as date. How do I cope with NULLs?

1998-11-27 Thread Anatoly K. Lasareff
,field2,link1 from test1,test2 where test1.link1=test2.id2 union select id1, -1, link1 from test1; where -1 is value non present in field2 domain. -- Anatoly K. Lasareff Email: [EMAIL PROTECTED] Senior programmer

Re: [GENERAL] Typecasting datetype as date. How do I cope with NULLs?

1998-11-27 Thread Anatoly K. Lasareff
| i +-- Thu Nov 26 00:00:00 1998 MSK| 1 Wed Nov 25 00:00:00 1998 MSK| 2 Fri Nov 27 00:00:00 1998 MSK| 3 |10 (4 rows) -- Regards! -- Anatoly K. Lasareff Email: [EMAIL PROTECTED] Senior programmer