Re: Load data from a csv file without using COPY

2018-06-19 Thread Nicolas Paris
hi AFAIK you can use copy from a jdbc command since copy allows to stream data (from stdin version) However while faster than INSERT INTO, this might lock the target table during the process 2018-06-19 22:16 GMT+02:00 Ravi Krishna : > In order to test a real life scenario (and use it for

Re: Using COPY to import large xml file

2018-06-25 Thread Nicolas Paris
2018-06-25 16:25 GMT+02:00 Anto Aravinth : > Thanks a lot. But I do got lot of challenges! Looks like SO data contains > lot of tabs within itself.. So tabs delimiter didn't work for me. I thought > I can give a special demiliter but looks like Postrgesql copy allow only > one character as

Re: Using COPY to import large xml file

2018-06-25 Thread Nicolas Paris
2018-06-25 17:30 GMT+02:00 Anto Aravinth : > > > On Mon, Jun 25, 2018 at 8:54 PM, Anto Aravinth < > anto.aravinth@gmail.com> wrote: > >> >> >> On Mon, Jun 25, 2018 at 8:20 PM, Nicolas Paris >> wrote: >> >>> >>> 2018-06-2

Re: Foreign Data Wrapper

2017-12-21 Thread Nicolas Paris
Le 21 déc. 2017 à 13:24, Virendra Shaktawat - Quipment India écrivait : > Quipment Logo > > Hello , > > > > I have stuck at foreign data wrapper. I am accessing the form MS Sql Server. > Foreign table has been created with data. unfortunately I am unable to perform > DML operation like

psql format result as markdown tables

2018-01-13 Thread Nicolas Paris
Hello I wonder if someone knows how to configure psql to output results as markdown tables. Then instead of : SELECT * FROM (values(1,2),(3,4)) as t; column1 | column2 -+- 1 | 2 3 | 4 Get the result as : SELECT * FROM (values(1,2),(3,4)) as t; |

Re: New Copy Formats - avro/orc/parquet

2018-02-11 Thread Nicolas Paris
> > That is true, but the question is how significant the overhead is. If > > it's 50% then reducing it would make perfect sense. If it's 1% then no > > one if going to be bothered by it. > > I think it's pretty clear that it's going to be way way much more than > 1%. Good news but not sure to

Re: New Copy Formats - avro/orc/parquet

2018-02-11 Thread Nicolas Paris
Le 11 févr. 2018 à 21:03, Andres Freund écrivait : > > > On February 11, 2018 12:00:12 PM PST, Nicolas Paris <nipari...@gmail.com> > wrote: > >> > That is true, but the question is how significant the overhead is. > >If > >> > it's 50% then

Re: New Copy Formats - avro/orc/parquet

2018-02-11 Thread Nicolas Paris
Le 11 févr. 2018 à 21:53, Andres Freund écrivait : > On 2018-02-11 21:41:26 +0100, Nicolas Paris wrote: > > I have also the storage and network transfers overhead in mind: > > All those new formats are compressed; this is not true for current > > postgres BINARY format and

Re: New Copy Formats - avro/orc/parquet

2018-02-11 Thread Nicolas Paris
Le 11 févr. 2018 à 22:19, Adrian Klaver écrivait : > On 02/11/2018 12:57 PM, Nicolas Paris wrote: > > Le 11 févr. 2018 à 21:53, Andres Freund écrivait : > > > On 2018-02-11 21:41:26 +0100, Nicolas Paris wrote: > > > > I have also the storage and network transfers

New Copy Formats - avro/orc/parquet

2018-02-10 Thread Nicolas Paris
Hello I d'found useful to be able to import/export from postgres to those modern data formats: - avro (c writer=https://avro.apache.org/docs/1.8.2/api/c/index.html) - parquet (c++ writer=https://github.com/apache/parquet-cpp) - orc (all writers=https://github.com/apache/orc) Something like :

Re: New Copy Formats - avro/orc/parquet

2018-02-10 Thread Nicolas Paris
> > I d'found useful to be able to import/export from postgres to those modern > > data > > formats: > > - avro (c writer=https://avro.apache.org/docs/1.8.2/api/c/index.html) > > - parquet (c++ writer=https://github.com/apache/parquet-cpp) > > - orc (all writers=https://github.com/apache/orc) > >

Re: Multiple COPY on the same table

2018-08-20 Thread Nicolas Paris
> 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]. > Will the performance boost by close to 4x?? You might be interested in the pbBulkInsert tool[3] that allows

COPY error when \. char

2018-03-20 Thread Nicolas Paris
Hello I get an error when loading this kind of csv: > test.csv: "hello ""world"" " "\." "this works " "this \. does not" > table: create table test (field text); > sql: \copy test (field) from 'test.csv' CSV quote '"' ESCAPE '"'; ERROR: unterminated CSV quoted field CONTEXTE : COPY test,

Re: Full-text Search - Thesaurus relationships

2018-10-31 Thread Nicolas Paris
On Wed, Oct 31, 2018 at 10:49:04AM +0100, Laurenz Albe wrote: > Nicolas Paris wrote: > > > > The documentation[1] says thesaurus can include informations of terms > > > > relationships such broader terms, preferred terms ... > > > > I haven't been able to fin

Full-text Search - Thesaurus relationships

2018-10-30 Thread Nicolas Paris
Hi, The documentation[1] says thesaurus can include informations of terms relationships such broader terms, preferred terms ... I haven't been able to find out how to exploit those relationship in postgres. Is there any keyword to and associated syntax to make use of them ? Thanks, [1]:

Re: Full-text Search - Thesaurus relationships

2018-10-31 Thread Nicolas Paris
On Wed, Oct 31, 2018 at 07:56:28AM +0100, Laurenz Albe wrote: > > The documentation[1] says thesaurus can include informations of terms > > relationships such broader terms, preferred terms ... > > I haven't been able to find out how to exploit those relationship in > > postgres. Is there any

Re: Default Privilege Table ANY ROLE

2018-11-15 Thread Nicolas Paris
On Wed, Nov 14, 2018 at 03:19:00PM +0100, Nicolas Paris wrote: > Hi > > I d'like my user be able to select on any new table from other users. > > > ALTER DEFAULT PRIVILEGES FOR ROLE "theowner1" IN SCHEMA "myschema" GRANT > > select ON TAB

Default Privilege Table ANY ROLE

2018-11-14 Thread Nicolas Paris
Hi I d'like my user be able to select on any new table from other users. > ALTER DEFAULT PRIVILEGES FOR ROLE "theowner1" IN SCHEMA "myschema" GRANT > select ON TABLES TO "myuser" > ALTER DEFAULT PRIVILEGES FOR ROLE "theowner2" IN SCHEMA "myschema" GRANT > select ON TABLES TO "myuser" >

Re: Default Privilege Table ANY ROLE

2018-11-14 Thread Nicolas Paris
On Wed, Nov 14, 2018 at 09:04:44PM +0100, Laurenz Albe wrote: > Nicolas Paris wrote: > > I d'like my user be able to select on any new table from other users. > > > > > ALTER DEFAULT PRIVILEGES FOR ROLE "theowner1" IN SCHEMA "myschema" > >

Re: Default Privilege Table ANY ROLE

2018-11-14 Thread Nicolas Paris
On Wed, Nov 14, 2018 at 03:53:39PM -0500, Tom Lane wrote: > Maybe I'm missing something, but doesn't this solve your problem > as stated? > > ALTER DEFAULT PRIVILEGES IN SCHEMA myschema GRANT SELECT ON TABLES TO public; Not sure that's equivalent to what I am looking for below (but is not

Re: Default Privilege Table ANY ROLE

2018-11-21 Thread Nicolas Paris
On Fri, Nov 16, 2018 at 03:17:59PM -0500, Tom Lane wrote: > Stephen Frost writes: > > There was much discussion of being able to have 'FOR ALL ROLES' or > > similar for ALTER DEFAULT PRIVILEGES when it went in, but there was a > > lot of concern about one user getting to define the default

announce: spark-postgres 3 released

2019-11-10 Thread Nicolas Paris
Hello postgres users, Spark-postgres is designed for reliable and performant ETL in big-data workload and offers read/write/scd capability to better bridge spark and postgres. The version 3 introduces a datasource API. It outperforms sqoop by factor 8 and the apache spark core jdbc by infinity.

Re: How to import Apache parquet files?

2019-11-10 Thread Nicolas Paris
> I would like to import (lots of) Apache parquet files to a PostgreSQL 11 you might be intersted in spark-postgres library. Basically the library allows you to bulk load parquet files in one spark command: > spark > .read.format("parquet") > .load(parquetFilesPath) // read the parquet files >

Re: ERROR: COPY escape must be a single one-byte character (multi-delimiter appears to work on Postgres 9.0 but does not on Postgres 9.2)

2019-11-16 Thread Nicolas Paris
> I am unable to edit this Talend job, as it's very old and we do not have the > source code for the job anymore. I am unable to see what the actual delimiter Compiled talend jobs produce jars file with java .class files in which the SQL statements are in plain text. You should be at least able