The crystal structure of Sr4CuIr2O9 is very sensitive to the conditions of synthesis. Prolonged heating of a commensurate trigonal sample prepared at 1120°C leads to the adoption of an incommensurate structure which can be regarded as a composite of two substructures having common unit cell parameters a and b but different parameters c1 and c2. No detectable change in chemical composition accompanies the structural transition, nor do the magnetic properties of the sample change significantly. The structure of the commensurate form has been determined from neutron powder diffraction data collected at 4.5 K (space group P321, a = 9.68540(3) Å, c = 8.04726(6) Å). Ir2O9 octahedral dimers and CuO6 trigonal prisms alternate in chains parallel to z, with the Sr cations located between the chains; the Cu2+ cations are disordered within the prisms. The incommensurate form has been studied by X-ray diffraction and electron microscopy (a = 9.7020(6) Å, c1 = 4.0069(5) Å, c2 = 2.6993(4) Å). The relationship between the commensurate and incommensurate unit cells is discussed (c ~ 2c1 ~ 3c2). No commensurate Ba4A'Ir2O9 phases could be prepared, but incommensurate samples having A' = Cu, Zn showed behavior similar to that of Sr4CuIr2O9.