- Notifications
You must be signed in to change notification settings - Fork28
Commit98ad3fc
committed
Hi All,
I've changed the check_primary_key() function code to allow for eitherthe "automatic insert key rule" or "dependent insert key rule".Previously it restricted the addtion of a child entry if thecorresponding parent entry was not there. Now if the option is"automatic" it will add an entry in the parent too ( it will besuccessful if there are no no-null fields in the parent apart from theprimary key).The way to use it now is::/* * check_primary_key () -- check that key in tuple beinginserted/updated * references existing tuple in "primary" table. * Though it's called without args You have to specify referenced * table/keys while creating trigger: key field names in triggeredtable, * referenced table name, referenced key field names,type of action[automatic|dependent]: * EXECUTE PROCEDURE * check_primary_key ('Fkey1', 'Fkey2', 'Ptable', 'Pkey1', 'Pkey2','[automatic|dependent]'). */I am attaching the new ../contrib/spi/refint.c file which will do this.I will be glad to help in case of any problems.- Anand.1 parentdb42533 commit98ad3fc
1 file changed
+65
-7
lines changedLines changed: 65 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
30 | 30 |
| |
31 | 31 |
| |
32 | 32 |
| |
33 |
| - | |
| 33 | + | |
34 | 34 |
| |
35 |
| - | |
| 35 | + | |
36 | 36 |
| |
37 | 37 |
| |
38 | 38 |
| |
| |||
41 | 41 |
| |
42 | 42 |
| |
43 | 43 |
| |
44 |
| - | |
| 44 | + | |
45 | 45 |
| |
46 | 46 |
| |
| 47 | + | |
47 | 48 |
| |
48 | 49 |
| |
49 | 50 |
| |
| |||
84 | 85 |
| |
85 | 86 |
| |
86 | 87 |
| |
87 |
| - | |
88 |
| - | |
| 88 | + | |
| 89 | + | |
89 | 90 |
| |
90 |
| - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
91 | 96 |
| |
92 | 97 |
| |
93 | 98 |
| |
| |||
198 | 203 |
| |
199 | 204 |
| |
200 | 205 |
| |
201 |
| - | |
| 206 | + | |
202 | 207 |
| |
203 | 208 |
| |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
204 | 262 |
| |
205 | 263 |
| |
206 | 264 |
| |
|
0 commit comments
Comments
(0)