Re: Linker errors while creating a PostgreSQL C extension function.

2018-08-21 Thread Laurenz Albe
TalGloz wrote: > Do you or anyone know why is it trying to link with -L/usr/lib64 path and > not -L/usr/local/lib as provided? > > After recompiling the libseal.a with the -fPIC flag and copying it manually > from /usr/local/lib/ to /usr/lib64/ I get those errors: > > g++ -Wl,--no-undefined -shar

SPI_cursor_fetch Memory Issue

2018-08-21 Thread Wu Ivy
Hi all, My goal is to get data from the Postgres table into a C-function to be processed. 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-cu

Re: Linker errors while creating a PostgreSQL C extension function.

2018-08-21 Thread TalGloz
Hallo Do you or anyone know why is it trying to link with -L/usr/lib64 path and not -L/usr/local/lib as provided? After recompiling the libseal.a with the -fPIC flag and copying it manually from /usr/local/lib/ to /usr/lib64/ I get those errors: g++ -Wl,--no-undefined -shared -o seal_diff_cpp.so

Re: Multiple COPY on the same table

2018-08-21 Thread Christopher Browne
On Mon, 20 Aug 2018 at 16:23, Adrian Klaver wrote: > > On 08/20/2018 08:56 AM, Nicolas Paris wrote: > >> Can I split a large file into multiple files and then run copy using > >> each file. > > > > AFAIK, copy command locks the table[1] while there is no mention of this > > in the documentation[2]

Re: COPY FROM - to avoid WAL generation

2018-08-21 Thread Ravi Krishna
>Please note this is only the case if wal_level = minimal. If replication >(or PITR) is supported, that mode can't be used, because the data has to >go into the WAL. >Were you using wal_level = minimal? Aha. No it was not minimal. For a second I thought PG is super smart. Oh well.  Thanks.  

Re: COPY FROM - to avoid WAL generation

2018-08-21 Thread Andres Freund
Hi, On 2018-08-21 15:00:03 +, Ravi Krishna wrote: > In a recent thread of mine I learned something very interesting.  If a table > is created and data is loaded via COPY FROM within the same transaction, then > PG will be smart enough to not generate WAL logs because all it needs to do > is

Re: COPY FROM - to avoid WAL generation

2018-08-21 Thread Jeff Ross
On 8/21/18 9:00 AM, Ravi Krishna wrote: In a recent thread of mine I learned something very interesting. If a table is created and data is loaded via COPY FROM within the same transaction, then PG will be smart enough to not generate WAL logs because all it needs to do is to track the status o

COPY FROM - to avoid WAL generation

2018-08-21 Thread Ravi Krishna
In a recent thread of mine I learned something very interesting.  If a table is created and data is loaded via COPY FROM within the same transaction, then PG will be smart enough to not generate WAL logs because all it needs to do is to track the status of the transaction and let the data load g

Re: How to check whether table is busy or free before running the ALTER or creating TRIGGER on that table

2018-08-21 Thread Adrian Klaver
On 08/21/2018 06:25 AM, Raghavendra Rao J S V wrote: *Hi All,* We have thousands of tables. Out of these tables we have few tables. Which are busy some times. If I execute any ALTER statement or creating trigger on those tables I am unable to do it. How to check whether table is busy or free

How to check whether table is busy or free before running the ALTER or creating TRIGGER on that table

2018-08-21 Thread Raghavendra Rao J S V
*Hi All,* We have thousands of tables. Out of these tables we have few tables. Which are busy some times. If I execute any ALTER statement or creating trigger on those tables I am unable to do it. How to check whether table is busy or free before running the *ALTER/DDL *or creating *TRIGGER *on th

Question about replication

2018-08-21 Thread Zhiquan Simon Sui
Hi all, I recently hit a problem about sync replication of postgres. When I check the state of the replication, I got this: postgres=# select * from pg_stat_replication ; pid | usesysid | usename | application_name | client_addr | client_hostname | client_port |