Re: [GENERAL] Insertion of large xml files into PostgreSQL 10beta1

2017-06-28 Thread Alain Toussaint
Hello Jan, Hello David, I'll be able to do further testing next week as I am in the middle of a move but for next week, I'll be in vacation from work for the whole month. Best regards, Alain 2017-06-29 0:13 GMT-04:00 David G. Johnston : > On Sun, Jun 25, 2017 at 8:02 PM, Alain Toussaint > wrot

Re: [GENERAL] Insertion of large xml files into PostgreSQL 10beta1

2017-06-28 Thread David G. Johnston
On Sun, Jun 25, 2017 at 8:02 PM, Alain Toussaint wrote: > > echo "INSERT INTO samples (xmldata) VALUES $(cat > /srv/pgsql/pubmed/medline17n0001.xml)" | /usr/bin/psql medline > 1>/dev/null 2>error.log > Typically I do: --psql file \set xmlcontent `cat 'projectblogs-categories.xml'` INSERT INTO t

Re: [GENERAL] Insertion of large xml files into PostgreSQL 10beta1

2017-06-28 Thread Jan de Visser
On Sunday, June 25, 2017 11:02:41 PM EDT Alain Toussaint wrote: > > Narrowing down the entire file to a small problem region and posting a > > self-contained example, > > The url here contain the set of xml records from a publication I > worked on many years ago: > > https://www.ncbi.nlm.nih.gov/

Re: [GENERAL] Is the row version available in SQL?

2017-06-28 Thread Merlin Moncure
On Wed, Jun 28, 2017 at 9:54 AM, Rob Nikander wrote: > Hi, > > I'm reading about MVCC here: > https://www.postgresql.org/docs/current/static/mvcc.html. > > In some cases I can use these transaction isolation modes, but in other > cases, I may want to manage the versions and concurrency manually. I

Re: [GENERAL] 9.6 parameters messing up my 9.2 pg_dump/pg_restore

2017-06-28 Thread Tom Lane
Alvaro Herrera writes: > Ken Tanzer wrote: >> I didn't see any options for dealing with this, though I'm hoping I'm >> missing something easy or obvious. Any suggestions or help would be >> appreciated. Thanks. > pg_dump doesn't promise that its output is compatible with servers older > than it

Re: [GENERAL] 9.6 parameters messing up my 9.2 pg_dump/pg_restore

2017-06-28 Thread David G. Johnston
On Wednesday, June 28, 2017, Alvaro Herrera wrote: > Ken Tanzer wrote: > > > I didn't see any options for dealing with this, though I'm hoping I'm > > missing something easy or obvious. Any suggestions or help would be > > appreciated. Thanks. > > pg_dump doesn't promise that its output is comp

Re: [GENERAL] 9.6 parameters messing up my 9.2 pg_dump/pg_restore

2017-06-28 Thread Alvaro Herrera
Ken Tanzer wrote: > I didn't see any options for dealing with this, though I'm hoping I'm > missing something easy or obvious. Any suggestions or help would be > appreciated. Thanks. pg_dump doesn't promise that its output is compatible with servers older than itself. I'm afraid you're stuck w

[GENERAL] 9.6 parameters messing up my 9.2 pg_dump/pg_restore

2017-06-28 Thread Ken Tanzer
Hi. I've got a CentOS server with 9.2 and 9.6 both running. (Both from PGDG). I've got a cron job that transfers data from one DB to another, that recently stopped working, and I traced it to my installing 9.6. The dump comand is pretty straightforward: pg_dump -c -O -t "${prefix}*"... But at

[GENERAL] PostGreSQL Timeout, auto shutdown and Pkey errors

2017-06-28 Thread Niel Smith
Hi, So I have a few problems with my PostGreSQL and was hoping you could help me out. one is I'm getting random timeouts and the errors I'm seeing in the logs are On the 6/22/17 at 10:51am we had ERROR [08001] timeout expired at System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, Re

[GENERAL] Re[2]: [GENERAL] SPI_execute_plan and vardata

2017-06-28 Thread Арсен Арутюнян
Thank you next question - how i can call pg_notify or NOTIFY query from c function Arsen >Пятница, 23 июня 2017, 0:33 +03:00 от Tom Lane : > >=?UTF-8?B?0JDRgNGB0LXQvSDQkNGA0YPRgtGO0L3Rj9C9?= < aru...@bk.ru > writes: >> Datum Values[2]; > >> Values[0]-is integer type  >> but Values[1] is string

[GENERAL] BUG in Prepared transactions from C code using JSON

2017-06-28 Thread Арсен Арутюнян
i've got table with json field. i'm trying to insert from C function some json data. i'm using SPI_execute_plan function to do this. json data prepared with StringInfo simple example: StringInfo Message = makeStringInfo(); appendStringInfoString(Message, "{\"Command\":227,\"Status\":2,\"JobId\"

Re: [GENERAL] Unknown lvalue 'PIDFILE' in section 'Service'

2017-06-28 Thread marcelo
On 28/06/17 10:17, Adrian Klaver wrote: On 06/28/2017 05:06 AM, marcelo wrote: Hi Today I installed postgresql 9.4 on Lubuntu 15.04 from the EnterpriseDB's package. I modified pg_hba.conf to accept connections from the local network, and tried to start the backend. It do not; looking the

Re: [GENERAL] Is the row version available in SQL?

2017-06-28 Thread Chris Travers
On Wed, Jun 28, 2017 at 4:54 PM, Rob Nikander wrote: > Hi, > > I'm reading about MVCC here: https://www.postgresql. > org/docs/current/static/mvcc.html. > > In some cases I can use these transaction isolation modes, but in other > cases, I may want to manage the versions and concurrency manually.

[GENERAL] Is the row version available in SQL?

2017-06-28 Thread Rob Nikander
Hi, I'm reading about MVCC here: https://www.postgresql.org/docs/current/static/mvcc.html . In some cases I can use these transaction isolation modes, but in other cases, I may want to manage the versions and concurrency manually. Is th

Re: [GENERAL] CREATE TABLE & composite type

2017-06-28 Thread gmb
Merlin Moncure-2 wrote > postgres=# create type foo as (a int, b int); > CREATE TYPE > postgres=# create table bar of foo; > CREATE TABLE > Time: 0.973 ms Exactly what I needed, Thanks a lot, Merlin -- View this message in context: http://www.postgresql-archive.org/CREATE-TABLE-composite-typ

Re: [GENERAL] CREATE TABLE & composite type

2017-06-28 Thread Adrian Klaver
On 06/28/2017 06:52 AM, Merlin Moncure wrote: On Wed, Jun 28, 2017 at 8:37 AM, Adrian Klaver wrote: On 06/28/2017 06:27 AM, gmb wrote: CREATE TABLE inventory_item_table AS ( SELECT some_func( ) limit 0); I think it's better to use the (somewhat arcane but designed for this exact purpose)

Re: [GENERAL] Which process is actually doing the WAL writes/calls XLogFlush?

2017-06-28 Thread Adrian Klaver
On 06/27/2017 11:47 PM, Daniel Westermann wrote: AFAIK the wal writer process. ​>Um, no. "Synchronous" means that the caller has to wait for the result to appear before it can move on. "Asynchronous" means that >he caller can issue the instruction and immediately move on. I guessing

Re: [GENERAL] CREATE TABLE & composite type

2017-06-28 Thread gmb
Adrian Klaver-4 wrote > > CREATE TABLE inventory_item_table AS ( SELECT some_func( ) limit 0); Thanks Adrian My concern is that this will have to execute all code in the function only to return a empty dataset - his may be ineffective. A possible workaround will be to have a dedicated param which

Re: [GENERAL] CREATE TABLE & composite type

2017-06-28 Thread Merlin Moncure
On Wed, Jun 28, 2017 at 8:37 AM, Adrian Klaver wrote: > On 06/28/2017 06:27 AM, gmb wrote: >> >> Hi Referencing https://www.postgresql.org/docs/9.6/static/rowtypes.html >> Taking a chance here Is there a short-hand way in which I can create a >> table with the same structure as a user defined

Re: [GENERAL] CREATE TABLE & composite type

2017-06-28 Thread Adrian Klaver
On 06/28/2017 06:27 AM, gmb wrote: Hi Referencing https://www.postgresql.org/docs/9.6/static/rowtypes.html Taking a chance here Is there a short-hand way in which I can create a table with the same structure as a user defined composite type ? E.g. CREATE TYPE inventory_item AS ( name text,

Re: [GENERAL] Accessing DB2 tables from postgresql

2017-06-28 Thread Adrian Klaver
On 06/28/2017 01:28 AM, Swapnil Vaze wrote: Hello, I dropped and recreated foreign table with odbc_database option. Also tried to use import foreign schema object still getting same error. CREATE FOREIGN TABLE odbc_table ( CTGRY_ID INTEGER, CTGRY_CD VARCHAR(10), UPDT_TS TIMESTAMP ) S

[GENERAL] CREATE TABLE & composite type

2017-06-28 Thread gmb
HiReferencing https://www.postgresql.org/docs/9.6/static/rowtypes.htmlTaking a chance here Is there a short-hand way in which I can create a table with the same structure as a user defined composite type ? E.g.CREATE TYPE inventory_item AS (nametext,supplier_id integer,

Re: [GENERAL] Unknown lvalue 'PIDFILE' in section 'Service'

2017-06-28 Thread Adrian Klaver
On 06/28/2017 05:06 AM, marcelo wrote: Hi Today I installed postgresql 9.4 on Lubuntu 15.04 from the EnterpriseDB's package. I modified pg_hba.conf to accept connections from the local network, and tried to start the backend. It do not; looking the log, I can see the message I copied to the

[GENERAL] Unknown lvalue 'PIDFILE' in section 'Service'

2017-06-28 Thread marcelo
Hi Today I installed postgresql 9.4 on Lubuntu 15.04 from the EnterpriseDB's package. I modified pg_hba.conf to accept connections from the local network, and tried to start the backend. It do not; looking the log, I can see the message I copied to the subject. The full log entry is [/lib/s

Re: [GENERAL] Accessing DB2 tables from postgresql

2017-06-28 Thread Swapnil Vaze
Hello, I dropped and recreated foreign table with odbc_database option. Also tried to use import foreign schema object still getting same error. CREATE FOREIGN TABLE odbc_table ( CTGRY_ID INTEGER, CTGRY_CD VARCHAR(10), UPDT_TS TIMESTAMP ) SERVER odbc_server OPTIONS ( odbc_database 'TE