SV: Implementing pgaudit extension on Microsoft Windows

2019-02-11 Thread Niels Jespersen
Thanks Tom alter system set pgaudit.log = 'all'; -- Works, it results in 2019-02-12 08:51:49.109 CET [13560] LOG: parameter "pgaudit.log" changed to "all" after select pg_reload_conf(); alter system set pgaudit.logx = 'all'; -- Notice spelling error logx: Fails, it results immediately in 2019-

Re: Server goes to Recovery Mode when run a SQL

2019-02-11 Thread Michael Paquier
On Sun, Feb 10, 2019 at 03:15:38PM +1100, rob stone wrote: > Down around line 87 onwards there are generate_series without any > parameters, and further dubious usage of EPOCH, as well as DOW. > > Not having the table definitions is obviously clouding the analysis. That seems like the root issue

Re: Promote replica before being able to accept connections

2019-02-11 Thread Michael Paquier
On Mon, Feb 11, 2019 at 06:59:27AM -0800, Martín Fernández wrote: > That makes sense! > > Thanks for the quick reply Note that PostgreSQL 9.4 has introduced a new parameter in recovery.conf that allows recovery to finish exactly when a consistent state has been reached: recovery_target = 'immedia

Re: Blank, nullable date column rejected by psql

2019-02-11 Thread Ron
On 2/11/19 5:44 PM, Rich Shepard wrote: On Mon, 11 Feb 2019, Ron wrote: You've got ADOS (All Databases are Oracle Syndrome). Interesting as I've never bought, used, or seen anything from Oracle. Guess it's transmitted by errent bits. It's easily transmitted via toilet seats. -- Angular mom

Re: Blank, nullable date column rejected by psql

2019-02-11 Thread Ken Tanzer
> > > Ken, > > Well, you've succeeded in confusing me. :-) > > And this is the framwork for adding rows: > > insert into Activities (person_id,act_date,act_type,notes,next_contact) > values > ( > > I add values for each column, but if there's no scheduled next_contact date > I left that off. To me,

Re: Blank, nullable date column rejected by psql

2019-02-11 Thread Rich Shepard
On Mon, 11 Feb 2019, Ken Tanzer wrote: Just in case you miss this little nuance, you don't necessarily _have_ to specify a NULL for that column, depending how you're doing your inserts. You haven't show us your table or what INSERT you're using, but all of these examples will work, and don't spe

Re: Aurora Postgresql RDS DB Latency

2019-02-11 Thread github kran
On Mon, Feb 11, 2019 at 3:29 PM Michael Lewis wrote: > Are default statistics target the same on both prod and AWS? Have you > analyzed all tables being used in this query to ensure stats are up proper? > If the optimizer is choosing a different plan, then the stats must be > different IMO. > > >

Re: Blank, nullable date column rejected by psql

2019-02-11 Thread Ken Tanzer
> > > Ron, > > All of you who responded drove home my need to explicitly enter null when > there are no data for a column. > > Thanks, > > Rich > > Just in case you miss this little nuance, you don't necessarily _have_ to specify a NULL for that column, depending how you're doing your inserts. You

Re: Blank, nullable date column rejected by psql

2019-02-11 Thread Rich Shepard
On Mon, 11 Feb 2019, Ron wrote: You've got ADOS (All Databases are Oracle Syndrome). Interesting as I've never bought, used, or seen anything from Oracle. Guess it's transmitted by errent bits. Regards, Rich

Re: Blank, nullable date column rejected by psql

2019-02-11 Thread Rich Shepard
On Mon, 11 Feb 2019, Rich Shepard wrote: All of you who responded drove home my need to explicitly enter null when there are no data for a column. Correction: when there are no date data for a column. Rich

Re: Blank, nullable date column rejected by psql

2019-02-11 Thread Ron
On 2/11/19 5:30 PM, Rich Shepard wrote: On Mon, 11 Feb 2019, Tom Lane wrote: An empty string is not a null. Tom, I understand this yet thought that empty strings and numeric fields were accepted. Guess I need to review this. You've got ADOS (All Databases are Oracle Syndrome). -- Angular

Re: Blank, nullable date column rejected by psql

2019-02-11 Thread Rich Shepard
On Mon, 11 Feb 2019, Ron wrote: NULL is nothing. Blank isn't nothing; blank is a zero-length string.  Thus, you need to tell Pg "nothing", not "blank string". Ron, All of you who responded drove home my need to explicitly enter null when there are no data for a column. Thanks, Rich

Re: Blank, nullable date column rejected by psql

2019-02-11 Thread Rich Shepard
On Mon, 11 Feb 2019, Tom Lane wrote: An empty string is not a null. Tom, I understand this yet thought that empty strings and numeric fields were accepted. Guess I need to review this. Thanks, Rich

Re: Blank, nullable date column rejected by psql

2019-02-11 Thread David G. Johnston
On Mon, Feb 11, 2019 at 3:44 PM Rich Shepard wrote: > Now I know to replace no dates with null I'll do so but I'm curious why this > is needed. Same reason you needed it about a month ago when you were dealing with a check constraint question with the same error message. David J.

Re: Blank, nullable date column rejected by psql

2019-02-11 Thread Tom Lane
Rich Shepard writes: > In a .sql file to insert rows in this table psql has a problem when there's > no value for the next_contact column: > $ psql -f activities.sql -d bustrac > psql:activities.sql:6: ERROR: invalid input syntax for type date: "" > LINE 2: ...ise. Asked him to call.',''), > E

Re: Blank, nullable date column rejected by psql

2019-02-11 Thread Adrian Klaver
On 2/11/19 2:44 PM, Rich Shepard wrote: Running postgresql-10.5 on Slackware-14.2. A table has a column defined as Column   | Type  | Collation | Nullable | Default next_contact | date  |   |  | In a .sql file to insert rows in this table psql has a problem when there's no

Re: Blank, nullable date column rejected by psql

2019-02-11 Thread Ron
On 2/11/19 4:44 PM, Rich Shepard wrote: Running postgresql-10.5 on Slackware-14.2. A table has a column defined as Column   | Type  | Collation | Nullable | Default next_contact | date  |   |  | In a .sql file to insert rows in this table psql has a problem when there's no

Blank, nullable date column rejected by psql

2019-02-11 Thread Rich Shepard
Running postgresql-10.5 on Slackware-14.2. A table has a column defined as Column | Type | Collation | Nullable | Default next_contact | date | | | In a .sql file to insert rows in this table psql has a problem when there's no value for the next_contact column: $ psq

Re: Aurora Postgresql RDS DB Latency

2019-02-11 Thread Michael Lewis
Are default statistics target the same on both prod and AWS? Have you analyzed all tables being used in this query to ensure stats are up proper? If the optimizer is choosing a different plan, then the stats must be different IMO. *Michael Lewis | Software Engineer* *Entrata* On Mon, Feb 11, 2

Aurora Postgresql RDS DB Latency

2019-02-11 Thread github kran
Hi Postgres Team, We are using AWS Aurora RDS Postgres DB 9.6.8 Engine. We recently deleted few million rows from the database and ran into a issue in one of our dev account where the DB was not normal after this deletion. We did re index, vacuuming entire database but we couldnt bring it to the sa

Re: Odd messages on reloading DB table

2019-02-11 Thread Steve Wampler
On 2/7/19 3:24 PM, David G. Johnston wrote: On Thursday, February 7, 2019, Steve Wampler mailto:swamp...@nso.edu>> wrote:    (1) the table already exist and the immediately doesn't exist?    (2) report ERROR on UPDATE when there are no UPDATES in the input file Most likely the first

Re: Odd messages on reloading DB table

2019-02-11 Thread David G. Johnston
On Mon, Feb 11, 2019 at 12:29 PM Steve Wampler wrote: > Thanks - but I thought the search_path update was a PG 10 change and so > shouldn't reflect on 9.5.15 behavior. Did it > get back-ported? Yes, it was deemed a security vulnerability and thus back-patched. Release notes will indicate when t

Re: Copy entire schema A to a different schema B

2019-02-11 Thread Adrian Klaver
On 2/11/19 8:30 AM, Tiffany Thang wrote: Thanks Adrian and Ron. Sorry, I was not clear. What I'm trying to achieve was to dump the schema quickly and be able to restore a single or subset of objects from the dump. As far as I understand, the only way of achieving that is to use the custom forma

Re: Copy entire schema A to a different schema B

2019-02-11 Thread Tiffany Thang
Thanks Adrian and Ron. Sorry, I was not clear. What I'm trying to achieve was to dump the schema quickly and be able to restore a single or subset of objects from the dump. As far as I understand, the only way of achieving that is to use the custom format and the -j option. Is that correct? Are the

Re: Copy entire schema A to a different schema B

2019-02-11 Thread Ron
On 2/11/19 10:00 AM, Tiffany Thang wrote: Hi, To copy the source schema A to target schema B in the same database in PG10.3, I use psql to dump schema A and manually removes anything specific to the schema in the text dump file before importing into schema B. How do I achieve the same exportin

Re: Copy entire schema A to a different schema B

2019-02-11 Thread Adrian Klaver
On 2/11/19 8:00 AM, Tiffany Thang wrote: Hi, To copy the source schema A to target schema B in the same database in PG10.3, I use psql to dump schema A and manually removes anything specific to the schema in the text dump file before importing into schema B. How do I achieve the same exporting

Copy entire schema A to a different schema B

2019-02-11 Thread Tiffany Thang
Hi, To copy the source schema A to target schema B in the same database in PG10.3, I use psql to dump schema A and manually removes anything specific to the schema in the text dump file before importing into schema B. How do I achieve the same exporting from Schema A and importing into schema B usi

Re: Promote replica before being able to accept connections

2019-02-11 Thread Martín Fernández
Laurenz, That makes sense!  Thanks for the quick reply Best, Martín On Mon, Feb 11th, 2019 at 7:55 AM, Laurenz Albe wrote: > > > > Martín Fernández wrote: > > We have a 9.2 pg cluster and we are in the process of rebuilding a > master database in our staging environment. > > In order to

Re: Implementing pgaudit extension on Microsoft Windows

2019-02-11 Thread Pavel Stehule
po 11. 2. 2019 v 15:37 odesílatel Pavel Stehule napsal: > > > po 11. 2. 2019 v 14:23 odesílatel Niels Jespersen napsal: > >> Hello all >> >> >> >> Recent Oracle convert here. >> >> >> >> Running PostgreSQL 11 on Windows (10 and 2016). >> >> >> >> Please advise, if I should direct this to another

Re: Implementing pgaudit extension on Microsoft Windows

2019-02-11 Thread Tom Lane
Niels Jespersen writes: > Copied pgaudit.dll to C:\Program Files\PostgreSQL\11\lib > Copied pgaudit.control and pgaudit--1.3.sql to C:\Program > Files\PostgreSQL\11\share\extension > Set shared_preload_libraries = 'pgaudit' > Restart PostgreSQL > Run "CREATE EXTENSION pgaudit;" > alter system se

Re: Implementing pgaudit extension on Microsoft Windows

2019-02-11 Thread Pavel Stehule
po 11. 2. 2019 v 14:23 odesílatel Niels Jespersen napsal: > Hello all > > > > Recent Oracle convert here. > > > > Running PostgreSQL 11 on Windows (10 and 2016). > > > > Please advise, if I should direct this to another mailinglist or forum. > > > > I want to implement detailed object auditing on

RE: bdr replication breaks down

2019-02-11 Thread Daniel Fink (PDF)
Hi again, So I checked the x_logs and found the following lines. It seems like it faild at commiting a long transaction… I am still not sure what the pg_temp30 schema is used for. But I was able to “fix” it with select bdr.skip_changes_upto('6208877715678412212', 1, 2942745, '7D/2E314530');

Implementing pgaudit extension on Microsoft Windows

2019-02-11 Thread Niels Jespersen
Hello all Recent Oracle convert here. Running PostgreSQL 11 on Windows (10 and 2016). Please advise, if I should direct this to another mailinglist or forum. I want to implement detailed object auditing on PostgreSQL. This is what PGAudit extension does. However most advice on this is directed

Re: bdr replication breaks down

2019-02-11 Thread Alvaro Aguayo Garcia-Rada
What's the command you are running to trigger such behaviour? Regards, Alvaro Aguayo Jefe de Operaciones Open Comb Systems E.I.R.L. (+51-1) 337-7813 Anexo 4002 www.ocs.pe - Original Message - From: "Daniel Fink (PDF)" To: "pgsql-general" Sent: Monday, 11 February, 2019 05:18:30 Subjec

RE: Postgresql Duplicate DB

2019-02-11 Thread Alvaro Aguayo Garcia-Rada
Hi. Not sure if the fastest, but the first that comes up to my mind is using pg_dump and psql. First you create your new database, then you run this(replacing as needed): pg_dump OLDDB | psql NEWDB Saludos, Alvaro Aguayo Jefe de Operaciones Open Comb Systems E.I.R.L. Oficina: (+51-1) 3377813 

Re: Postgresql Duplicate DB

2019-02-11 Thread Laurenz Albe
Sathish Kumar wrote: > I would like to duplicate our existing db on the same server, what will be > the faster way to achieve it. If it is in the same database cluster, you can use CREATE DATABASE newdb TEMPLATE olddb; Make sure nobody is connected to "olddb" when you do that. If you want t

Postgresql Duplicate DB

2019-02-11 Thread Sathish Kumar
Hi All, I would like to duplicate our existing db on the same server, what will be the faster way to achieve it. DB size is around 300gb.

Re: Promote replica before being able to accept connections

2019-02-11 Thread Laurenz Albe
Martín Fernández wrote: > We have a 9.2 pg cluster and we are in the process of rebuilding a master > database in our staging environment. > In order to achieve the latter goal, we are restoring our staging database > using pg_basebackup against one > of our production replicas. > > pg_baseback

bdr replication breaks down

2019-02-11 Thread Daniel Fink (PDF)
Hi all, I have a bdr replication setup that worked fine until recently. But it seems like one command cannot be replicated, and it breaks down the whole process on all hosts where it is sent to. I appended part of the log file, it gets repeated over and over. Can I somehow omit this command a

Re: tsvector field length limitation

2019-02-11 Thread AJG
Hi Jonathan, Check out this potential fix/extension https://github.com/postgrespro/tsvector2 -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html