Which background task looks for pg_xlog in 10?

2018-08-27 Thread Johann Spies
I see this in /var/log/postgresql/postgresql-10-main.log: postgres postgres@template1 ERROR: could not open directory "pg_xlog": No such file or directory postgres postgres@template1 STATEMENT: SELECT count(*) AS segments FROM pg_ls_dir('pg_xlog') t(fn) \ WHERE fn ~ '^[0-9A-Z]{24}$' Where does

Re: Reeving an error while taking the backup using "pg_basebackup" utility.

2018-08-27 Thread Adrian Klaver
On 08/27/2018 06:49 PM, Raghavendra Rao J S V wrote: Hi All, We are using below command to take the backup of the database. *$PGHOME/bin/pg_basebackup -p 5433 -U postgres -P -v -x --format=tar --gzip --compress=1 --pgdata=- -D /opt/rao * While taking the backup we have received below error.

Re: How to search particular line/text code in all Postgres all database objects

2018-08-27 Thread raf
Raghavendra Rao J S V wrote: > Hi All, > > How to search particular line/text code in all Postgres all database > object's like functions,triggers,views etc ? > > Is there any data dictionary table in Postgres? > > Eg:- My requirement is , I want to found data related to employee table in > any

Re: pg_basebackup + SSL error: bad length

2018-08-27 Thread Michael Paquier
On Mon, Aug 27, 2018 at 04:40:34PM -0700, Adrian Klaver wrote: > Is there more then one copy of pg_basebackup on the machines? Or this user has created a tablespace directly in the main data folder, which can cause pg_basebackup to fail because of recursion issues. It is no wonder that a WARNING

Re: Reeving an error while taking the backup using "pg_basebackup" utility.

2018-08-27 Thread Michael Paquier
On Tue, Aug 28, 2018 at 07:19:12AM +0530, Raghavendra Rao J S V wrote: > pg_basebackup: could not get transaction log end position from server: > FATAL: requested WAL segment 00010285008F has already been > removed > > Please guide me why and how to handle this error. Do you want me t

How to search particular line/text code in all Postgres all database object's

2018-08-27 Thread Raghavendra Rao J S V
Hi All, How to search particular line/text code in all Postgres all database object's like functions,triggers,views etc ? Is there any data dictionary table in Postgres? Eg:- My requirement is , I want to found data related to employee table in any function, trigger,view etc. Kindly help me. --

Reeving an error while taking the backup using "pg_basebackup" utility.

2018-08-27 Thread Raghavendra Rao J S V
Hi All, We are using below command to take the backup of the database. *$PGHOME/bin/pg_basebackup -p 5433 -U postgres -P -v -x --format=tar --gzip --compress=1 --pgdata=- -D /opt/rao * While taking the backup we have received below error. transaction log start point: 285/8F80 pg_baseba

Re: Will there ever be support for Row Level Security on Materialized Views?

2018-08-27 Thread Alvaro Herrera
On 2018-Aug-27, Ken Tanzer wrote: >- Is there any reason there is no RLS / MV support now? Nobody worked on it yet. >- Are there any reason fundamental reasons why PG couldn't support RLS >for MVs? Doesn't look like it. >- Is it just a matter of nobody has done it yet? Yeah.

First steps to being a contributer

2018-08-27 Thread Daniel Wood
Having quit Amazon, where I was doing Postgres development, I've started looking at various things I might work on for fun. One thought is to start with something easy like the scalability of GetSnapshotData(). :-) I recently found it interesting to examine performance while running near 1 m

Re: pg_sample

2018-08-27 Thread Adrian Klaver
On 08/27/2018 08:33 AM, Naveen Dabas wrote: actually i want limited data from the postgres database. But i don't want to use .csv Does the sample need to include parent/child relationships? In Postgres 9.5+ there is TABLESAMPLE: https://www.postgresql.org/docs/10/static/sql-select.html So yo

Re: pg_basebackup + SSL error: bad length

2018-08-27 Thread Adrian Klaver
On 08/27/2018 07:38 AM, Csaba Ragasits wrote: 2018-08-27 16:08 GMT+02:00 Adrian Klaver >: Can you connect to node1 using psql with and without SSL? Where is node1 relative to the machine you are running pg_basebackup from? Just to be clear b

Re: Will there ever be support for Row Level Security on Materialized Views?

2018-08-27 Thread Ken Tanzer
On Mon, Aug 27, 2018 at 4:23 PM David Rowley wrote: > > If I had to guess what's going on here then I'd say that nobody has > been sufficiently motivated to work on this yet. If that's the case, > everyone who reads your email is not the person working on this > feature, so can't answer your ques

Re: Will there ever be support for Row Level Security on Materialized Views?

2018-08-27 Thread Ken Tanzer
On Mon, Aug 27, 2018 at 4:19 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Mon, Aug 27, 2018 at 4:06 PM, Ken Tanzer wrote: > >> People on this list generally seem pretty generous in spirit and sharing >> of their knowledge, insights and opinions. It seemed a pretty reasonable >>

Re: Will there ever be support for Row Level Security on Materialized Views?

2018-08-27 Thread David Rowley
On 28 August 2018 at 11:06, Ken Tanzer wrote: > Or perhaps they "simply don't want to answer." Well I wondered about that > too, since the last person who asked about this didn't get a response either. > Is it a particularly stupid question? Is there some history that makes it a > touchy subj

Re: Will there ever be support for Row Level Security on Materialized Views?

2018-08-27 Thread David G. Johnston
On Mon, Aug 27, 2018 at 4:06 PM, Ken Tanzer wrote: > People on this list generally seem pretty generous in spirit and sharing > of their knowledge, insights and opinions. It seemed a pretty reasonable > and typical question to ask. I guess if there's no answer to be had, then > so be it! > You

Re: Erroneous behavior of primary key

2018-08-27 Thread David Rowley
On 28 August 2018 at 07:50, Daniel J Peacock wrote: > I've got an odd situation with a table that has a varchar(255) as the > primary key that is getting key values from an Elasticsearch engine. What > I'm finding is that even though there is a primary key on the table, I am > getting duplicated

Re: Will there ever be support for Row Level Security on Materialized Views?

2018-08-27 Thread Ken Tanzer
Hi David, and thanks for taking the time to respond. On Mon, Aug 27, 2018 at 3:29 PM David Rowley wrote: > > You might think there's some master project-wide list of things that > are to implement that we all work from, but there's not. > > I suppose I might have thought that, but I didn't. Tha

Re: Will there ever be support for Row Level Security on Materialized Views?

2018-08-27 Thread David Rowley
On 28 August 2018 at 09:58, Ken Tanzer wrote: > On Tue, Aug 14, 2018 at 5:24 PM Ken Tanzer wrote: >> Basically, I'm wondering whether materialized views are likely to ever >> support row-level security. > > Hi. Just wanted to follow up on my own email and see if anyone could answer > this. Yo

Re: Will there ever be support for Row Level Security on Materialized Views?

2018-08-27 Thread Ken Tanzer
On Tue, Aug 14, 2018 at 5:24 PM Ken Tanzer wrote: > Hi. My question is similar to one that was asked but apparently never > answered a couple of years ago on this list. ( > https://www.postgresql.org/message-id/20160112023419.GA30965%40moraine.isi.edu > ) > > Basically, I'm wondering whether mat

Re: Erroneous behavior of primary key

2018-08-27 Thread Rob Sargent
> On Aug 27, 2018, at 1:50 PM, Daniel J Peacock wrote: > > Good afternoon, all. > I've got an odd situation with a table that has a varchar(255) as the primary > key that is getting key values from an Elasticsearch engine. What I'm > finding is that even though there is a primary key on the

Erroneous behavior of primary key

2018-08-27 Thread Daniel J Peacock
Good afternoon, all. I've got an odd situation with a table that has a varchar(255) as the primary key that is getting key values from an Elasticsearch engine. What I'm finding is that even though there is a primary key on the table, I am getting duplicated keys in the data and the constraint is n

Re: pg_sample

2018-08-27 Thread Naveen Dabas
actually i want limited data from the postgres database. But i don't want to use .csv thanks On Mon, Aug 27, 2018 at 7:42 PM, Adrian Klaver wrote: > On 08/26/2018 11:03 PM, Naveen Dabas wrote: > >> Server encoding is UTF8 >> Client encoding is UTF8 >> Creating sample schema sampledb1 >> DBD::

Re: unorthodox use of PG for a customer

2018-08-27 Thread Dimitri Maziuk
On 8/27/2018 8:20 AM, John McKown wrote: On Fri, Aug 24, 2018 at 1:19 PM David Gauthier > wrote: I can't think of anything better.  Does anyone have any ideas? Yes, but the civil authorities would prosecute you if they found the body. And that's why we ha

Re: pg_basebackup + SSL error: bad length

2018-08-27 Thread Csaba Ragasits
2018-08-27 16:08 GMT+02:00 Adrian Klaver : > Can you connect to node1 using psql with and without SSL? > > Where is node1 relative to the machine you are running pg_basebackup from? > > Just to be clear both Postgres instances are running 10.5, correct? > >> >> Every instances are same (10.5) vers

Re: archive items not in correct section order

2018-08-27 Thread Tom Lane
Tim Clarke writes: > Last night for the first time our pg_dump backup threw this error for > the first time. Repeated runs this morning consistently throw it too. That's not supposed to happen. Can you create a test case, by any chance? Presumably, it's triggered by some database schema change y

Re: unorthodox use of PG for a customer

2018-08-27 Thread Olivier Gautherot
Hi Dave, lots of nice inputs but let's try to summarize your user's needs. On Fri, Aug 24, 2018 at 3:18 PM, David Gauthier wrote: > [...] > > He's writing a script/program that runs on a workstation and needs to > write data to a DB. This process also sends work to a batch system on a > server

Re: pg_sample

2018-08-27 Thread Adrian Klaver
On 08/26/2018 11:03 PM, Naveen Dabas wrote: Server encoding is UTF8 Client encoding is UTF8 Creating sample schema sampledb1 DBD::Pg::db do failed: ERROR:  cannot execute CREATE SCHEMA in a read-only transaction at ./pg_sample line 296. main::__ANON__('DBD::Pg::db do failed: ERROR:  cannot execu

Re: pg_basebackup + SSL error: bad length

2018-08-27 Thread Adrian Klaver
On 08/27/2018 02:00 AM, Csaba Ragasits wrote: Hello, I would like to create a streaming replication, when I'm trying the basebackup from the node1, I've the following errors: pg_basebackup -P -v -D ./main -h node1 -p 5432  -U repmgr pg_basebackup: initiating base backup, waiting for checkpoi

Re: archive items not in correct section order

2018-08-27 Thread Adrian Klaver
On 08/27/2018 03:59 AM, Tim Clarke wrote: Last night for the first time our pg_dump backup threw this error for the first time. Repeated runs this morning consistently throw it too. I can see the error in the Postgres source https://doxygen.postgresql.org/pg__backup__archiver_8c_source.html but

Re: unorthodox use of PG for a customer

2018-08-27 Thread John McKown
On Fri, Aug 24, 2018 at 1:19 PM David Gauthier wrote: > Hi Everyone: > > I'm going to throw this internal customer request out for ideas, even > though I think it's a bit crazy. I'm on the brink of telling him it's > impractical and/or inadvisable. But maybe someone has a solution. > Reading b

Re: Returning Vector of Pairs with a PostgreSQL C Extension Function

2018-08-27 Thread TalGloz
Pavel Stehule wrote > There are already prepared macros > > #define CStringGetTextDatum(s) PointerGetDatum(cstring_to_text(s)) > #define TextDatumGetCString(d) text_to_cstring((text *) > DatumGetPointer(d)) Thanks for pointing out the macros, for some reason I've missed them. Best regards, Tal

Re: Returning Vector of Pairs with a PostgreSQL C Extension Function

2018-08-27 Thread Pavel Stehule
2018-08-27 14:40 GMT+02:00 TalGloz : > It looks like changing the > > elements[0] = CStringGetDatum(localT1.c_str()); > elements[1] = CStringGetDatum(localT2.c_str()); > > to: > > elements[0] = PointerGetDatum(cstring_to_text(localT1.c_str())); > elements[1] = PointerGetDatum(cstring_to_text(local

Re: Returning Vector of Pairs with a PostgreSQL C Extension Function

2018-08-27 Thread TalGloz
It looks like changing the elements[0] = CStringGetDatum(localT1.c_str()); elements[1] = CStringGetDatum(localT2.c_str()); to: elements[0] = PointerGetDatum(cstring_to_text(localT1.c_str())); elements[1] = PointerGetDatum(cstring_to_text(localT2.c_str())); Solved the problem. If anyone thinks

Re: Returning Vector of Pairs with a PostgreSQL C Extension Function

2018-08-27 Thread TalGloz
Hello, I'm having a small problem. The code works but the array cells don't hold the whole length of *localT1* and *localT2* texts, I think it has something to do with *int16 typlen* in my set parameters: ArrayType *array; Datum elements[2]; int16 typlen; bool typbyval; char typalign; elements[0

archive items not in correct section order

2018-08-27 Thread Tim Clarke
Last night for the first time our pg_dump backup threw this error for the first time. Repeated runs this morning consistently throw it too. I can see the error in the Postgres source https://doxygen.postgresql.org/pg__backup__archiver_8c_source.html but I can't find any specifics about the cause or

Connection to PostgreSQL from Excel

2018-08-27 Thread Paul Suworow
Hi team, I am working on an Excel tool that should allow users to update tables and charts from a PostgreSQL database. My workbook currently connects to the database using the following VBA code: Set objConnection = CreateObject("ADODB.Connection")     ConnString = "DRIVER={PostgreSQL Unicode

pg_basebackup + SSL error: bad length

2018-08-27 Thread Csaba Ragasits
Hello, I would like to create a streaming replication, when I'm trying the basebackup from the node1, I've the following errors: pg_basebackup -P -v -D ./main -h node1 -p 5432 -U repmgr pg_basebackup: initiating base backup, waiting for checkpoint to complete pg_basebackup: checkpoint completed

Re: Connection to PostgreSQL from Excel

2018-08-27 Thread Łukasz Jarych
Hi, i think that this is not possible to avoid installing driver. pon., 27 sie 2018 o 09:55 Paul Suworow napisał(a): > Hi team, > > I am working on an Excel tool that should allow users to update tables and > charts from a PostgreSQL database. My workbook currently connects to the > database us