SPI_cursor_fetch Memory overrun

2018-08-22 Thread Wu Ivy
Hi all, I’m creating a C extension to write data from the Postgres to a text file . Since the table can be very large, I only want to process one chunk of data per time to keep the memory stable. To achieve this, I use SPI cursor(https://www.postgresql.org/docs/current/static/spi-spi-cursor-f

Re: Getting NOT NULL constraint from pg_attribute

2018-08-21 Thread Wu Ivy
Thanks for the response. Really appreciate it! Regards, Ivy 2018-08-20 10:40 GMT-07:00 David G. Johnston : > On Monday, August 20, 2018, Wu Ivy wrote: >> >> Thanks for the quick respond. >> Why are SELECT query never marked nullable? For nullable columns, when I >&g

Re: Getting NOT NULL constraint from pg_attribute

2018-08-20 Thread Wu Ivy
Aug 17, 2018, at 6:02 PM, Tom Lane wrote: > > Wu Ivy writes: >> I’m currently building a Postgres C extension that fetch data from a >> Postgres table. >> Since the table can be large, in order to prevent memory overrun, I use >> SPI_cursor_fetch to fetch chunks o

Getting NOT NULL constraint from pg_attribute

2018-08-17 Thread Wu Ivy
Hi developers, I’m currently building a Postgres C extension that fetch data from a Postgres table. Since the table can be large, in order to prevent memory overrun, I use SPI_cursor_fetch to fetch chunks of data. The result rows are saved in SPITupleTable* SPI_tuptable and attributes are saved