Re: postgresql v11.1 Segmentation fault: signal 11: by running SELECT... JIT Issue?

2019-01-29 Thread pabloa98
I did not modify it. I guess I should make it bigger than 1765. is 2400 or 3200 fine? My apologies if my questions look silly. I do not know about the internal format of the database. Pablo On Mon, Jan 28, 2019 at 11:58 PM Andrew Gierth wrote: > > "pabloa98" == pabloa98 writes: > > pab

Re: postgresql v11.1 Segmentation fault: signal 11: by running SELECT... JIT Issue?

2019-01-29 Thread pabloa98
I found this article: https://manual.limesurvey.org/Instructions_for_increasing_the_maximum_number_of_columns_in_PostgreSQL_on_Linux It seems I should modify: uint8 t_hoff; and replace it with something like: uint32 t_hoff; or uint64 t_hoff; And perhaps should I modify this too? The fix is easy

Re: postgresql v11.1 Segmentation fault: signal 11: by running SELECT... JIT Issue?

2019-01-29 Thread Andrew Gierth
> "pabloa98" == pabloa98 writes: pabloa98> I did not modify it. Then how did you create a table with more than 1600 columns? If I try and create a table with 1765 columns, I get: ERROR: tables can have at most 1600 columns -- Andrew (irc:RhodiumToad)

Re: postgresql v11.1 Segmentation fault: signal 11: by running SELECT... JIT Issue?

2019-01-29 Thread Andrew Gierth
> "pabloa98" == pabloa98 writes: pabloa98> I found this article: pabloa98> https://manual.limesurvey.org/Instructions_for_increasing_the_maximum_number_of_columns_in_PostgreSQL_on_Linux Those instructions contain obvious errors. pabloa98> It seems I should modify: uint8 t_hoff; pablo

Anonymize Data

2019-01-29 Thread Sathish Kumar
Hi Team, I am trying to protect some data on few tables when exporting to other environments, is there anyway or extension which can anonymize of personal data like name, credit card numbers ,etc. after import. Thanks & Regards Sathish Kumar.V

Re: postgresql v11.1 Segmentation fault: signal 11: by running SELECT... JIT Issue?

2019-01-29 Thread pabloa98
I appreciate your advice. I will check the number of columns in that table. On Tue, Jan 29, 2019, 1:53 AM Andrew Gierth wrote: > > "pabloa98" == pabloa98 writes: > > pabloa98> I found this article: > > pabloa98> > https://manual.limesurvey.org/Instructions_for_increasing_the_maximum_nu

Table Replication

2019-01-29 Thread Sathish Kumar
Hi, We are trying to replicate few tables from one postgresql server to another server. We are currently using Postgresql 9.5.x, is there any way to achieve it without Postgresql upgrade.

Error: record with incorrect prev-link ---/--- at ---/---, when archiving is 'on'

2019-01-29 Thread Abdullah Al Maruf
Hello, I am trying to build an automated system in docker/kubernetes where a container/pod will automatically schedule itself as a Master or Standby. In short, I have 1 master nodes (0th node) and three standby nodes (1st, 2nd & 3rd node). When I make the 3rd node as master (by trigger file) and r

Help : Update and insert record based on several value in the parameter

2019-01-29 Thread Hengky Lie
Hi, I want to create a function to update my table (flag='9') and insert new record (flag='0') with the rfidnumber specified in a parameter. This parameter may have several value seperated by space (ie. 11 22 33 44) CREATE OR REPLACE FUNCTION public.fcreate_rfid ( znumber varchar ) RETURNS boo

Help : Update and insert record based on several value in the parameter

2019-01-29 Thread Hengky Lie
Hi, I want to create a function to update my table (flag='9') and insert new record (flag='0') with the rfidnumber specified in a parameter. This parameter may have several value seperated by space (ie. 11 22 33 44) CREATE OR REPLACE FUNCTION public.fcreate_rfid ( znumber varchar ) RETURNS boo

Re: Help : Update and insert record based on several value in the parameter

2019-01-29 Thread Andrew Gierth
> "Hengky" == Hengky Lie writes: Hengky> Hi, Hengky> I want to create a function to update my table (flag='9') and Hengky> insert new record (flag='0') with the rfidnumber specified in a Hengky> parameter. rfidnumber is stored as text/varchar? if it's something else, change the suggesti

Re: Help : Update and insert record based on several value in the parameter

2019-01-29 Thread Pavel Stehule
út 29. 1. 2019 v 13:50 odesílatel Hengky Lie napsal: > Hi, > > I want to create a function to update my table (flag='9') and insert new > record (flag='0') with the rfidnumber specified in a parameter. > > This parameter may have several value seperated by space (ie. 11 22 33 44) > For this kind

pg_rewind success even though getting error 'record with incorrect prev-link'

2019-01-29 Thread Abdullah Al Maruf
When I try to attach an old master with 'archiving set to on` as a new standby, `pg_rewind` doesn't throw any error, But, when the database starts, The following error appears: ``` LOG: invalid record length at 0/B98: wanted 24, got 0 LOG: started streaming WAL from primary at 0/B00 on t

Re: Anonymize Data

2019-01-29 Thread Sathish Kumar
Hi, Thanks, I have checked about this extension. Is it reliable to use. On Tue, Jan 29, 2019, 9:02 PM Tumasgiu Rossini Hi, > > you should check this thread : > > > https://www.postgresql.org/message-id/flat/CABokaaPSrK6%2BFFAdfT8gg-mNLXB9612NezaCbTNRtC7HqztkKw%40mail.gmail.com > > Le mar. 29 jan

Re: Help : Update and insert record based on several value in the parameter

2019-01-29 Thread Tony Shelver
I don't know what you are using as a front end to call this update, but I have been finding json/jsonb parameters passed into a function / procedure and then using postgres json functions to process the data as a good solution. If your data fits postgres array datatype, as others have mentioned, t

Re: Table Replication

2019-01-29 Thread Fabrízio de Royes Mello
Em ter, 29 de jan de 2019 às 10:24, Sathish Kumar escreveu: > > Hi, > > We are trying to replicate few tables from one postgresql server to another server. We are currently using Postgresql 9.5.x, is there any way to achieve it without Postgresql upgrade. Yeap... use pglogical [1] extension. Reg

Re: error when creating logical replication slot

2019-01-29 Thread Josef Machytka
Hi. Thanks for answer. Both databases run on Google Compute Engine VMs with Debian 9, both PGs are "PostgreSQL 11.1 (Debian 11.1-1.pgdg90+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit" I did several tests with setting logical replication from master to

How to set parameters in 'options'?

2019-01-29 Thread Stefan Keller
Hi, I'd like to write a function like this: create function foo(_host text, _port text, _dbname text) returns void as $$ create server _server foreign data wrapper postgres_fdw options (host _host, port _port, dbname _dbname); -- ERROR: syntax error at or near "_host" $$ language sq

Re: Anonymize Data

2019-01-29 Thread Adrian Klaver
On 1/29/19 2:08 AM, Sathish Kumar wrote: Hi Team, I am trying to protect some data on few tables when exporting to other environments, is there anyway or extension which  can  anonymize of personal data like name, credit card numbers ,etc. after import. Would you not want to anonymize befor

RE: How to set parameters in 'options'?

2019-01-29 Thread Igor Neyman
-Original Message- From: Stefan Keller [mailto:sfkel...@gmail.com] Sent: Tuesday, January 29, 2019 9:40 AM To: Postgres General Subject: How to set parameters in 'options'? Hi, I'd like to write a function like this: create function foo(_host text, _port text, _dbname text) returns voi

Re: How to set parameters in 'options'?

2019-01-29 Thread Adrian Klaver
On 1/29/19 6:40 AM, Stefan Keller wrote: Hi, I'd like to write a function like this: create function foo(_host text, _port text, _dbname text) returns void as $$ create server _server foreign data wrapper postgres_fdw options (host _host, port _port, dbname _dbname); -- ERROR:

SELECT of pseudo hex value gives unexpected result

2019-01-29 Thread Gunnar "Nick" Bluth
Hi, I found this in an SQL-injection attempt today: union select 0x5e73266725,0x5e73266725[,...],0x5e73266725; Tried SELECT 0x5e73266725; and received: -[ RECORD 1 ]-- x5e73266725 | 0 That was not what I expected... is this expected/documented behaviour? Thx in advance! -- Gunnar "Nick" Bluth

Re: SELECT of pseudo hex value gives unexpected result

2019-01-29 Thread Tom Lane
"Gunnar \"Nick\" Bluth" writes: > Tried > SELECT 0x5e73266725; > and received: > -[ RECORD 1 ]-- > x5e73266725 | 0 > That was not what I expected... is this expected/documented behaviour? Well, there are no hex literals in (PG's notion of) SQL, so that isn't a valid token. But it's the concate

Re: SELECT of pseudo hex value gives unexpected result

2019-01-29 Thread Laurenz Albe
Gunnar "Nick" Bluth wrote: > Tried > SELECT 0x5e73266725; > > and received: > -[ RECORD 1 ]-- > x5e73266725 | 0 > > That was not what I expected... is this expected/documented behaviour? Looks like you don't need a space between a number literal and the column alias. I don't see any problem wit

Re: SELECT of pseudo hex value gives unexpected result

2019-01-29 Thread Gunnar "Nick" Bluth
Am 29.01.2019 um 17:39 schrieb Tom Lane: > "Gunnar \"Nick\" Bluth" writes: >> Tried >> SELECT 0x5e73266725; [...] > SELECT 0 AS x5e73266725; > > and that's the result you got. Well, yeah, _that_ was pretty obvious. I just didn't expect ot to happen... > I think that the SQL standard considers

parallel plpgsql function

2019-01-29 Thread Jiří Fejfar
Hi all! I am trying to create basic experiment [1] analysing some data with plpgsql function in parallel. I am able to aggregate data in parallel (6 workers) with pure SQL code (line 19) but as far as I put the same query (with some parametrization) into plpgsql function and run it via RETURN QUE

Re: How to set parameters in 'options'?

2019-01-29 Thread Stefan Keller
Many thanks to Igor and Adrian for your hints. Got it to work like this: create function link_server(_server text, _host text, _port text, _dbname text) returns void as $$ begin execute format('create server %s foreign data wrapper postgres_fdw options (host %L, port %L, dbname %L)', _s

Re: Table Replication

2019-01-29 Thread Thomas Endres
> On Jan 29, 2019, at 8:22 AM, Fabrízio de Royes Mello > wrote: > > > > Em ter, 29 de jan de 2019 às 10:24, Sathish Kumar > escreveu: > > > > Hi, > > > > We are trying to replicate few tables from one postgresql server to another > > server. We are currently using

Re: type int2vector

2019-01-29 Thread Rene Romero Benavides
What's the question? On Mon, Jan 28, 2019 at 4:25 AM 吉成恒 wrote: > > select * from pg_partition where 2 =all(pg_partition.paratts); > > -- > > 吉成恒 > > 光大证券股份有限公司 信息技术总部(数据中心) > > 地址:静安区新闸路1508号7楼 > > 电话:021-22169287 > > 手机:18717772189 > > 邮箱:j...@ebscn.

Re: Table Replication

2019-01-29 Thread Rene Romero Benavides
You could also use Slony-I On Tue, Jan 29, 2019 at 12:24 PM Thomas Endres wrote: > > On Jan 29, 2019, at 8:22 AM, Fabrízio de Royes Mello < > fabri...@timbira.com.br> wrote: > > > > Em ter, 29 de jan de 2019 às 10:24, Sathish Kumar > escreveu: > > > > Hi, > > > > We are trying to replicate few

Revoke SQL doesn't take effect

2019-01-29 Thread Jason W
I have two postgresql accounts created by someone else who I do not know (So I do not know setting for those accounts and tables created). One is read only account e.g. read_only_user (This can perform select operations only). The other is admin account e.g. admin_user (This can perform grant, r

Re: Revoke SQL doesn't take effect

2019-01-29 Thread Tim Cross
On Wed, 30 Jan 2019 at 07:49, Jason W wrote: > I have two postgresql accounts created by someone else who I do not know > (So I do not know setting for those accounts and tables created). One is > read only account e.g. read_only_user (This can perform select operations > only). The other is admi

User Name Maps seem broken in 11.1 on CentOS 7

2019-01-29 Thread Viktor Berke
Hi, After some talk with the helpful folks of #postgresql I see no other option but to ask here. I'm trying to set up proper authentication for our corprorate users. They'll access postgres both from their workstations via TCP, and also locally. Locally, they're authenticated using SSSD which i

Re: User Name Maps seem broken in 11.1 on CentOS 7

2019-01-29 Thread Adrian Klaver
On 1/29/19 1:11 PM, Viktor Berke wrote: Hi, After some talk with the helpful folks of #postgresql I see no other option but to ask here. I'm trying to set up proper authentication for our corprorate users. They'll access postgres both from their workstations via TCP, and also locally. Locally

Re: How to set parameters in 'options'?

2019-01-29 Thread Adrian Klaver
On 1/29/19 10:03 AM, Stefan Keller wrote: Many thanks to Igor and Adrian for your hints. Got it to work like this: create function link_server(_server text, _host text, _port text, _dbname text) returns void as $$ begin execute format('create server %s foreign data wrapper postgres_fdw

Re: Anonymize Data

2019-01-29 Thread Bruno Lavoie
Not an extension but this post can be useful about various strategies: https://blog.taadeem.net///english/2019/01/03/8_anonymization_strategies_with_postgres Each with strengths and weaknesses Le mar. 29 janv. 2019 5:08 AM, Sathish Kumar a écrit : > Hi Team, > > I am trying to protect some dat

Re: User Name Maps seem broken in 11.1 on CentOS 7

2019-01-29 Thread Tom Lane
Adrian Klaver writes: > On 1/29/19 1:11 PM, Viktor Berke wrote: >> And here comes the problem: user name maps seem completely >> non-functional. > Is ident_file set to something else?: > https://www.postgresql.org/docs/11/runtime-config-file-locations.html#GUC-IDENT-FILE Also: have you been rel

Re: User Name Maps seem broken in 11.1 on CentOS 7

2019-01-29 Thread Nick B
Hey! I think I've figured out what was your problem. You have created a mapping to allow OS user "foobar" auth as pg role "postgres". What happens though (and error message actually indicates that) is you are trying to authenticate as pg role "foobar". This is probably due to you executing `psql

Re: Anonymize Data

2019-01-29 Thread Sathish Kumar
Hi Adrian, I am looking to do it either during export or while importing data in the secondary db. On Tue, Jan 29, 2019, 10:43 PM Adrian Klaver On 1/29/19 2:08 AM, Sathish Kumar wrote: > > Hi Team, > > > > I am trying to protect some data on few tables when exporting to other > > environments, i

Re: postgresql v11.1 Segmentation fault: signal 11: by running SELECT... JIT Issue?

2019-01-29 Thread pabloa98
I checked the table. It has 1265 columns. Sorry about the typo. Pablo On Tue, Jan 29, 2019 at 1:10 AM Andrew Gierth wrote: > > "pabloa98" == pabloa98 writes: > > pabloa98> I did not modify it. > > Then how did you create a table with more than 1600 columns? If I try > and create a table

Re: pg_rewind success even though getting error 'record with incorrect prev-link'

2019-01-29 Thread Michael Paquier
On Tue, Jan 29, 2019 at 07:13:11PM +0600, Abdullah Al Maruf wrote: > When I try to attach an old master with 'archiving set to on` as a new > standby, `pg_rewind` doesn't throw any error, But, when the database > starts, The following error appears: > > ``` > LOG: invalid record length at 0/B

Querying w/ join slow for large/many child tables

2019-01-29 Thread Wells Oliver
I have a primary parent table with a child table per week of the year for each week back through 2015. There are a lot of child tables. Each week's child table has maybe 80-110m rows. When I join to the parent table on a column, it's very slow, but when I manually specify the specific week's chil

Re: Querying w/ join slow for large/many child tables

2019-01-29 Thread Adrian Klaver
On 1/29/19 6:49 PM, Wells Oliver wrote: I have a primary parent table with a child table per week of the year for each week back through 2015. There are a lot of child tables. Each week's child table has maybe  80-110m rows. When I join to the parent table on a column, it's very slow, but when

Re: pg_rewind success even though getting error 'record with incorrect prev-link'

2019-01-29 Thread Abdullah Al Maruf
Hi Michael > This is pointing out to the end of WAL for the current timeline. You > may face it after reading a WAL segment in an area which has been used > in the past for a recycled segment. Are you talking about error ` LOG: invalid record length at 0/B98: wanted 24, got 0` ? or, `LOG:

Re: Querying w/ join slow for large/many child tables

2019-01-29 Thread Ron
On 1/29/19 8:49 PM, Wells Oliver wrote: I have a primary parent table with a child table per week of the year for each week back through 2015. There are a lot of child tables. Each week's child table has maybe 80-110m rows. A *partititioned* table? When I join to the parent table on a colum

Re: pg_rewind success even though getting error 'record with incorrect prev-link'

2019-01-29 Thread Ron
On 1/29/19 9:57 PM, Abdullah Al Maruf wrote: Hi Michael > This is pointing out to the end of WAL for the current timeline.  You > may face it after reading a WAL segment in an area which has been used > in the past for a recycled segment. Are you talking about error `LOG:  invalid record length