Re: [GENERAL] Backward compatibility

2017-07-21 Thread Igor Korot
Hi, guys, Below query does not even run: SELECT version(), substring( version() from position( '\s' in version() ) ); Could you spot the error? On Fri, Jul 21, 2017 at 12:11 PM, Igor Korot wrote: > David et al, > > On Fri, Jul 21, 2017 at 12:00 PM, David G. Johnston > wrote: >> On Fri, Jul 21,

Re: [GENERAL] Postgres csv logging

2017-07-21 Thread David G. Johnston
It is customary to indicate when you've posted the same question to other forums - in this case SO. https://dba.stackexchange.com/questions/180263/postgres-log-query-and-command-tag-to-csv As the comment there says your config and your output seem at odds. Though I think your confusion is still

Re: [GENERAL] Support for \u0000?

2017-07-21 Thread Matthew Byrne
I see. Thanks for the quick responses! On Wed, Jul 19, 2017 at 11:32 PM, Tom Lane wrote: > Matthew Byrne writes: > > Would a more feasible approach be to introduce new types (say, TEXT2 and > > JSONB2 - or something better-sounding) which are the same as the old ones > > but add for support \u

Re: [GENERAL] UPDATE column without FK fires other FK triggers constraint check

2017-07-21 Thread Luca Looz
Thanks for the explanation! Can these checks be implemented or the data needed is not there and adding it will only add an overhead for the majority of use cases? 2017-07-19 20:42 GMT+02:00 Tom Lane : > Luca Looz writes: > > After some tests it seems that this happens when the same row is covere

Re: [GENERAL] Support for \u0000?

2017-07-21 Thread Matthew Byrne
Thanks for the response Tom. I understand this would be a mammoth task. Would a more feasible approach be to introduce new types (say, TEXT2 and JSONB2 - or something better-sounding) which are the same as the old ones but add for support \u and UTF 0? This would isolate nul-containing byte

[GENERAL] Postgres csv logging

2017-07-21 Thread Alessandro_feliz
I am trying to log executed queries into a csv file. My main objective is to log the command tag and query. For that I enabled logging in the postgresql.conf, my configs are the following: #-- # ERROR REPORTING AND LOGGIN

Re: [GENERAL] Bug in postgres 9.6.2?

2017-07-21 Thread Tom Lane
greigwise writes: > If I can provide a pg_dump backup with a db where I can reproduce the error > and then also my postgresql.conf along with the query, would that be what > you need for a test case? Sounds like enough. regards, tom lane -- Sent via pgsql-general maili

Re: [GENERAL] Bug in postgres 9.6.2?

2017-07-21 Thread greigwise
If I can provide a pg_dump backup with a db where I can reproduce the error and then also my postgresql.conf along with the query, would that be what you need for a test case? Thanks, Greig -- View this message in context: http://www.postgresql-archive.org/Bug-in-postgres-9-6-2-tp5972185p59724

Re: [GENERAL] Backward compatibility

2017-07-21 Thread Igor Korot
David et al, On Fri, Jul 21, 2017 at 12:00 PM, David G. Johnston wrote: > On Fri, Jul 21, 2017 at 8:49 AM, Igor Korot wrote: >> >> MySQL uses this: >> https://dev.mysql.com/doc/refman/5.7/en/mysql-get-server-version.html. >> Is it safe to assume that PostgreSQL calculates the version the same wa

Re: [GENERAL] Backward compatibility

2017-07-21 Thread David G. Johnston
On Fri, Jul 21, 2017 at 8:49 AM, Igor Korot wrote: > MySQL uses this: > https://dev.mysql.com/doc/refman/5.7/en/mysql-get-server-version.html. > Is it safe to assume that PostgreSQL calculates the version the same way? > ​ Yes and no. Things are changing with this next release. The next two maj

Re: [GENERAL] Backward compatibility

2017-07-21 Thread Igor Korot
Hi, guys, On Thu, Jul 20, 2017 at 11:58 PM, Tom Lane wrote: > John R Pierce writes: >> On 7/20/2017 8:40 PM, Tom Lane wrote: >>> Hm, we need to update that text for the new 2-part version numbering >>> scheme, don't we? > >> will 10 return like 100100 if its 10.1, or 11 ? > > The latter. Th

Re: [GENERAL] pg_restore misuse or bug?

2017-07-21 Thread Jordan Gigov
This is on version 9.5, 9.6 and 10beta2. I could probably make a test-case over the weekend if I'm at home. On 21 July 2017 at 17:03, Tom Lane wrote: > Jordan Gigov writes: >> When running pg_restore as the superuser it gives the following error >> pg_restore: [archiver (db)] Error while PROCESS

Re: [GENERAL] Schemas and foreign keys

2017-07-21 Thread marcelo
Thank you, Andreas. Your answer closes this thread. On 21/07/17 11:07, Andreas Kretschmer wrote: Am 21.07.2017 um 14:58 schrieb marcelo: Recently I asked regarding schemas, and received very useful answers. I conclude that I can put some tables in one schema and left others in the public one

Re: [GENERAL] Schemas and foreign keys

2017-07-21 Thread Albe Laurenz
marcelo wrote: > Recently I asked regarding schemas, and received very useful answers. I > conclude that I can put some tables in one schema and left others in the > public one. > If my app selects some schema, the backend will found automatically the > absent tables in "public". > So far, so good.

Re: [GENERAL] pg_dump and insert json with copy

2017-07-21 Thread Tom Lane
basti writes: > some tables has json type and show the following error at restore time: > ERROR: syntax error at or near "a" > LINE 1: a:1:{i:0; > ^ Is that really the very first error reported by the restore run? It seems much more likely to be a failure cascading from something else.

Re: [GENERAL] Schemas and foreign keys

2017-07-21 Thread Andreas Kretschmer
Am 21.07.2017 um 14:58 schrieb marcelo: Recently I asked regarding schemas, and received very useful answers. I conclude that I can put some tables in one schema and left others in the public one. If my app selects some schema, the backend will found automatically the absent tables in "public

Re: [GENERAL] pg_restore misuse or bug?

2017-07-21 Thread Tom Lane
Jordan Gigov writes: > When running pg_restore as the superuser it gives the following error > pg_restore: [archiver (db)] Error while PROCESSING TOC: > pg_restore: [archiver (db)] Error from TOC entry 3253; 0 320628 > MATERIALIZED VIEW DATA combined_query_data web_user > pg_restore: [archiver (db

[GENERAL] Schemas and foreign keys

2017-07-21 Thread marcelo
Recently I asked regarding schemas, and received very useful answers. I conclude that I can put some tables in one schema and left others in the public one. If my app selects some schema, the backend will found automatically the absent tables in "public". So far, so good. But what about foreign

Re: [GENERAL] ~/.psqlrc file is ignored

2017-07-21 Thread Thom Brown
On 19 July 2017 at 20:12, vstuart wrote: > Hi David: I see what you are saying; sorry for the confusion. This is how > postgres operates on my system: > > [victoria@victoria ~]$ echo $HOME > /home/victoria > > [victoria@victoria ~]$ which postgres > /usr/bin/postgres > > [victoria@victoria ~]$

[GENERAL] pg_dump and insert json with copy

2017-07-21 Thread basti
Hello, i had backup my database with the following command # schema PGCLIENTENCODING=utf-8 pg_dump -p 5432 -s -E UTF-8 database | gzip -c > database_schema.sql.gz # data PGCLIENTENCODING=utf-8 pg_dump -p 5432 -a -E UTF-8 database | gzip -c > database_data.sql.gz and try to restore it with

[GENERAL] pg_restore misuse or bug?

2017-07-21 Thread Jordan Gigov
So we have this database dump created using "pg_dump -Fc ourdb > file.dump" that has a Materialized View that gets refreshed under certain conditions by our Java web-app. When running pg_restore as the superuser it gives the following error pg_restore: [archiver (db)] Error while PROCESSING TOC: p

Re: [GENERAL] Logging at schema level

2017-07-21 Thread Scott Mead
On Fri, Jul 21, 2017 at 2:11 AM, Nikhil wrote: > Schema = tenant. So basically tenant level logging. > If each tenant uses a separate user, you could parse this by that user. You can't separate the logs by user, but, you could use a tool like pgBadger to parse reports for each individual user (t