- Notifications
You must be signed in to change notification settings - Fork5
Commita28f117
committed
This is the second time I've answered this exact same problem in two
days. It seems to be a FAQ, and I think I know why. When creating a 'c'language function, CREATE FUNCTION is fed the shared object filename,and seems to succeed. Only when trying to use the function is an errorthrown, by which time the coder thinks something's wrong with executingthe code, not with loading it.I think I once saw it proposed to load shared objects at function creationtime, but that idea was shot down on the grounds of resident memory bloat,ISTR. Here's a patch for a compromise: all it does is stat() the file,just like the loader code does, so that the errors caused by non existentfiles, and no directory 'x' permissions (the most common ones, it seems),get caught while the developer is still thinking about code loading. Itdoesn't catch all errors (like the code not being readable by the postgresuser) but seems to catch the most common, without actually opening the file.What do you think?Ross1 parent5e02f6b commita28f117
1 file changed
+12
-2
lines changedLines changed: 12 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
13 |
| - | |
| 13 | + | |
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
| |||
35 | 35 |
| |
36 | 36 |
| |
37 | 37 |
| |
| 38 | + | |
| 39 | + | |
38 | 40 |
| |
39 | 41 |
| |
40 | 42 |
| |
| |||
180 | 182 |
| |
181 | 183 |
| |
182 | 184 |
| |
| 185 | + | |
| 186 | + | |
183 | 187 |
| |
184 | 188 |
| |
185 | 189 |
| |
186 | 190 |
| |
187 | 191 |
| |
188 | 192 |
| |
189 | 193 |
| |
190 |
| - | |
| 194 | + | |
| 195 | + | |
191 | 196 |
| |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
192 | 201 |
| |
| 202 | + | |
193 | 203 |
| |
194 | 204 |
| |
195 | 205 |
| |
|
0 commit comments
Comments
(0)