- Notifications
You must be signed in to change notification settings - Fork5
Commit68e190c
committed
>has anyone ever successfully done copy to/from stdout with the
>tcl-extension for postgreSQL.>I'm currently using 7.0 and always getting a seg fault when I try to>read from the database connection after issueing a "COPY table TO>stdout;" (I'm using the connection handle, *not* the result handle).>Maybe this is fixed in a later release.>The README file in src/interfaces/libpgtcl tells me, that this should>work, but unforunately it doesn't.Yes, it seems broken. It is a bug in libpgtcl. Are you running Tcl >= 8.3.2?That's when the Tcl team changed the data structure for channelcallbacks. The change itself was designed to be backward compatible, but Isuspect a related change made the code more sensitive to errors in thestructure (NULL pointers where functions are required). Either that, ornobody has tried to use libpgtcl with COPY in a long time.First, I have to say I can't think of a good reason to use PostgreSQL'sCOPY command from a Tcl application. I think it should only be used withpsql for importing data from another source into PostgreSQL, or forexporting PostgreSQL data into another database (but why would anyone dothat?) If it was me, I would stick with SELECT and INSERT and be "SQLCompliant".OK, editorial is over. Try applying the patch below to fix src/interfaces/libpgtcl/pgtclId.cand let us know if it works. I did little testing on it, but my test didsegfault before and ran fine (copy in and copy out) after the patch. Thisis for PostgreSQL-7.1.2 - since you are running older 7.0, I don't know ifthis will work, but I suspect it will.PS It's the absence of PgWatchProc which kills it. I didn't upgrade itto the "V2" channel type structure, so it should be compatible with olderTcl's. But aside from gets and puts, I doubt any other file operationswould work on the handle during a copy.ljb1 parenta926c70 commit68e190c
1 file changed
+21
-6
lines changedLines changed: 21 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
16 |
| - | |
| 16 | + | |
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
| |||
138 | 138 |
| |
139 | 139 |
| |
140 | 140 |
| |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
141 | 155 |
| |
142 | 156 |
| |
143 | 157 |
| |
144 | 158 |
| |
145 | 159 |
| |
146 | 160 |
| |
147 |
| - | |
148 |
| - | |
149 |
| - | |
150 |
| - | |
151 |
| - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
152 | 167 |
| |
153 | 168 |
| |
154 | 169 |
| |
|
0 commit comments
Comments
(0)