Re: [GENERAL] Sample in documentation - Mailing list pgsql-general

From Tom Lane
Subject Re: [GENERAL] Sample in documentation
Date
Msg-id 1687.1494176953@sss.pgh.pa.us
Whole thread Raw
In response to Re: [GENERAL] Sample in documentation  (Igor Korot <ikorot01@gmail.com>)
Responses Re: [GENERAL] Sample in documentation  (Igor Korot <ikorot01@gmail.com>)
List pgsql-general
Igor Korot <ikorot01@gmail.com> writes:
> On Sat, May 6, 2017 at 8:22 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I do not see any arrays named "length", nor even any arrays of size 2,
>> on that page, so I'm pretty confused what you're talking about.  Please
>> be more specific.

> I based my code on this:
> http://stackoverflow.com/questions/26911855/correct-way-to-bind-numeric-values-to-prepared-sql.
> Sorry about that.

Ah.  Well, we can't be responsible for random bits of code posted on
stackoverflow.

> Nevertheless, while it did compile by MSVC and gcc, it looks like
> Xcode fails with compiling that code.

Seems to me clang is being overly picky, but whatever.

> So, is there any solution to this which can be used cross-platform?

Don't use an initializer, assign the values one at a time.

Back in the day we used to avoid use of initializers for local variables
because they weren't too portable.  It's depressing to see clang
introducing new reasons for them not to be portable.

            regards, tom lane


pgsql-general by date:

Previous
From: Adam Brusselback
Date:
Subject: Re: [GENERAL] Caching and Blobs in PG? Was: Can PG replace redis,amqp, s3 in the future?
Next
From: Igor Korot
Date:
Subject: Re: [GENERAL] Sample in documentation