Skip to content

Commit af01564

Browse files
author
James William Pye
committed
Zero-length dimensions are not accepted by Postgres.
1 parent 69090c3 commit af01564

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

postgresql/protocol/typio.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,7 @@ def pack_an_array(data):
512512
pack_array_elements(data.elements)
513513
))
514514
else:
515+
# signals string formatting
515516
pack_an_array = None
516517

517518
if hasbin_output:
@@ -532,6 +533,7 @@ def unpack_an_array(data):
532533
dimensions = dim
533534
)
534535
else:
536+
# signals string formatting
535537
unpack_an_array = None
536538

537539
return (pack_an_array, unpack_an_array)

postgresql/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,12 +566,12 @@ def detect_dimensions(hier):
566566
yield x
567567
break
568568
l = len(hier)
569-
yield l
570569
if l > 0:
571570
# boundary consistency checks come later.
572571
hier = hier[0]
573572
else:
574573
break
574+
yield l
575575

576576
@classmethod
577577
def from_nest(typ, nest, offset = None):

0 commit comments

Comments
 (0)