Unknown type name bool

2019-07-11 Thread Igal Sapir
I am trying to build Postgres in an IDE (CLion on Ubuntu), and I'm getting
the following error message:

In file included from /workspace/src/postgres/src/include/c.h:61:0,
 from /workspace/src/postgres/src/include/postgres.h:46,
 from /workspace/src/postgres/contrib/bloom/blcost.c:13:
/workspace/src/postgres/src/include/common/string.h:13:8: error: unknown
type name ‘bool’
 extern bool pg_str_endswith(const char *str, const char *end);

CLion created a CMakeLists.txt file with the following at the top:

cmake_minimum_required(VERSION 3.14)
project(postgres)
set(CMAKE_CXX_STANDARD 14)

And my compiler version is: gcc version 7.4.0 (Ubuntu
7.4.0-1ubuntu1~18.04.1)

Any thoughts?  (disclaimer: I have much more experience with Java than C)

Thanks,

Igal


Re: Unknown type name bool

2019-07-11 Thread Igal Sapir
On Thu, Jul 11, 2019 at 10:27 PM Michael Paquier 
wrote:

> On Thu, Jul 11, 2019 at 10:21:06PM -0700, Igal Sapir wrote:
> > Any thoughts?  (disclaimer: I have much more experience with Java than C)
>
> We don't support cmake directly.  Here is the documentation about how
> to build the beast:
> https://www.postgresql.org/docs/current/install-procedure.html


Thank you, Michael, but my goal is not to just build from source, but to
run Postgres in an IDE.  I tried CLion because it's modern and cross
platform, but I am open to other IDEs.

What IDEs do Postgres hackers use (other than vi with gcc)?  Is there any
documentation or posts on how to set up the project in an IDE?

Thanks,

Igal


Re: Unknown type name bool

2019-07-11 Thread Igal Sapir
On Thu, Jul 11, 2019 at 11:14 PM Michael Paquier 
wrote:

> On Thu, Jul 11, 2019 at 10:54:53PM -0700, Igal Sapir wrote:
> > Thank you, Michael, but my goal is not to just build from source, but to
> > run Postgres in an IDE.  I tried CLion because it's modern and cross
> > platform, but I am open to other IDEs.
> >
> > What IDEs do Postgres hackers use (other than vi with gcc)?
>
> A set of N people would likely result in more than (N+1) different
> approaches when it comes to that.  The environment is old school here
> as I just have a set of terminals coupled with emacs as editor and
> gcc/clang, but you have a large set of editors at your disposal (nano,
> vi, etc.).
>

I'd actually be happy with (N+1) different approaches.  It will allow me,
and others like, to choose the one that works for us best.


> > Is there any documentation or posts on how to set up the project in an
> IDE?
>
> It depends on what you are actually trying to do and how you want to
> ease your development experience.  I have little experience with CLion
> or such kind of tools, some with Eclipse, but I find that kind of
> cumbersome as well when it comes to C.
>

At the moment I am trying to run psql in a debugger with breakpoints.  I
have spent many hours troubleshooting a `\copy` from a large CSV that kept
failing, until I realized that there was a null character in the middle of
a quoted string.  I'd be happy to submit a patch that at least warns of
such issues when they happen.

Thanks,

Igal