Re: [GENERAL] PLPGSQL returning number of rows

2016-11-10 Thread David G. Johnston
On Thu, Nov 10, 2016 at 5:44 PM, Patrick B wrote: > Hi guys, > > I'm writing a simple Plpgsql function to delete some data from different > tables. > > The function starts with a select, and then 2 deletes after that. > > How can I return the number of rows that each

[GENERAL] PLPGSQL returning number of rows

2016-11-10 Thread Patrick B
Hi guys, I'm writing a simple Plpgsql function to delete some data from different tables. The function starts with a select, and then 2 deletes after that. How can I return the number of rows that each delete performed? CREATE or REPLACE FUNCTION delete_ids_clientid(account_id integer)

Re: [GENERAL] Gin indexes on intarray is fast when value in array does not exists, and slow, when value exists

2016-11-10 Thread Tom Lane
Jeff Janes writes: > On Thu, Nov 10, 2016 at 7:11 AM, Tom Lane wrote: >> If you are using that contrib module, and it's capturing this operator >> reference, that would probably explain the bad estimate. You could >> drop the extension if you're not

Re: [GENERAL] Gin indexes on intarray is fast when value in array does not exists, and slow, when value exists

2016-11-10 Thread Jeff Janes
On Thu, Nov 10, 2016 at 7:11 AM, Tom Lane wrote: > otar shavadze writes: > >> Hmmm ... actually, I wonder if maybe '@>' here is the contrib/intarray > >> operator not the core operator? The intarray operator didn't get > plugged > >> into any real

Re: [GENERAL] How to hint 2 coulms IS NOT DISTINCT FROM each other

2016-11-10 Thread Kim Rose Carlsen
> Hang on -- upthread the context was inner join, and the gripe was join > fast with '=', slow with INDF. When he said the nulls were > 'generated', I didn't follow that they were part of the original > query. If the nulls are generated along with the query, sure, an > index won't help. > > I

Re: [GENERAL] Gin indexes on intarray is fast when value in array does not exists, and slow, when value exists

2016-11-10 Thread Tom Lane
otar shavadze writes: >> Hmmm ... actually, I wonder if maybe '@>' here is the contrib/intarray >> operator not the core operator? The intarray operator didn't get plugged >> into any real estimation logic until 9.6. > So, you mean that better would be go to version 9.6 ?

Re: [GENERAL] Row level security performance joining large tables

2016-11-10 Thread Stephen Frost
David, * David R. Pike (david.p...@trustedconcepts.com) wrote: > From what I can understand the RLS implementation strives to execute policy > checks before user provided predicate checks so as to avoid leaking protected > data. Is there any way to make the join look "safe" to the optimizer to

Re: [GENERAL] Postgresql 94 from PostgreSQL RPM Repository (with Yum)

2016-11-10 Thread Adrian Klaver
On 11/10/2016 04:56 AM, Steve Clark wrote: > Hi > > I installed the following package: > postgresql94-server-9.4.9-1PGDG.rhel6.x86_64 > postgresql94-plperl-9.4.9-1PGDG.rhel6.x86_64 > postgresql94-plpython-9.4.9-1PGDG.rhel6.x86_64 > postgresql94-contrib-9.4.9-1PGDG.rhel6.x86_64 >

Re: [GENERAL] Postgresql 94 from PostgreSQL RPM Repository (with Yum)

2016-11-10 Thread Devrim Gündüz
Hi Steve, On Thu, 2016-11-10 at 07:56 -0500, Steve Clark wrote: >  > I installed the following package: > postgresql94-server-9.4.9-1PGDG.rhel6.x86_64 > postgresql94-plperl-9.4.9-1PGDG.rhel6.x86_64 > postgresql94-plpython-9.4.9-1PGDG.rhel6.x86_64 > postgresql94-contrib-9.4.9-1PGDG.rhel6.x86_64 >

Re: [GENERAL] Syncing Data of data type BLOB into Postgres- Bytea

2016-11-10 Thread Adrian Klaver
On 11/09/2016 11:35 PM, Cynthia Hombakazi Ngejane wrote: Hello, I have two databases SQLlite and Postgres, SQLite is my local database in it I am saving fingerprint templates that get capture onsite (i.e offline) and my column is of type BLOB. Now I want to sync these templates into Postgres

Re: [GENERAL] Import data from MS SQL Server 2014 to Postgresql 9.6 using dbi-link and fdw (error: utf-8/uft-16)

2016-11-10 Thread rob stone
On Thu, 2016-11-10 at 05:34 -0500, Juliano wrote: > Hi, >   > I'm trying to import some data from a MS SQL Server 2014 sequential > database to Postgresql using dbi-link. >   > Postgresql 9.6 encoding is utf-8 and does not support utf-16 but, I > need to transfer this data to postgres. >   > I

Re: [GENERAL] Import data from MS SQL Server 2014 to Postgresql 9.6 using dbi-link and fdw (error: utf-8/uft-16)

2016-11-10 Thread Tim Clarke
I'd recommend Talend, they have an open source edition that we use. Very powerful and reliable. Tim Clarke On 10/11/16 12:49, JingYuan Chen wrote: > > I think that ETL utilities will be the right choice. Try Pentaho's > Data Integration tool. It is Java base. > > > On Nov 10, 2016 6:45 PM,

[GENERAL] Postgresql 94 from PostgreSQL RPM Repository (with Yum)

2016-11-10 Thread Steve Clark
Hi I installed the following package: postgresql94-server-9.4.9-1PGDG.rhel6.x86_64 postgresql94-plperl-9.4.9-1PGDG.rhel6.x86_64 postgresql94-plpython-9.4.9-1PGDG.rhel6.x86_64 postgresql94-contrib-9.4.9-1PGDG.rhel6.x86_64 postgresql94-devel-9.4.9-1PGDG.rhel6.x86_64

Re: [GENERAL] Import data from MS SQL Server 2014 to Postgresql 9.6 using dbi-link and fdw (error: utf-8/uft-16)

2016-11-10 Thread JingYuan Chen
I think that ETL utilities will be the right choice. Try Pentaho's Data Integration tool. It is Java base. On Nov 10, 2016 6:45 PM, "Raymond O'Donnell" wrote: > On 10/11/16 10:34, Juliano wrote: > >> Hi, >> >> >> >> I'm trying to import some data from a MS SQL Server 2014

Re: [GENERAL] Gin indexes on intarray is fast when value in array does not exists, and slow, when value exists

2016-11-10 Thread otar shavadze
@Jeff > most_common_elems. Is it empty, or is it not empty? If not empty, does > it contain the specific values you used in your queries? No, most_common_elems is not empty. it contain the specific values I used in queries. @Tom > > Hmmm ... actually, I wonder if maybe '@>' here is the

Re: [GENERAL] Import data from MS SQL Server 2014 to Postgresql 9.6 using dbi-link and fdw (error: utf-8/uft-16)

2016-11-10 Thread Raymond O'Donnell
On 10/11/16 10:34, Juliano wrote: Hi, I'm trying to import some data from a MS SQL Server 2014 sequential database to Postgresql using dbi-link. Have you tried the foreign data wrapper for MS SQL Server? It's here:

[GENERAL] Import data from MS SQL Server 2014 to Postgresql 9.6 using dbi-link and fdw (error: utf-8/uft-16)

2016-11-10 Thread Juliano
Hi, I'm trying to import some data from a MS SQL Server 2014 sequential database to Postgresql using dbi-link. Postgresql 9.6 encoding is utf-8 and does not support utf-16 but, I need to transfer this data to postgres. I also tried to use tds_fdw version 1.0.8 and the same problem

Re: [GENERAL] initdb createuser commands

2016-11-10 Thread Samuel Williams
> Really? So naming them pg_initdb and pg_createdb would help to clarify their > use? Yes. > Perhaps you missed: https://www.postgresql.org/docs/9.6/static/app-pg-ctl.html I meant a man page that details the ENTIRE Postgres command line tools. > Command line aliases and other stuff I've been

Re: [GENERAL] Linux equivalent library for "postgres.lib" from Windows

2016-11-10 Thread David Guyot
If you are looking for the name of the package providing the postgres library, it will probably change over the distros; under Debian, you're probably looking for libpq5 for the library itself, but I don't know the name of the package containing debugging symbols for this one. Depending on your