[GENERAL] DROP INDEX hangs

2017-11-08 Thread Arnaud L.
Hi all Using PostgreSQL 9.3.4, compiled by Visual C++ build 1600, 32-bit (on Windows, obviously). I noticed that my vacuumdb was hanging on a specific index, so I decided that the easiest path was to create a duplicate of it (CREATE INDEX CONCURRENTLY myindex_v2 ...), and drop the original one

[GENERAL] filter records by substring match of an postgresql array column

2017-11-08 Thread Arup Rakshit
Hi, I do have a videos table, and it has a column called `tags` of type array. I would like to select all videos where any string inside tag column matches a given substring. What method should I use? The *Contains `@>` operator* will do full string comparisons as far as I understood. -- Sent

Re: [GENERAL] filter records by substring match of an postgresql array column

2017-11-08 Thread Jeff Janes
On Nov 8, 2017 02:34, "Arup Rakshit" wrote: Hi, I do have a videos table, and it has a column called `tags` of type array. I would like to select all videos where any string inside tag column matches a given substring. What method should I use? The *Contains `@>` operator* will do full string co

Re: [GENERAL] filter records by substring match of an postgresql array column

2017-11-08 Thread Arup Rakshit
I enabled the extension `pg_trgm`. I thought to query like: SELECT "videos".* FROM "videos" WHERE ( array_to_string(tags, ', ') ilike '%web shorts%' ) AND EXISTS ( SELECT FROM unnest(tags) AS u(val) WHERE u.val ILIKE '%web shorts%'

Re: [GENERAL] filter records by substring match of an postgresql array column

2017-11-08 Thread Jeff Janes
On Wed, Nov 8, 2017 at 4:28 AM, Arup Rakshit wrote: > > And to do I wanted to add an index like: > > CREATE INDEX trgm_idx_video_tags ON videos USING gist > ((array_to_string(tags, ', ')) gist_trgm_ops) > > But on running this I get an error as: > > ERROR: functions in index expression must be m

[GENERAL] Because PostgreSQL is compiling in old versions of OS?

2017-11-08 Thread DrakoRod
Hi everyone! I want to develop a installer for many purposes, but i have a question, when I review the currently PostgreSQL versions, I see Ubuntu 5 or RHEL 4 , when currently we have Ubuntu 16 or RHEL 7. for example: /PostgreSQL 9.6.0 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313

Re: [GENERAL] Because PostgreSQL is compiling in old versions of OS?

2017-11-08 Thread José María Terry Jiménez
El 8/11/17 a las 20:28, DrakoRod escribió: > Hi everyone! > > I want to develop a installer for many purposes, but i have a question, when > I review the currently PostgreSQL versions, I see Ubuntu 5 or RHEL 4 , when > currently we have Ubuntu 16 or RHEL 7. for example: > > /PostgreSQL 9.6.0 on x

[GENERAL] wal configuration setting for fast streaming replication with logical decoding

2017-11-08 Thread Weiping Qu
Hi, I intend to increase the speed of streaming replication with logical decoding using following configuration: wal_level = logical fsync = on synchronous_commit = off wal_sync_method = fdatasync wal_buffers = 256MB wal_writer_delay = 2seconds checkpoint_timeout = 15min max_wal_size=10GB Th

Re: [GENERAL] Because PostgreSQL is compiling in old versions of OS?

2017-11-08 Thread John R Pierce
On 11/8/2017 11:28 AM, DrakoRod wrote: Which the best OS version to complining with the goal to build binaries "standard" o "more compatible"? thats very difficult because library versions change between major distro releases.   Stuff compiled for RHEL6/CentOS6 will run on RHEL7/CentOS7 if

[GENERAL] database size changed after restoring using pg_restore

2017-11-08 Thread Dylan Luong
/backup/dump/mydb-20171108.dmp -U postgres -W mydb This is the command I used to restore the database on the 9.6server. pg_restore -j 16 -C -d postgres /pg_backup/backup/dump/mydb-20171108.dmp Everything appears ok, the dump and restore completed without and errors. But when I listed the size of the

Re: [GENERAL] database size changed after restoring using pg_restore

2017-11-08 Thread Andreas Joseph Krogh
he command I used to dump the database. I ran the command from the 9.6 server. pg_dump -h 9.2server -j 16 --format=directory -f /pg_backup/backup/dump/mydb-20171108.dmp -U postgres -W mydb   This is the command I used to restore the database on the 9.6server. pg_restore -j 16 -C -d postgre

Re: [GENERAL] database size changed after restoring using pg_restore

2017-11-08 Thread John R Pierce
On 11/8/2017 2:59 PM, Dylan Luong wrote: Hi I am upgrading some databases from a PostgreSQL 9.2 server to a new PostgreSQL 9.6 server. I used pg_dump and pg_restore for the upgrade. . But when I listed the size of the database (postgres=# \l+) between the 9.2 and the upgraded 9.6, the

[GENERAL] Migrating money column from MS SQL Server to Postgres

2017-11-08 Thread Igal @ Lucee.org
Hello, I am migrating a database from MS SQL Server to Postgres. I have a column named "discount" of type money in SQL Server.  I created the table in Postgres with the same name and type, since Postgres has a type named money, and am transferring the data by using PDI (Pentaho Data Integrati

Re: [GENERAL] Migrating money column from MS SQL Server to Postgres

2017-11-08 Thread Tom Lane
"Igal @ Lucee.org" writes: > I have a column named "discount" of type money in SQL Server.  I created > the table in Postgres with the same name and type, since Postgres has a > type named money, and am transferring the data by using PDI (Pentaho > Data Integration) Kettle/Spoon. > Kettle thro

Re: [GENERAL] Migrating money column from MS SQL Server to Postgres

2017-11-08 Thread David G. Johnston
On Wednesday, November 8, 2017, Igal @ Lucee.org wrote: > > Kettle throws an error though: column "discount" is of type money but > expression is of type double precision. > > The value in the offending insert is: 0.0 > > Why does Postgres decide that 0.0 is "double precision" (which is a weird

Re: [GENERAL] Migrating money column from MS SQL Server to Postgres

2017-11-08 Thread Allan Kamau
On Nov 9, 2017 03:46, "Tom Lane" wrote: "Igal @ Lucee.org" writes: > I have a column named "discount" of type money in SQL Server. I created > the table in Postgres with the same name and type, since Postgres has a > type named money, and am transferring the data by using PDI (Pentaho > Data In

Re: [GENERAL] Migrating money column from MS SQL Server to Postgres

2017-11-08 Thread Igal @ Lucee.org
Thank you all for your help: On 11/8/2017 4:45 PM, Tom Lane wrote: "Igal @ Lucee.org" writes: The value in the offending insert is:  0.0 Why does Postgres decide that 0.0 is "double precision" (which is a weird name in my opinion -- why can't it just be double) and not money? Kettle must be

Re: [GENERAL] Migrating money column from MS SQL Server to Postgres

2017-11-08 Thread Allan Kamau
On Nov 9, 2017 04:12, "Igal @ Lucee.org" wrote: Thank you all for your help: On 11/8/2017 4:45 PM, Tom Lane wrote: "Igal @ Lucee.org" writes: The value in the offending insert is: 0.0 Why does Postgres decide that 0.0 is "double precision" (which is a weird name in my opinion -- why can't

Re: [GENERAL] Migrating money column from MS SQL Server to Postgres

2017-11-08 Thread Igal @ Lucee.org
On 11/8/2017 5:27 PM, Allan Kamau wrote: Maybe using NUMERIC without explicitly stating the precision is recommended. This would allow for values with many decimal places to be accepted without truncation. Your field may need to capture very small values such as those in bitcoin trading or some

Re: [GENERAL] Migrating money column from MS SQL Server to Postgres

2017-11-08 Thread Igal @ Lucee.org
On 11/8/2017 6:25 PM, Igal @ Lucee.org wrote: On 11/8/2017 5:27 PM, Allan Kamau wrote: Maybe using NUMERIC without explicitly stating the precision is recommended. This would allow for values with many decimal places to be accepted without truncation. Your field may need to capture very small

[GENERAL] PostgreSQL 9.5 showing unexpected behavior when installed with different locale other than default

2017-11-08 Thread Mayank Agrawal
Hi, On Windows 7, I am trying to install PostgreSQL 9.5 ( *postgresql-9.5.2-1-windows-x64.exe*) with different locales, but it is getting installed with default locale only, which is, `*English_United States.1252*`. I tried both the methods, GUI and unattended/silent, but the results are same. I