#850 closed patch (fixed)
Binary IO support for geography type
Reported by: | elprans | Owned by: | pramsey |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 2.0.0 |
Component: | postgis | Version: | master |
Keywords: | Cc: |
Description
Per mailing list post:
I'm currently working on adding support for postgis to py-postgresql and stumbled upon a fact that geography type does not support binary IO, i.e. send/receive functions are unimplemented. I attached rough patches to add said functions to IO geography through WKB. I'm also wondering if there is a deeper reason for the send/receive omission — implementation is trivial enough.
Attachments (2)
Change History (13)
by , 14 years ago
Attachment: | geography-binio-1.5.patch added |
---|
comment:1 by , 13 years ago
Alarm! Alarm! This patch would require dump/reload.
I'm all for fixing this (for trunk, not 1.5), but please someone from the PSC add its +1 here
comment:2 by , 13 years ago
@elprans, anyone : can you imagine a way to test binary IO ? psql doesn't let you IIRC
comment:3 by , 13 years ago
a-ha! found a way:
strk=# declare x binary cursor for select g from zmgeog; DECLARE CURSOR strk=# fetch 1 from x; ERROR: no binary output function available for type geography
comment:4 by , 13 years ago
r8859 adds regression test for canonical binary output of the GEOMETRY type. Now adding GEOGRAPHY.
comment:5 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
r8860 applies a modified version of the patch (didn't apply cleanly otherwise).
NOTE: I realized that the canonical binary input function may need to deal with typmod. I saw this done in the patch and kept it but it is NOT done for geometry.
Neither binary inputs are tested so I think there are high chances of them being broken :>
Implementation of testing for canonical binary input is welcome. Can't be done by regress/run_test for obvious reasons.
comment:6 by , 13 years ago
Mind you: this is another change requiring dump/reload, and we might better off also stubbing the selectivity estimators for geography as soon as possible as those one would require another dump/reload…
comment:7 by , 13 years ago
strk,
Is this dump/reload required if you are not using the geography type?
comment:8 by , 13 years ago
No, and not even if you are using it but not needing the binary IO feature …
comment:9 by , 13 years ago
r8861 adds testing for canonical input as well using a binary cursor based round-trip. They weren't broken !
Note that it _could_ be done with regress/run_test, using COPY TO/COPY FROM.
typmod on binary input is still untested.
comment:10 by , 13 years ago
I confirm binary input of geography lets you write mismatching typmods !!! Working on a sane regression test
comment:11 by , 13 years ago
With r8867 we have full coverage of binary IO including typmod handling.
Patch for 1.5 branch