Allow Reg Expressions in Position function

2018-08-19 Thread Nick Dro
Position function allows only string as pattern parameter:   select position(sub-string in string)   If you are looking for more than one sub-string you can't do it with a single call to position. More info:  https://stackoverflow.com/questions/51925037/how-to-find-position-of-multiple-sub-string-i

Re: Audit management

2018-08-19 Thread Achilleas Mantzios
On 10/08/2018 21:20, dangal wrote: Achilleas thanks for your answer A query, the only possible way out is the postgres log? I would like to be able to throw the audit output to a different place so that I can not access the file Yes, only the postgresql log, and you gotta take care of ^M (CR), C

Re: pg_stat_statements in the query column I am not getting the exact query

2018-08-19 Thread legrand legrand
Hi, This is the expected behavior, like that sql statements with différent values are shared in pg_stat_statements ... There is no parameter to change this, if you really want query paramèters you néed to have a look at statements logging, but be carrefull this can generate a huge volume of log fil

Re: [External] Re: ERROR: cache lookup failed for function 125940

2018-08-19 Thread Vijaykumar Jain
Hey Tom, Had a small query here. If we have streaming replication enabled, and if we have corruption like this due to power loss etc, is it safe to assume we failover to standby and we should be good (atleast in most cases) I wanted to understand if the system catalog is corrupted, for some re

Re: ERROR: cache lookup failed for function 125940

2018-08-19 Thread DrakoRod
>This suggests you've actually lost some entries from pg_proc. Have >you had any system crashes or suchlike? yes two crashes for power outages, this guys doesn't have dumps recent, only to 2 days ago, I try recover the much data as possible. >No, pg_upgrade can't magically restore data that's n

Re: ERROR: cache lookup failed for function 125940

2018-08-19 Thread Tom Lane
DrakoRod writes: > I reindex the pg_proc table and reindex finished correctly but I try read > the tables or make the dump and same error, reindexed the database and show > me this error: > ERROR: cache lookup failed for function 125999 This suggests you've actually lost some entries from pg_p

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

2018-08-19 Thread Tom Lane
TalGloz writes: > Thanks, that did the trick. But now I'm getting this > /usr/bin/ld: /usr/lib64/libseal.a(bigpoly.cpp.o): relocation R_X86_64_32 > against `.rodata.str1.1' can not be used when making a shared object; > recompile with -fPIC Ugh, I was wondering if that was really going to work or

pg_stat_statements in the query column I am not getting the exact query

2018-08-19 Thread nikhil raj
Hello I am using postgres 10.3 version current facing an issue related query tracking whenever I run SELECT * FROM pg_stat_statements in the query column I am not getting the exact query with values with variable but instead I am getting $1, $2 in the query example- "update ss set number=$1 where

Re: ERROR: cache lookup failed for function 125940

2018-08-19 Thread DrakoRod
Hi Tom I reindex the pg_proc table and reindex finished correctly but I try read the tables or make the dump and same error, reindexed the database and show me this error: ERROR: cache lookup failed for function 125999 Any suggestions, If I run pg_upgrade to 10, will these errors be corrected?

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

2018-08-19 Thread TalGloz
Thanks, that did the trick. But now I'm getting this g++ -Wl,--no-undefined -shared -o seal_diff_cpp.so seal_diff_cpp.o -L/usr/pgsql-10/lib -L/usr/lib64 -Wl,--as-needed -Wl,-rpath,'/usr/pgsql-10/lib',--enable-new-dtags -L/usr/local/lib -lseal -pthread /usr/bin/ld: /usr/lib64/libseal.a(bigpoly.cpp

Re: Postgresql

2018-08-19 Thread Chris Travers
On Sun, Aug 19, 2018 at 7:57 PM Sonam Sharma wrote: > Thank you! Can you please help me with any advantages/disadvantages.. my > db size is less than 10gb. I am very new to this. > At 10GB you are unlikely to hit performance limitations that make you think about how to use PostgreSQL more effect

Re: ERROR: cache lookup failed for function 125940

2018-08-19 Thread Tom Lane
DrakoRod writes: > I've a big problem with a database, is a PostgreSQL 9.6 version on Ubuntu. > When a tried read some tables (approximately 7 of 1073) show this error: > *ERROR: cache lookup failed for function 125940* > So, I was reading this like data corruption specially the postgresql's >

Re: Postgresql

2018-08-19 Thread Christophe Pettus
> On Aug 19, 2018, at 10:56, Sonam Sharma wrote: > > Thank you! Can you please help me with any advantages/disadvantages.. my db > size is less than 10gb. I am very new to this. That's a topic far too broad for a simple mailing list thread. PostgreSQL is extremely feature-complete, but how

Re: Postgresql

2018-08-19 Thread Adrian Klaver
On 08/19/2018 10:56 AM, Sonam Sharma wrote: Thank you! Can you please help me with any advantages/disadvantages.. my db size is less than 10gb. I am very new to this. I would start here: https://www.postgresql.org/about/ On Sun, Aug 19, 2018, 11:25 PM Adrian Klaver

Re: Postgresql

2018-08-19 Thread Sonam Sharma
Thank you! Can you please help me with any advantages/disadvantages.. my db size is less than 10gb. I am very new to this. On Sun, Aug 19, 2018, 11:25 PM Adrian Klaver wrote: > On 08/19/2018 10:53 AM, Sonam Sharma wrote: > > > > > > > > > > I am planning to migrate my db from db2 to postgresql.

Re: Postgresql

2018-08-19 Thread Adrian Klaver
On 08/19/2018 10:53 AM, Sonam Sharma wrote: I am planning to migrate my db from db2 to postgresql. Before that I wanted to know is postgresql better than db2? Is it completely free ? Any performance issues or any limitations? Yes, yes, depends -- Adrian Klaver adrian.kla...@aklaver.com

Postgresql

2018-08-19 Thread Sonam Sharma
I am planning to migrate my db from db2 to postgresql. Before that I wanted to know is postgresql better than db2? Is it completely free ? Any performance issues or any limitations?

ERROR: cache lookup failed for function 125940

2018-08-19 Thread DrakoRod
Hi folks! I've a big problem with a database, is a PostgreSQL 9.6 version on Ubuntu. When a tried read some tables (approximately 7 of 1073) show this error: *ERROR: cache lookup failed for function 125940* So, I was reading this like data corruption specially the postgresql's system catalog .

Re: How to create a log file in pg_log directory for each execution of my function.

2018-08-19 Thread Raghavendra Rao J S V
Thanks a lot. On Sun 19 Aug, 2018, 11:09 PM Adrian Klaver, wrote: > On 08/19/2018 10:22 AM, Raghavendra Rao J S V wrote: > > Hi All, > > > > I have a log file as " > > */opt/postgres/9.2/data/pg_log/postgresql-2018-08-19.csv*". Due to > > "*log_rotation_age=1d*", one log file will be created fo

Re: How to create a log file in pg_log directory for each execution of my function.

2018-08-19 Thread Adrian Klaver
On 08/19/2018 10:22 AM, Raghavendra Rao J S V wrote: Hi All, I have a log file as " */opt/postgres/9.2/data/pg_log/postgresql-2018-08-19.csv*".  Due to "*log_rotation_age=1d*", one log file will be created for me in this pg_log directory on everyday. While I am debugging a particular user d

How to create a log file in pg_log directory for each execution of my function.

2018-08-19 Thread Raghavendra Rao J S V
Hi All, I have a log file as " */opt/postgres/9.2/data/pg_log/postgresql-2018-08-19.csv*". Due to " *log_rotation_age=1d*", one log file will be created for me in this pg_log directory on everyday. While I am debugging a particular user defined function which contains the lot of raise notice m

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

2018-08-19 Thread Daniel Verite
TalGloz wrote: > If yes then the -lseal is added with the $(LDFLAGS) at the end of the > command. But it doesn't happen because LDFLAGS is overriden by the makefile included just after you set it. The relevant part copy-pasted from your mail: LDFLAGS = -L$(INCLUDE_SEAL_LIB) -llibseal.

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

2018-08-19 Thread Dmitry Igrishin
вс, 19 авг. 2018 г. в 17:54, Tom Lane : > > Dmitry Igrishin writes: > > вс, 19 авг. 2018 г. в 16:20, TalGloz : > >> I'll try it later when I'm home. Is there a reason that you are linking > >> like > >> this > >> $(CXX) -Wl,--no-undefined -shared -o seal_diff_cpp.so $(LDFLAGS) $(LDLIBS) > >> seal

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

2018-08-19 Thread TalGloz
I'm using Fedora 28 OS and I'll check it with PGXS. The funny thing is that everything works when I comment every code line connected to the SEAL library. The cppcodec library is also an external library installed to /usr/local/include/cppcodec like the SEAL library. Regards, Tal -- Sent from:

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

2018-08-19 Thread Tom Lane
Dmitry Igrishin writes: > вс, 19 авг. 2018 г. в 16:20, TalGloz : >> I'll try it later when I'm home. Is there a reason that you are linking like >> this >> $(CXX) -Wl,--no-undefined -shared -o seal_diff_cpp.so $(LDFLAGS) $(LDLIBS) >> seal_diff_cpp.o >> And not like this? >> $(CXX) -Wl,--no-undefin

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

2018-08-19 Thread Dmitry Igrishin
вс, 19 авг. 2018 г. в 16:20, TalGloz : > > I'll try it later when I'm home. Is there a reason that you are linking like > this > > $(CXX) -Wl,--no-undefined -shared -o seal_diff_cpp.so $(LDFLAGS) $(LDLIBS) > seal_diff_cpp.o > > And not like this? > > $(CXX) -Wl,--no-undefined -shared -o seal_diff_c

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

2018-08-19 Thread TalGloz
I'll try it later when I'm home. Is there a reason that you are linking like this $(CXX) -Wl,--no-undefined -shared -o seal_diff_cpp.so $(LDFLAGS) $(LDLIBS) seal_diff_cpp.o And not like this? $(CXX) -Wl,--no-undefined -shared -o seal_diff_cpp.so seal_diff_cpp.o $(LDFLAGS) $(LDLIBS) -- Sent f

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

2018-08-19 Thread Dmitry Igrishin
вс, 19 авг. 2018 г. в 15:59, TalGloz : > > No, they still don't appear there and same errors are shown. Try to refactor your Makefile like this: LDFLAGS=-L$(INCLUDE_SEAL_LIB) LDLIBS=-lseal -lpthread seal_diff_cpp.so: seal_diff_cpp.o $(CXX) -Wl,--no-undefined -shared -o seal_diff_cpp.so $(L

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

2018-08-19 Thread TalGloz
No, they still don't appear there and same errors are shown. -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html

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

2018-08-19 Thread Dmitry Igrishin
вс, 19 авг. 2018 г. в 15:46, TalGloz : > > OK, I've changed my line to > LDFLAGS = -L$(INCLUDE_SEAL_LIB) -lseal -lpthread And? Is these flags appeared in the g++ invoking command line? I mean the following: g++ -Wl,--no-undefined -shared -o seal_diff_cpp.so seal_diff_cpp.o -L/usr/pgsql-10/lib -L

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

2018-08-19 Thread TalGloz
OK, I've changed my line to LDFLAGS = -L$(INCLUDE_SEAL_LIB) -lseal -lpthread In my Makefile this command is written like this (line numbers are just for orientation) 1: seal_diff_cpp.so: seal_diff_cpp.o 2:$(CXX) -Wl,--no-undefined -shared -o seal_diff_cpp.so seal_diff_cpp.o $(LDFLAGS) 3:

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

2018-08-19 Thread Dmitry Igrishin
вс, 19 авг. 2018 г. в 15:07, TalGloz : > > Do you mean this command: > > seal_diff_cpp.so: seal_diff_cpp.o > $(CXX) -Wl,--no-undefined -shared -o seal_diff_cpp.so > seal_diff_cpp.o $(LDFLAGS) > > If yes then the -lseal is added with the $(LDFLAGS) at the end of the > command. You've defined

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

2018-08-19 Thread TalGloz
Do you mean this command: seal_diff_cpp.so: seal_diff_cpp.o $(CXX) -Wl,--no-undefined -shared -o seal_diff_cpp.so seal_diff_cpp.o $(LDFLAGS) If yes then the -lseal is added with the $(LDFLAGS) at the end of the command. -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general

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

2018-08-19 Thread Dmitry Igrishin
вс, 19 авг. 2018 г. в 13:56, TalGloz : > > Hello, > > *I have this code for my C extension function. > * > > xtern "C" { // C Headers must be inside exter "C" { } block. > #include > #include > #include > #include > #include > #include > #include > #include > > PG_MODULE_MAGIC; > } > > // C

Linker errors while creating a PostgreSQL C extension function.

2018-08-19 Thread TalGloz
Hello, *I have this code for my C extension function. * xtern "C" { // C Headers must be inside exter "C" { } block. #include #include #include #include #include #include #include #include PG_MODULE_MAGIC; } // CPP Header must be outside extern "C" { } block. #include #include #includ

AW: AW: CTE with JOIN of two tables is much faster than a regular query

2018-08-19 Thread kpi6288
> -Ursprüngliche Nachricht- > Von: Tim Cross > Gesendet: Sonntag, 19. August 2018 04:57 > > > > We're using object mapping / entity frameworks (e.g. XPO, Entity > Framework Core). These frameworks support regular queries out-of-the > box; a CTEs require additional effort and are more diffi

AW: CTE with JOIN of two tables is much faster than a regular query

2018-08-19 Thread kpi6288
> -Ursprüngliche Nachricht- > Von: Tom Lane > Gesendet: Samstag, 18. August 2018 17:29 > > In any case, given that the ILIKE selects so few rows (and the planner knows > it!), finding a way to index that is clearly the right answer. A trigram index took 9 minutes to build but improved th