7.3.3 array_out tweak - Mailing list pgsql-general

From Thien-Thi Nguyen
Subject 7.3.3 array_out tweak
Date
Msg-id E19h6Rw-000105-00@colo.agora-net.com
Whole thread Raw
Responses Re: 7.3.3 array_out tweak
List pgsql-general
greetings,

regarding previous grousing regarding array output not being
consistently quoted, what do you think of the following patch?
it jams `nq' when the `typbyval' is not `true' on the presumption
that typbyval is a good way to distinguish numeric/non-numeric.
perhaps there is an even more direct way to discern this?

thi

___________________________________________
cd ~/local/src/postgresql-7.3.3
diff -c src/backend/utils/adt/arrayfuncs.c.ORIG src/backend/utils/adt/arrayfuncs.c
*** src/backend/utils/adt/arrayfuncs.c.ORIG    Mon Jul 28 13:16:54 2003
--- src/backend/utils/adt/arrayfuncs.c    Mon Jul 28 13:17:39 2003
***************
*** 663,669 ****
          p = (char *) att_align(p, typalign);

          /* count data plus backslashes; detect chars needing quotes */
!         nq = (values[i][0] == '\0');    /* force quotes for empty string */
          for (tmp = values[i]; *tmp; tmp++)
          {
              char        ch = *tmp;
--- 663,670 ----
          p = (char *) att_align(p, typalign);

          /* count data plus backslashes; detect chars needing quotes */
!         nq = (values[i][0] == '\0'      /* force quotes for empty string */
!               || typbyval != true);     /* or when not by-value */
          for (tmp = values[i]; *tmp; tmp++)
          {
              char        ch = *tmp;

Diff finished at Mon Jul 28 13:36:12

pgsql-general by date:

Previous
From: Paul Thomas
Date:
Subject: Re: Where's the postgresql website atm?
Next
From: Rich Cullingford
Date:
Subject: