Is pg_restore in 10.6 working?

2018-11-12 Thread David
I have some experience with different versions of Postgres, but I'm just getting around to using pg_restore, and it's not working for me at all. I can connect with psql, and pg_dump works, but pg_restore never does anything when I call it. It never even prompts for a password. Here is my pg_hba.

Re: Is pg_restore in 10.6 working?

2018-11-12 Thread David
gt; > On 11/12/18 11:44 AM, Tom Lane wrote: > > David writes: > >> I have some experience with different versions of Postgres, but I'm just > >> getting around to using pg_restore, and it's not working for me at all. > >> ... > >> But a matching

Re: Is pg_restore in 10.6 working?

2018-11-12 Thread David
Thanks, Adrian. It's running now. On Mon, Nov 12, 2018 at 5:05 PM Adrian Klaver wrote: > On 11/12/18 1:58 PM, David wrote: > > Please reply to list also. > Ccing list > > > Yes, that's what I get for writing emails while I'm doing 5 other things > > at

Re: Why is tuple_percent so low?

2018-02-27 Thread David Rowley
rmance then you might be able to solve that problem with an index. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services

Re: index-only-scan when there is an index on all columns

2018-02-27 Thread David Rowley
On 28 February 2018 at 11:11, Andres Freund wrote: > I'm fairly certain that only vacuum and table rewrites like cluster sets > all-visible, I don't think the pages are set all visible again after a rewrite. -- David Rowley http://www.2ndQuadrant.com/ Postgr

Re: Is there a continuous backup for pg ?

2018-03-02 Thread David Steele
required time. PITR allows you to specify any time for recovery. Regards, -- -David da...@pgmasters.net

Best options for new PG instance

2018-03-05 Thread David Gauthier
Hi: I'm going to be requesting a PG DB instance (v9.6.7) from an IT dept in a large corp setting. I was wondering if anyone could comment on the pros/cons of getting this put on a virtual machine vs hard metal ? Locally mounted disk vs nfs ? Thanks !

Can I grant permissions to specific set of uids (linux) ?

2018-03-06 Thread David Gauthier
Hi: I'd like to grant select, insert, update, delete to a table for a specific set of uids (linux). All others get select only. Can the DB authenticate the current linux user and grant access based on the fact that they are logged in ()IOW, no passwords ?Is this possible ? If so, how ? Than

Re: Barman versus pgBackRest

2018-03-09 Thread David Steele
to archive-push speed in the 2.0 release. I'd be happy to answer any specific questions you have about pgBackRest. Regards, -- -David da...@pgmasters.net

Re: Is there a way to create a functional index that tables tableoid column as an arg?

2018-03-11 Thread David Rowley
o: -- get all animals that are persons select ... from animal where tableoid in (select get_inherited_tables('person'::regclass); -- get all animals that are not persons select ... from animal where tableoid not in (select get_inherited_tables('person'::regclass); Just be carefu

Re: primary key and unique index

2018-03-23 Thread David Rowley
e sense to create a primary key AND a unique > index based on the same columns? > Is PostgreSQL smart enough to use the unique index created for the primary > key. Doing this makes no sense in PostgreSQL. I'm struggling to imagine why it would in MySQL. -- David Rowley

Re: pg_stat_statements: password in command is not obfuscated

2018-03-23 Thread David Rowley
_statement = 'ddl' would have kept a record of the same thing. Perhaps the best fix would be a documentation improvement to mention the fact and that it's best not to use plain text passwords in CREATE/ALTER ROLE. Passwords can be md5 encrypted. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services

Re: Bad Query Plans on 10.3 vs 9.6

2018-03-28 Thread David Rowley
LL. A record already deleted won't appear in the 2nd branch of the UNION ALL result. However, that still might not fix your issue with the index not being used, but you may find the anti-joined version of the query is faster anyway. -- David Rowley http://www.2ndQuadrant.com

Re: Bad Query Plans on 10.3 vs 9.6

2018-03-29 Thread David Rowley
show you the value, however, I think a problem here is unlikely since that would just control the likelihood of an index-only-scan vs an index-scan. You're getting a Seq-scan, which I imagine is going to be quite a bit more expensive than even an index scan. -- David Rowley

hardcode password in connect string

2018-04-13 Thread David Gauthier
Hi: PG v9.5.2 on RHEL I like to use an alias to connect to my favorite DBs but don't like to enter passwords. I used to just disable passwords (working behind a firewall), but this one is different. I see nothing in the interactive connect string where I can enter the password... psql -h theho

Re: hardcode password in connect string

2018-04-13 Thread David Gauthier
docs/9.0/static/libpq-pgservice.html > > Jim > > > On April 13, 2018 2:43:01 PM EDT, David Gauthier > wrote: >> >> Hi: >> >> PG v9.5.2 on RHEL >> >> I like to use an alias to connect to my favorite DBs but don't like to >> enter passwords

Re: Barman versus pgBackRest

2018-04-13 Thread David Steele
ither feature is currently at the top of the list. Unfortunately, we have limited resources and must prioritize. Regards, -- -David da...@pgmasters.net

Can PostgreSQL create new WAL files instead of reusing old ones?

2018-04-17 Thread David Pacheco
tl;dr: We've found that under many conditions, PostgreSQL's re-use of old WAL files appears to significantly degrade query latency on ZFS. The reason is complicated and I have details below. Has it been considered to make this behavior tunable, to cause PostgreSQL to always create new WAL files i

Re: Can PostgreSQL create new WAL files instead of reusing old ones?

2018-04-17 Thread David Pacheco
On Tue, Apr 17, 2018 at 11:57 AM, Tom Lane wrote: > Alvaro Herrera writes: > > David Pacheco wrote: > >> tl;dr: We've found that under many conditions, PostgreSQL's re-use of > old > >> WAL > >> files appears to significantly degrade query latenc

Re: Inconsistent compilation error

2018-04-18 Thread David Rowley
wo arguments? I'm unsure why you're considering 'blah_history.original_id' not to be an argument here. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services

Backup Strategy Advise

2018-04-24 Thread David Gauthier
Hi: I need some advise on how best to backup a PG DB. PG 9.5.2 on RHEL6 The requirement is to be able to restore the DB after catastrophic failure and lose no more than the last 15 minutes worth of data. Also, we would like to be able to do the backups on-line (no down time). There is no need f

Run external command as part of an sql statement ?

2018-05-07 Thread David Gauthier
Hi: At the psql prompt, I can do something like... "select \! id -nu" ...to get the uid of whoever's running psql. I want to be able to run a shell command like this from within a stored procedure. Is there a way to do this ? Thanks

Re: What is the C function to modify attribute

2018-05-16 Thread David Rowley
> Can anyone help? Thank you so much!! You might find https://www.postgresql.org/docs/10/static/triggers.html useful. There's a complete example of a trigger function written in C there. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services

Re: limit and query planner

2018-06-05 Thread David Rowley
er estimates 500 rows will match the status=1 query. So thinks ceil(1 * (6860 / 500.0) * 10) = 138 rows will need looked at in the seqscan plan. That's obviously more costly than 17 rows. So the index scan begins to look more favourable. The planner always assumes the rows are evenly distribu

Doing a \set through perl DBI ?

2018-06-06 Thread David Gauthier
Hi: Is there a way to do the equivalent of a "\set foo 1" through perl dbi ? I tried... $dbh->do("\\set foo 1"); and got a syntax error Of course, I'd also have to be able to access the value of foo once its set. I'm guessing the usual way ??? (select :foo) Thanks for any help !

Re: Doing a \set through perl DBI ?

2018-06-06 Thread David Gauthier
e was to create a temporary table and have the perl script shove the uid into a column in that table, then query against that. Sort of like using a temp table to store variables set from outside. On Wed, Jun 6, 2018 at 11:46 AM, David G. Johnston < david.g.johns...@gmail.com> wrote: >

Re: Can PostgreSQL create new WAL files instead of reusing old ones?

2018-06-21 Thread David Pacheco
On Wed, Jun 20, 2018 at 10:35 AM, Jerry Jelinek wrote: > As Dave described in his original email on this topic, we'd like to avoid > recycling WAL files since that can cause performance issues when we have a > read-modify-write on a file that has dropped out of the cache. > > I have implemented a

Re: help understanding create statistic

2018-06-28 Thread David Rowley
ou analyze the table again. If those stats didn't exist, the planner would have multiplied the selectivity estimates of each item in the WHERE clause individually. So if about 10% of records had year=2018, and 0.01% had '2018-06-28', then the selectivity would have been 0.1 * 0.0

Re: Convert Existing Table to a Partition Table in PG10

2018-07-01 Thread David Rowley
w all 2017 timestamps and only 2017 timestamps. You've no need to consider precision of the type and how many 9's you add to anything here. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services

Re: FK v.s unique indexes

2018-07-03 Thread David Rowley
k. Alvaro managed to simplify the problem and allow foreign keys to be defined on partitioned tables and get that into PG11. So it was a case of 50% is better than 0%, which I very agree with. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services

Re: pg_dump out of memory

2018-07-03 Thread David Rowley
educing my memory settings: > > maintenance_work_mem = 80MB > work_mem = 5MB > shared_buffers = 200MB You may also get it to work by reducing shared_buffers further. work_mem won't have any affect, neither will maintenance_work_mem. Failing that, the suggestions of more RAM and/or swa

As a table owner, can I grant "grant" ?

2018-07-05 Thread David Gauthier
Postgres 9.5.2 on linux Given that I am not superuser, but DO have createrole... Can I grant some other role the ability to grant access to a table I created ? For Example: I create a table called foo. As the creator/owner of this table, I seem to have the ability to grant select,insert,update,

Re: How to set array element to null value

2018-07-09 Thread David Fetter
ecause to is about how to use PostgreSQL, not how to change PostgreSQL. Best, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 Remember to vote! Consider donating to Postgres: http://www.postgresql.org/about/donate

timestamp (military) at time zone without the suffix

2018-07-11 Thread David Gauthier
Hi: I would like to get the utc timestamp, 24-hr clock (military time), without the time zone suffix. Below commands were run nearly at the same time... sqfdev=> select now()::timestamp(0) ; now - 2018-07-11 15:27:12 (1 row) ...then immediately... sqfdev=> select

Re: timestamp (military) at time zone without the suffix

2018-07-11 Thread David Gauthier
o store the UTC time. How d I do that ? insert into foo (dt) values (localtimestamp(0) at time zone 'utc') ??? On Wed, Jul 11, 2018 at 3:45 PM, David G. Johnston < david.g.johns...@gmail.com> wrote: > On Wednesday, July 11, 2018, David Gauthier > wrote: > >> Hi:

Re: timestamp (military) at time zone without the suffix

2018-07-11 Thread David Gauthier
updating records using "localtimestamp(0)". On Wed, Jul 11, 2018 at 4:11 PM, David G. Johnston < david.g.johns...@gmail.com> wrote: > On Wednesday, July 11, 2018, David Gauthier > wrote: > >> OK, the "to_char" gets rid of the timezone extension. But the

sorting/comparing column values in non-alphanumeric sorting ways ?

2018-07-11 Thread David Gauthier
Hi: I have a table listing tools and tool versions for a number of different tool configurations. Something like this... create table tv (tool text, tcfg1 test, tcfg2 text, tcfg3 text, highestver text); insert into tv (tool,tcfg1mtcfg2,tcfg3) values ('tool_a','1.0.5b','1.0.10','1.0.9'); I want

Re: Optimizing execution of expensive subqueries

2018-07-14 Thread David Rowley
ause. #2 might not be a great option since it may require building groups that don't get used, but it would likely be the bast option if you didn't have a LIMIT clause, or the LIMIT was a larger percentage of the total records. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services

Re: Finding out why parallel queries not avoided

2018-07-21 Thread David Rowley
d loop is the only join method that supports non-equijoin. Unsure why you didn't get a parallel plan. Parallel in pg10 supports a few more plan shapes than 9.6 did. Unsure what version you're using. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services

Need text wrapping inside a column to avoid record wrapping (tabular output of 'select')

2018-07-25 Thread David Gauthier
Hi: psql (9.6.7, server 9.1.9) on RHEL6 In order to avoid record wrapping in the tabular output of a "select" statement, I need to limit the width of certain columns. For those columns, I would like to have text wrapping so as not to lose any information (IOW, I don't want to simply truncatate

Re: Need text wrapping inside a column to avoid record wrapping (tabular output of 'select')

2018-07-25 Thread David Gauthier
That does it. Good enough, despite the non-white space wrapping thing. Thanks ! On Wed, Jul 25, 2018 at 12:53 PM, Adrian Klaver wrote: > On 07/25/2018 09:40 AM, David Gauthier wrote: > >> Hi: >> >> psql (9.6.7, server 9.1.9) on RHEL6 >> >> In order to

Re: Restore relhaspkey in PostgreSQL Version 11 Beta

2018-07-30 Thread David Rowley
6yxr+w...@mail.gmail.com [2] https://www.postgresql.org/message-id/flat/20140317185255.20724.49675%40wrigleys.postgresql.org -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services

Re: Template0 datfrozenxid age is 160million and progressing

2018-08-01 Thread David Rowley
to prevent transaction ID wraparound. See Section 24.1.5 for more information." https://www.postgresql.org/docs/10/static/runtime-config-autovacuum.html -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services

Re: Weird behaviour of the planner

2018-08-01 Thread David Rowley
uot;. Has that table been analyzed recently? or is there some reason that auto-vacuum is not getting to it? There's a bit more reading of what I'm talking about in https://github.com/postgres/postgres/blob/master/src/backend/optimizer/util/pathnode.c#L141 -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services

Re: ProjectSet

2018-08-02 Thread David Rowley
t=0.00..0.01 rows=1 width=0) (2 rows) -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services

Re: ProjectSet

2018-08-02 Thread David Rowley
On 3 August 2018 at 01:16, Oliver Kohll wrote: > Ah thanks David, at least I know what it is now. I don't think I have any > set returning functions though will double check in case there's a joined > view that has one. Perhaps it could be the something to do with cross > p

Instead trigger on a view to update base tables ?

2018-08-07 Thread Day, David
In a view of three joined tables, I install a INSTEAD OF trigger fx on the view. The fx contains a list of felds/columns variable associated to each base tables. When an update operation occurs, I am successfully generating the target list of colums altered on Each base table. ( comparin

'Identifier' columns

2018-08-13 Thread David Favro
at a SEQUENCE is used behind the scenes hence 'currval()' could be used, but I didn't see in the docs any mention of what the underlying sequence's name is, or how to specify a name. Perhaps 'lastval()' would work, but not in all cases and in any event it has a sloppy feel to me. Thank you in advance for any advice that can be offered. -- David

Re: During promotion, new master tries to archive same segment twice

2018-08-15 Thread David Steele
more than once, especially after failures where Postgres is not sure that the command completed. The archive command should handle this gracefully. Regards, -- -David da...@pgmasters.net

Re: During promotion, new master tries to archive same segment twice

2018-08-16 Thread David Steele
On 8/16/18 4:37 AM, Phil Endecott wrote: > David Steele wrote: >> On 8/15/18 4:25 PM, Phil Endecott wrote: >>> - Should my archive_command detect the case where it is asked to >>> write the same file again with the same contents, and report success >>> in tha

Can Pg somehow recognize/honor linux groups to control user access ?

2018-08-22 Thread David Gauthier
Hi: The title says it all. I need to be control who can gain access to a DB based on a linux user group. I can set up a generic role and password, but also want to prevent users who are not in a specific linux group from accessing the DB. For code that works with the DB, this is easy (just chmo

unorthodox use of PG for a customer

2018-08-24 Thread David Gauthier
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. He's writing a script/program that runs on a workstation and needs to write

Re: unorthodox use of PG for a customer

2018-08-24 Thread David Gauthier
anks for your interest and input everyone ! On Fri, Aug 24, 2018 at 2:39 PM Edson Carlos Ericksson Richter < rich...@simkorp.com.br> wrote: > Em 24/08/2018 15:18, David Gauthier escreveu: > > Hi Everyone: > > > > I'm going to throw this internal customer request o

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: Erroneous behavior of primary key

2018-08-27 Thread David Rowley
en you've previously upgraded. For example, see [1]. [1] https://www.postgresql.org/docs/9.6/static/release-9-6-2.html -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services

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

2018-08-27 Thread David Rowley
to suggest the reasons why you might not be getting an answer. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services

Autovacuum degrades all other operations by keeping all buffers dirty?

2018-08-31 Thread David Pacheco
Hello, We've been struggling with some major performance issues related to autovacuum. (I know this is a common problem.) For a while, we believed this was primarily related to I/O contention, but recent observations from our monitoring make me wonder if there's a deeper issue here, so I'm lookin

Re: Barman versus pgBackRest

2018-09-04 Thread David Steele
re it to a new cluster, then use pg_dump to logically dump and restore it to whatever cluster you want it in. This still saves time since there is less to restore but is obviously not ideal. Regards, -- -David da...@pgmasters.net

Re: Barman versus pgBackRest

2018-09-04 Thread David Steele
On 9/4/18 11:55 AM, Ron wrote: > On 09/04/2018 10:51 AM, David Steele wrote: > [snip] >> This will work, but I don't think it's what Ron is getting at. >> >> To be clear, it is not possible to restore a database into an *existing* >> cluster using

Re: Barman versus pgBackRest

2018-09-04 Thread David Steele
Hi Ron, On 9/4/18 7:41 AM, Ron wrote: > On 03/09/2018 08:56 AM, David Steele wrote: > [snip] >>> About pgBarman, I like : >>> - be able restore on a remote server from the backup server >> This a good feature, and one that has been requested for pgBackRest. You &

Re: Barman versus pgBackRest

2018-09-04 Thread David Steele
On 9/4/18 7:41 AM, Ron wrote: > On 03/09/2018 08:56 AM, David Steele wrote: > >>> - use replication slots for backingup wal on the backup server. >> Another good feature.  We have not added it yet because pgBackRest was >> originally written for very high-volume clust

Re: Autovacuum degrades all other operations by keeping all buffers dirty?

2018-09-05 Thread David Pacheco
On Fri, Aug 31, 2018 at 3:50 PM, Andres Freund wrote: > On 2018-08-31 19:31:47 -0300, Alvaro Herrera wrote: > > On 2018-Aug-31, David Pacheco wrote: > > > > > From reading the 9.6.3 source, it looks like the autovacuum process > > > itself is single-threade

nested query problem

2018-09-06 Thread David Gauthier
Hi: I'm having trouble with this query... select sr.sqf_id, sr.status, fse.perl_sub_name, fse.end_datetime from sqf_runs sr, (select perl_sub_name, end_datetime from flow_step_events_view where sqf_id = sr.sqf_id order by 2 limit 1) fse where sr.userid='foo'; ERROR: invalid referenc

Re: nested query problem

2018-09-06 Thread David Gauthier
atch. On Thu, Sep 6, 2018 at 5:10 PM Paul Jungwirth wrote: > On 09/06/2018 01:59 PM, David Gauthier wrote: > > I'm having trouble with this query... > > > > select sr.sqf_id, sr.status, fse.perl_sub_name, fse.end_datetime > >from > > sqf_

Re: nested query problem

2018-09-06 Thread David Gauthier
Wow, I take that back. I thought there were many recs with "foo" but there wa sonly one. When I ran this against a value that actually had multiple records, it ran fine. Sorry for that. And Thanks for this query ! On Thu, Sep 6, 2018 at 5:15 PM David Gauthier wrote: > Not

Re: pgbackrest when data/base is symlinked to another volume

2018-09-07 Thread David Steele
symlink. This will exclude log files from your backup which is usually preferable -- primary logs restored to a standby are out of context and can cause confusion. Regards, -- -David da...@pgmasters.net

Re: pgbackrest when data/base is symlinked to another volume

2018-09-08 Thread David Steele
On 9/7/18 8:47 PM, Ron wrote: On 09/07/2018 05:22 PM, David Steele wrote: On 9/6/18 11:21 PM, Ron wrote: Will pgbackrest properly backup and restore the cluster if data/base, data/pg_xlog and data/pg_log are symlinks? PGDATA=/var/lib/pgsql/9.6/data $PGDATA/base -> /Database/9.6/b

Re: Volume partitioning (was Re: pgbackrest when data/base is symlinked to another volume)

2018-09-10 Thread David Steele
/var/lib/pgsql/9.6/log pgBackRest will expect to be pointed at a real directory (pg-path) and expect the data_directory in PostgreSQL to match. Regards, -- -David da...@pgmasters.net

Re: Code of Conduct plan

2018-09-14 Thread David Wall
; to PG, so PG can boot them.  I'm with those who think that idea is diametrically opposed to open source's freedom.  What next, monitor what apps people are using their DB for and decide if the "community" approves of its character or not? David

Convert interval to hours

2018-09-14 Thread David Gauthier
Hi: In perl/DBI, I have code that's getting me an "age" which returns something like... "-17 days -08:29:35". How can I convert that to a number of hours (as a float I would presume) ? Thanks

Re: Setting up continuous archiving

2018-09-26 Thread David Steele
implement correctly. My advice is that you use a mature backup solution like pgBackRest or barman rather than rolling your own. -- -David da...@pgmasters.net

How can I get and handle the status of sql statements that run in plpgsql ?

2018-10-02 Thread David Gauthier
Hi: psql (9.6.7, server 9.5.2) on linux How does one get the status of an sql statement executed in plpgsql? If that status is cryptic, how can that be translated to something which someone could understand? Finally, how can I effectively do a start transaction and either rollback or commit bas

Re: How can I get and handle the status of sql statements that run in plpgsql ?

2018-10-03 Thread David Gauthier
ssage (raise notice) 2) rollback somehow. On Tue, Oct 2, 2018 at 5:27 PM Adrian Klaver wrote: > On 10/2/18 1:47 PM, David Gauthier wrote: > > Hi: > > psql (9.6.7, server 9.5.2) on linux > > > > How does one get the status of an sql statement executed in plpgsql? If

Re: How can I get and handle the status of sql statements that run in plpgsql ?

2018-10-03 Thread David Gauthier
and rolls back ? On Wed, Oct 3, 2018 at 11:46 AM David Gauthier wrote: > Thanks Adrian and Christopher ! > > So the transaction will be rolled back automatically if there's a > problem. Got it ! > > Question: How do I detect when it is appropriate to raise notice so as

Re: Postgres 11, partitioning with a custom hash function

2018-10-03 Thread David Rowley
esql.git;a=blob;f=src/backend/partitioning/partbounds.c#l2056 [2] https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/test/regress/sql/insert.sql#l241 [3] https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/test/regress/sql/hash_part.sql#l10 -- David Rowley

Re: Postgres 11, partitioning with a custom hash function

2018-10-04 Thread David Rowley
On 5 October 2018 at 06:18, Harry B wrote: > > Thank you David! These helped me create an operator class. > However, there still seems to be a 'off-by-a-fixed-N' difference between the > hash value returned and how PG selects the partition. hmm, actually, this

Re: Postgres 11, partitioning with a custom hash function

2018-10-04 Thread David Rowley
il there is some other reason that is worthy of breaking it. The bar is likely set pretty high for that. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services

Re: Advice on logging strategy

2018-10-12 Thread David Steele
/pgaudit/pgaudit) gives you fine-grain control over what is logged by command type, table, or user as well as a lot more detail. -- -David da...@pgmasters.net

Re: Setting up continuous archiving

2018-10-15 Thread David Steele
far behind (and you dont use slots) you can use pgbackrest's archive to fill the gap in wal files and catchup with the master. Recovering WAL out of the archive is safer than using slots. Since the WAL is transferred over the network compressed it can also save a lot of bandwidth. Regards, -- -David da...@pgmasters.net

Re: Help with list partitioning on expression

2018-10-21 Thread David Rowley
M ts) = 1` then the current code in PartConstraintImpliedByRelConstraint() is not smart enough to know that `extract(minute FROM ts) = 1` is strict and cannot match nulls. Perhaps that could be improved, but that's how it is today. Likely you'll have better luck with a check constraint that explicitly checks

Re: Aggregated join vs. aggregate in column?

2019-07-12 Thread David Rowley
max_s1_date from schedule where schedule.ok = True and s.product_id = request.product_id) s; In this case, the subquery will be executed once per output row, so if you have some restrictive WHERE clause on the outer query then the subquery will be executed fewer times.

Re: PGbackrest capacity related question

2019-07-22 Thread David Steele
the expand the storage for the repo using one of these methods or reduce your retention settings. Regards, -- -David da...@pgmasters.net

Re: lead() with arrays - strange behaviour

2019-08-08 Thread David Rowley
a parameter from the outer query. LEAD(id_list) OVER (ORDER BY id) is never going to return anything since those are both just effectively scalar values, to which there is no "next" value. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services

Re: FW: Undelivered Mail Returned to Sender

2019-08-11 Thread David Rowley
ique constraint on that table includes 3 columns and you're just filtering on 2 of them, then it would only take some rows in there with the same mfg_key and project_key values but a different vendor_key to get the same error from that part of the query. If that shouldn't happen, then perhaps your U

Transaction state on connection Idle/Open/Failed

2019-08-16 Thread David Wall
tate, is something wrong?  Does it have pending updates that require a commit/rollback (assuming in this state rollback makes more sense). I'm really trying to find out what it means for the connection to be in OPEN or FAILED states compared to IDLE. Thanks, David

Rename a column if not already renamed.?

2019-08-20 Thread Day, David
I have a function used by my patch files which attempts to determine if the old column name exists, if so it proceeds with the rename. CREATE OR REPLACE FUNCTION sys.rename_column(schema_table_ regclass, old_name_ text, new_name text) RETURNS boolean LANGUAGE plpgsql AS $function$ BEGIN IF

RE: Rename a column if not already renamed.?

2019-08-20 Thread Day, David
pg_attribute table following an upgrade. -Original Message- From: Luca Ferrari [mailto:fluca1...@gmail.com] Sent: Tuesday, August 20, 2019 3:41 PM To: Day, David Cc: pgsql-gene...@postgresql.org Subject: Re: Rename a column if not already renamed.? On Tue, Aug 20, 2019 at 9:07 PM Day, David

RE: Rename a column if not already renamed.?

2019-08-21 Thread Day, David
: Tom Lane [mailto:t...@sss.pgh.pa.us] Sent: Tuesday, August 20, 2019 4:57 PM To: Day, David Cc: Luca Ferrari ; pgsql-gene...@postgresql.org Subject: Re: Rename a column if not already renamed.? "Day, David" writes: > The error is something like column already exists and Not sure

RE: Rename a column if not already renamed.?

2019-08-21 Thread Day, David
rian.kla...@aklaver.com] Sent: Wednesday, August 21, 2019 11:47 AM To: Day, David ; Tom Lane Cc: Luca Ferrari ; pgsql-gene...@postgresql.org Subject: Re: Rename a column if not already renamed.? On 8/21/19 7:52 AM, Day, David wrote: > I agree the function could be improved to deal with both old a

For SELECT statement (just a reading one, no 'FOR UPDATE'), is COMMIT or ROLLBACK preferred?

2019-08-25 Thread David Wall
they are processed by Postgres? Thanks, David

Re: For SELECT statement (just a reading one, no 'FOR UPDATE'), is COMMIT or ROLLBACK preferred?

2019-08-25 Thread David Wall
On 8/25/19 12:40 PM, Rob Sargent wrote On Aug 25, 2019, at 1:09 PM, David Wall wrote: Using the latest PostgreSQL, does it matter if my code does a ROLLBACK or a COMMIT on an non-modifying SELECT statement? My impression is they'd be the same as nothing is changed and therefore th

RE: Rename a column if not already renamed.?

2019-08-29 Thread Day, David
nks to all for assistance Dave -Original Message- From: Day, David Sent: Wednesday, August 21, 2019 2:58 PM To: 'Adrian Klaver' ; Tom Lane Cc: Luca Ferrari ; pgsql-gene...@postgresql.org Subject: RE: Rename a column if not already renamed.? Restoring into 11.3 instance

How to reformat output of "age()" function

2019-09-11 Thread David Gauthier
How can I change the default output of the "age" function to be, for example, in minutes? E.g. dvdb=> select age('2019-09-11 09:00:00','2019-09-09 11:00:00'); age 1 day 22:00:00 (1 row) I want the equivalent of that time delta in minutes. Thanks in Advance

Re: How to reformat output of "age()" function

2019-09-11 Thread David Gauthier
Thanks a lot! On Wed, Sep 11, 2019 at 12:34 PM Francisco Olarte wrote: > David: > > On Wed, Sep 11, 2019 at 5:39 PM David Gauthier > wrote: > > How can I change the default output of the "age" function to be, for > example, in minutes? > > E.g. > > dv

Web GUI for PG table ?

2019-09-12 Thread David Gauthier
Hi: We're considering replacing a windows AccessDB based system with PG. Access was chosen because of it's GUI to its tables (looks and behaves like a SS). But performance can be volatile given the fact that the AccessDB front-ends and back-end are at different sites 1000+ miles apart. The belief

Re: Web GUI for PG table ?

2019-09-12 Thread David Gauthier
Many good visualization options but I need one that runs on the web AND allows insert/update/delete records. On Thu, Sep 12, 2019 at 10:42 AM Adrian Klaver wrote: > On 9/12/19 7:08 AM, David Gauthier wrote: > > Hi: > > > > We're considering replacing a windows Acc

Re: pgbackrest restore to new location?

2019-09-17 Thread David Steele
ckup_label is missing or has been deleted. The easiest way to restore to a new location is just to copy pgbackrest.conf from the primary (or create a new one) with the same stanza and then alter pg1-path in pgbackrest.conf or at the command line. Regards, -- -David da...@pgmasters.net

Re: pgbackrest restore to new location?

2019-09-18 Thread David Steele
The exclusive > method has been deprecated for quite a few releases and we should stop > giving bad advice on the assumption that people are using it. We updated the error message and hints in c900c152, but it was not back-patched. -- -David da...@pgmasters.net signature.asc Description: OpenPGP digital signature

Re: pgbackrest - question about restoring cluster to a new cluster on same server

2019-09-18 Thread David Steele
pgBackRest will not impact the primary as a direct pg_basebackup will. Regards, -- -David da...@pgmasters.net

Re: pgbackrest - question about restoring cluster to a new cluster on same server

2019-09-18 Thread David Steele
ve a split-brain situation where two primaries are archiving on the same timeline then first-in wins. WAL from the losing primary will be rejected. Regards, -- -David da...@pgmasters.net

  1   2   3   4   5   6   7   8   9   10   >