Re: What is wrong with my pgadmin?

2018-03-06 Thread Laurenz Albe
asking the specialized list, but -general is certainly not only for the server. Yours, Laurenz Albe

Re: dirty_ratio & dirty_background_ratio settings with huge memory

2018-03-06 Thread Laurenz Albe
experience with RAM of this size and those > settings? Yes, you should set vm.dirty_background_bytes and vm.dirty_bytes and not use the *_ratio settings. 2 GB for vm.dirty_background_bytes and 1 GB for vm.dirty_bytes sounds fine. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: dirty_ratio & dirty_background_ratio settings with huge memory

2018-03-06 Thread Laurenz Albe
Tomas Vondra wrote: > > > > 2 GB for vm.dirty_background_bytes and 1 GB for vm.dirty_bytes sounds fine. > > > > It should be the other way around: dirty_background_bytes < dirty_bytes Of course, thanks for the correction. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: dirty_ratio & dirty_background_ratio settings with huge memory

2018-03-06 Thread Laurenz Albe
pinker wrote: > Laurenz Albe wrote > > Yes, you should set vm.dirty_background_bytes and vm.dirty_bytes > > and not use the *_ratio settings. > > > > 2 GB for vm.dirty_background_bytes and 1 GB for vm.dirty_bytes sounds > > fine. To repeat (for the archive):

Re: Help troubleshooting SubtransControlLock problems

2018-03-07 Thread Laurenz Albe
on to statistics collection. This lock is used when subtransactions (SAVEPOINTs in SQL or EXCEPTION blocks in PL/pgSQL) are created, read or removed. This sounds like a PostgreSQL bug. What is the exact PostgreSQL version you are running? It would be cool if you could get a stack trace from the backend that is holding the lock. Yours, Laurenz Albe

Re: Help troubleshooting SubtransControlLock problems

2018-03-07 Thread Laurenz Albe
Scott Frazer wrote: > > On Wed, Mar 7, 2018 at 9:52 AM, Laurenz Albe wrote: > > Scott Frazer wrote: > > > Hi, we have a Postgres 9.6 setup using replication that has recently > > > started seeing a lot of processes stuck in > > > "SubtransControlLock

Re: Point-in-time recovery after failover

2018-03-13 Thread Laurenz Albe
00006.history > -rw---. 1 postgres postgres 16777216 Mar 13 20:48 0007011100AD > -rw---. 1 postgres postgres 271 Mar 13 20:46 0007.history You are missing 0005011100AE or 0006011100AE. One of these files should be there. I suspect that there is a problem with your WAL archiving in connection with failover. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: You might be able to move the set-returning function into a LATERAL FROM item.

2018-03-20 Thread Laurenz Albe
does not make sense in this context. Which of the rows do you want? If you know that it will always return at most one row, you could use: ... THEN (SELECT jae FROM jsonb_array_elements(tiles) jae LIMIT 1) Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Prepared statements

2018-03-22 Thread Laurenz Albe
Rakesh Kumar wrote: > Only in Oracle 12c there are > options to let the planner change existing plan by peeking into the parameter > values (supplied in ? of prepare) and checking it against the distribution. You mean Oracle 11g. Yours, Laurenz Albe -- Cybertec | https://www

Re: Issue with PostgreSQL replication and PITR

2018-03-27 Thread Laurenz Albe
r and WAL receiver processes? > And how to remove this .partial file from pg_xlog safely and how to start > copying wal files from pg_xlog of master server to shared location of master > and secondary server ? You should try to figure out why your "archive_command" fails; perhaps try it by hand. Once you have got that fixed, archiving will continue normally. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Connection hangs on new created schema

2018-03-27 Thread Laurenz Albe
f you know the slow query EXPLAIN (ANALYZE, BUFFERS) it and see where the time is spent. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: dblink: could not send query: another command is already in progress

2018-03-29 Thread Laurenz Albe
uery that is in progress on the named connection. Note that this is not certain to succeed (since, for example, the remote query might already have finished). A cancel request simply improves the odds that the query will fail soon. You must still complete the normal query protocol, for example by calling dblink_get_result. Not sure if that answers all your questions. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Asynchronous Trigger?

2018-03-29 Thread Laurenz Albe
d a trigger that updates the table to reflect the modifications caused by the insert, update or delete. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: dblink: could not send query: another command is already in progress

2018-03-30 Thread Laurenz Albe
of the query. That is a misunderstanding. If the connection is "busy", that means that the asynchronous query is still busy receiving a result from the server. Once it is no longer busy, a result has arrived and is ready to be consumed. You have to consume the result before you c

Re: dblink: could not send query: another command is already in progress

2018-04-03 Thread Laurenz Albe
Thiemo Kellner wrote: > On 03/30/18 11:14, Laurenz Albe wrote: > > You have to consume the result before you can send the next query. > > I changed implementation but still get the same error but now different > context. I tried to retrieve the result but I failed > > I

Re: dblink: could not send query: another command is already in progress

2018-04-03 Thread Laurenz Albe
so call dblink_get_result, regardless if the query has been cancelled or not, so that you always leave the connection in the "ready for query" state. Then you don't have to clean up. Of course you could also ignore the error you get on dblink_get_result, but that is ugly. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: pg_basebackup or dump for starting replication process

2018-04-05 Thread Laurenz Albe
tables are empty before you start logical replication. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: dealing with lock

2018-04-06 Thread Laurenz Albe
ents will be blocked during several hours. > > How do you deal with this problem? Maybe I missed something ? The solution is to avoid ALTER TABLE statements that have to rewrite the table outside of maintenance windows. If your transactions are short, as they should be, it should n

Re: Suggest the best values for the postgres configuration parameters

2018-04-11 Thread Laurenz Albe
et 0.8 > Max_prepared_transactions =0 0 (unless you need distributed transactions) Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Planning to change autovacuum_vacuum_scale_factor value to zero. Please suggest me if any negative impact.

2018-04-11 Thread Laurenz Albe
lease suggest me does it have any > negative impact. That's an excellent way to keep your database from functioning well. Rather, raise autovacuum_vacuum_cost_limit, or, more aggressively, set autovacuum_vacuum_cost_delay to 0. It is better to change the settings on individual busy table

Re: Planning to change autovacuum_vacuum_scale_factor value to zero. Please suggest me if any negative impact.

2018-04-11 Thread Laurenz Albe
ny in e-mail; I am aware I shouldn't do that. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: To prefer sorts or filters in postgres, that is the question....

2018-04-16 Thread Laurenz Albe
gh the result set and one operation per row found. And the recursive queries are pretty similar, right? Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: To prefer sorts or filters in postgres, that is the question....

2018-04-17 Thread Laurenz Albe
at's fine. A top-1-sort is less work than you maybe think: You go through all items and find the biggest one. So there is one comparison operator per row - very similar to what happens when "grepping" for NULL values. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: rehashing catalog cache id 14 for pg_opclass; 17 tups, 8 buckets

2018-04-17 Thread Laurenz Albe
Thiemo Kellner, NHC Barhufpflege wrote: > > What do you have your log levels set to? > > Thanks for pointing this out. I put client level to debug1. So, I am > just lucky not to have got flooded with Messages? Sort of. This is a normal operation and should not worry you. Your

Re: Using the public schema

2018-04-24 Thread Laurenz Albe
B instance and the data is published to other applications via API calls. > > In such a standalone database configuration, are there any security > implications > or any downsides to creating the application in the public schema? No, that's fine. Just REVOKE CREATE ON SCHEMA publi

Re: Parameter passing in trigger function write in C

2018-04-29 Thread Laurenz Albe
o is to define your own GUC (configuration parameter) and set that before you run the data modifying SQL statement. Then you can read that information in the trigger. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: what's the error meaning? on mast/slavery replication .

2018-05-06 Thread Laurenz Albe
ee that the same data are in the same block of the same file). Yours, Laurenz Albe -- +43-670-6056265 Cybertec Schönig & Schönig GmbH Gröhrmühlgasse 26, A-2700 Wiener Neustadt Web: https://www.cybertec-postgresql.com

Re: Is it possible to get username information while writing trigger?

2018-05-07 Thread Laurenz Albe
le row, not an individual column. The best you can do is to check which column values are different in OLD and NEW. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Is it possible to get username information while writingtrigger?

2018-05-07 Thread Laurenz Albe
stores. (https://www.postgresql.org/docs/current/static/trigger-interface.html) Yours, Laurenz Albe -- +43-670-6056265 Cybertec Schönig & Schönig GmbH Gröhrmühlgasse 26, A-2700 Wiener Neustadt Web: https://www.cybertec-postgresql.com

Re: duplicate key value violates unique constraint "pg_statistic_relid_att_inh_index" while performing full vacuum on the database

2018-05-09 Thread Laurenz Albe
TRUNCATE pg_statistic; ANALYZE; That should take care of the problem. It would be a good idea to pg_dumpall the cluster, remove it, recreate it and load the dump so that you are sure to have no data corruption. Yours, Laurenz Albe

Re: Best conception of a table

2018-05-11 Thread Laurenz Albe
nge does not contain your interval, then remove all products where generate_series(DATE '2018-05-01', DATE '2018-05-08') contains one of the forbidden week days. Maybe you should choose a simpler data model, like storing all allowed days for a product in an array (you can use a GIN index to speed up the <@ operator). Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: How can I retrieve attribute category with attribute Oid in C function?

2018-05-14 Thread Laurenz Albe
essible from FormData_pg_type. You'd have to look up atttypid in the TYPEOID cache. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: How can I retrieve attribute category with attribute Oid in Cfunction?

2018-05-14 Thread Laurenz Albe
in src/backend/replication/logical/proto.c you can find an example how to get the pg_type values from the OID. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: sql function with empty row

2018-05-16 Thread Laurenz Albe
QL standard wants it that way. NULLs and composite types is a topic that can really twist your brain. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Login with LDAP authentication takes 5 seconds

2018-05-29 Thread Laurenz Albe
planation for this, or a hint, where I could do > some further > investigation? I would run a network trace with timestamps to see where the time is spent. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Insert UUID GEN 4 Value

2018-05-30 Thread Laurenz Albe
universally unique identifiers (UUIDs) > > I am trying to find a basic and easy to understand documentation of it on how > to use > when inserting data because I have a column that is a uuid type. Are you looking for this? ALTER TABLE tab ALTER col SET DEFAULT uuid_gener

Re: Insert UUID GEN 4 Value

2018-05-30 Thread Laurenz Albe
I can use > something like this > "INSERT INTO enrollmentinfo (current_timestamp, current_timestamp, > uuid_generate_v4(), '', ''); > I haven't tried this but also not sure if I can call the function inside > INSERT. Why didn't you try it? I see no problem with that. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Query hitting empty tables taking 48 minutes

2018-06-07 Thread Laurenz Albe
s the problem, you could set m_statement.setPrepareThreshold(0); and see if that makes a difference. To test if 2. has an influence, try setting cursor_tuple_fraction to 1.0 and see if it makes a difference. You can capture the execution plan of the bad statement by using auto_explain, that would certainly shed more light on the problem. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Bad performance with cascaded deletes

2018-06-12 Thread Laurenz Albe
elete takes 0.2ms and the cascaded delete > takes 350ms. Could you share the complete plan? Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Logging

2018-06-12 Thread Laurenz Albe
; > I have tried many different logging options and combinations. That should automatically be logged as a DETAIL message. log_min_duration_statement = 0 log_min_error_statement = log or better log_min_messages = log or better That should do the trick. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: How can I retrieve double or int data type for libpq

2018-06-12 Thread Laurenz Albe
ecify a resultFormat of 1 with PQexecParams. Note, however, that they will be in the native binary format of the *server*. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Trying to understand odd trigger behavior

2018-06-14 Thread Laurenz Albe
t should be easy to run a few tests with only a single row insert that confirms your theory. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: About "Cost-based Vacuum Delay"

2018-06-15 Thread Laurenz Albe
If so, is there also any way to manually resume the paused vacuum process? These pauses are so short (20 ms by default) that you won't catch them. I suspect that you have some problem that makes you ask these questions. What is it? Or are you just curious? Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Query hitting empty tables taking 48 minutes

2018-06-18 Thread Laurenz Albe
to address this? I cannot explain the discrepancy between the runtimes of 85 seconds versus 10857 seconds. But other than that, it sure looks like the foreign keys are missing an index on the source columns, leading to a sequential scan for each deletion and table. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: About "Cost-based Vacuum Delay"

2018-06-27 Thread Laurenz Albe
ould like to find a way to pause a running vacuum during bursty > insert/update period and resume the vacuum after that period. > > Is there such a way? Please keep the list copied. You can do ALTER TABLE mytab SET (autovacuum_enabled = off); Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Analyze plan of foreign data wrapper

2018-06-28 Thread Laurenz Albe
is related to a column my foreign table. For a Var v, v->varattno contains the attribute number of the column. That is the same as the attnum column in pg_attribute. If v->varattno == 0, it is a whole-row reference, like in SELECT mytab FROM mytab; Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Analyze plan of foreign data wrapper

2018-07-03 Thread Laurenz Albe
S_SPECIAL_VARNO(varno) ((varno) >= INNER_VAR) Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: functions with side effect

2018-07-19 Thread Laurenz Albe
XPLAIN (VERBOSE) output to see if it will work in this special case, but I wouldn't depend on it in general. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: sql questions

2018-07-20 Thread Laurenz Albe
annot do it in an SQL function. In PL/pgSQL you can use GET DIAGNOSTICS avariable = ROW_COUNT; Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Restore from dumps

2018-07-25 Thread Laurenz Albe
I'm not sure why it does not work here, this seems really strange to me. I suspect that it has to do with the recent security fixes around the "public" schema. Try to ALTER the materialized view so that it refers to "public.all_days" rather than "all_days". Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Immutable function WAY slower than Stable function?

2018-08-06 Thread Laurenz Albe
lanning time: 0.354 ms > Execution time: 1315.746 ms > (5 rows) That seems to say that the _stable function is running much faster. Buth functions don't get inlined. I'd dig into the functions and find out how long the queries in them take. auto_explain is a good helper for that. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Immutable function WAY slower than Stable function?

2018-08-07 Thread Laurenz Albe
o you notice a difference if you start a new database session and run the queries several times? Is there a difference in execution time from the sixth execution on? If yes, generic plans may be part of the problem. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: How to get connection details from psql -> \e

2018-08-13 Thread Laurenz Albe
nce it could be added > to wishlist for next versions of Pg? Do you mean something like \set? test=> \set DBNAME = 'test' ENCODING = 'UTF8' HOST = '/var/run/postgresql' PORT = '5432' SERVER_VERSION_NAME = '10.5' SERVER_VERSION_NUM = '100

Re: 'Identifier' columns

2018-08-14 Thread Laurenz Albe
e'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. The best way is to use the (non-standard) RETURNING clause: INSERT ... RETURNING id; Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Odd Row Estimates in Query Plan (rows=75)

2018-08-16 Thread Laurenz Albe
ding an index on "date_gifted" would help. You may end up with two bitmap index scans that get combined. Make sure "work_mem" is big enough to avoid lossy bitmaps (indicated in the plan). About the misestimate: You could try running ANALYZE with an increased "default_statistics_target" and see if that changes the estimate. If yes, then maybe you should increase statistics for that table or (seing that you are querying current values) you should collect statistics more often. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: including header files in a C extension

2018-08-20 Thread Laurenz Albe
e .so file without error. If you can build the extension, what is your problem? Usually you use the LDFLAGS to tell "make" where to find your headers. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Linker errors while creating a PostgreSQL C extension function.

2018-08-21 Thread Laurenz Albe
d I miss something in one of my files? I think the --no-undefined is wrong. Any reference to PostgreSQL functions is undefined at build time and gets resolved when the shared library is loaded into PostgreSQL. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Hungarian collation in English Windows server

2018-08-22 Thread Laurenz Albe
#x27;t exists in English Windows server. You have to install the collation on the Windows maching, not in PostgreSQL. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Command line session and running queries

2018-08-23 Thread Laurenz Albe
vity and when you tried to cancel it. The PostgreSQL backend will only notice that the client has died when it is done processing the query and tries to send an answer to the client. If that is a regular problem for you, you could set "statement_timeout" to put an upper limit on "runaway" queries. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Is my text_pattern_ops index working for a LIKE prefix search with column reference?

2018-08-23 Thread Laurenz Albe
olumn refrence on the right side. Perhaps you can rephrase your query in such a fashion. Yours, Laurenz Albe

Re: Why my query not doing index only scan

2018-09-10 Thread Laurenz Albe
t; Planning time: 0.207 ms > Execution time: 1.358 ms > (7 rows) Try to "VACUUM (ANALYZE) inspector_tool_components", that will set the visibility mape and get the statistics right, maybe than you get an index only scan. How many rows does the table contain? Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Advice on machine specs for growth

2018-09-18 Thread Laurenz Albe
is attractive, though. I think physical machines are cool. The resulting system becomes simpler with fewer dependencies, and it is much easier to debug performance problems. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Advice on machine specs for growth

2018-09-20 Thread Laurenz Albe
pping > entirely except when not swapping would cause OOM. > Any thoughts on that? My thought is vm.swappiness = 0 If you don't overcommit memory, you should never have to swap. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Mysteriously varying index scan costs

2018-09-24 Thread Laurenz Albe
at some pages can be dirtied because table fetches that cause hint bits to be set. But how can it be that the first run has to touch 74917 blocks, while whe second run only needs to touch 1185? Thanks for any ideas! Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Mysteriously varying index scan costs

2018-09-24 Thread Laurenz Albe
Pavan Deolasee wrote: > On Mon, Sep 24, 2018 at 2:20 PM, Laurenz Albe > wrote: > > > > But how can it be that the first run has to touch 74917 blocks, > > while whe second run only needs to touch 1185? > > > > The first index scan may have killed lots of in

Re: Help to understand Actual Rows vs Plan Rows from the query planner output

2018-09-24 Thread Laurenz Albe
best resources to learn GIST, GIN indexes — something which > teaches it from the ground up? The documentation, and for what goes beyond that, the source. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Out of Memory

2018-09-26 Thread Laurenz Albe
ittle bit just to be sure. Yours, Laurenz Albe

Re: [GENERAL] Postgre compatible version with RHEL 7.5

2018-09-27 Thread Laurenz Albe
4-3.noarch.rpm yum install postgresql94-server Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Out of Memory

2018-09-27 Thread Laurenz Albe
Christoph Moench-Tegeder wrote: > ## Laurenz Albe (laurenz.a...@cybertec.at): > > > vm.overcommit_memory = 2 > > vm_overcommit_ratio = 100 > > > > Linux commits (swap * overcommit_ratio * RAM / 100), > > ^ > That

Re: Out of Memory

2018-09-27 Thread Laurenz Albe
Rob Sargent wrote: > > Christoph Moench-Tegeder wrote: > > > ## Laurenz Albe (laurenz.a...@cybertec.at): > > > > > > > vm.overcommit_memory = 2 > > > > vm_overcommit_ratio = 100 > > > >

Re: Replication Issues

2018-09-27 Thread Laurenz Albe
prevent that, create a replication slot *before* you perform pg_basebackup and use the options "-S -X stream" of pg_basebackup. You then use the same slot in "recovery.conf". That way you cannot lose any WAL. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: how to identify the timeline of specified recovery_target_time when do multiple PITR

2018-10-02 Thread Laurenz Albe
follow. The point of time exists in timeline 1, 2 and 3. In other words, should recovery use the WAL from 00010ABC0012, 00020ABC0012 or 00030ABC0012? By default, recovery will stay on the timeline where it started. If you want to go to timeline 2 or 3, you hav

Re: pg_sleep() inside plpgsql block - pro & cons

2018-10-02 Thread Laurenz Albe
ad tuples, which can lead to bloated tables and indexes if you have many concurrent data modifications. This wastes storage space and slows down sequential scans. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: We are facing "PANIC: could not read from control file:Success error while starting the database.

2018-10-04 Thread Laurenz Albe
t; > PANIC: could not read from control file:Success > > Please help me to resolve the above error. Time to restore from backup, and then upgrade to a more recent PostgreSQL version. Yours, Laurenz Albe

Re: how to identify the timeline of specified recovery_target_time when do multiple PITR

2018-10-10 Thread Laurenz Albe
havior; PostgreSQL will stay on the timeline that was active when recovery was started. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: COPY threads

2018-10-10 Thread Laurenz Albe
be, as COPY in PostgreSQL cannot be parallelized. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: how to identify the timeline of specified recovery_target_time when do multiple PITR

2018-10-10 Thread Laurenz Albe
nd examine *all* WAL segments on that timeline until that fails. But that is unreasonable because of the potential amount of time and work involved. Rather, PostgreSQL has to decide at the point where timeline 2 branches off which one it should follow. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Please let me know which configuration setting we need to modify to speedup the pg_dump backup.

2018-10-10 Thread Laurenz Albe
t faster storage so that sequential scans are faster or more memory so that more of the data resides in the filesystem cache. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: how to identify the timeline of specified recovery_target_time when do multiple PITR

2018-10-11 Thread Laurenz Albe
magodo wrote: > On Thu, 2018-10-11 at 06:35 +0200, Laurenz Albe wrote: > > magodo wrote: > > > OK... Just take another example: > > > > > > A B > > > BASE-+-+--o1 (recover to > > > A)

Re: how to identify the timeline of specified recovery_target_time when do multiple PITR

2018-10-11 Thread Laurenz Albe
elines at all. It is more typical for streaming replication. 3) nobody saw a use case for such a functionality If you really need this functionality, you'll have to write it yourself. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Is there any impact if "#wal_keep_segments = 0 " and "checkpoint_segments = 128" postgresql.conf file.

2018-10-15 Thread Laurenz Albe
ery might take longer. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Regarding varchar max length in postgres

2018-10-15 Thread Laurenz Albe
into memory when you read them from or write them to the database, you usually start having problems long before you reach that limit. If you want to store huge text files, either store them outside the database or use Large Objects, which can be read and written in chunks. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Problem creating a database

2018-10-15 Thread Laurenz Albe
_index" table is gone. Can you check if the file exists in the data directory or not? It's hard to determine what happened, but something has been eating your data. As it is, your best option would be to drop the database and recreate it from a backup. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Problem creating a database

2018-10-16 Thread Laurenz Albe
Please don't top post. Joshua White wrote: > On Mon, 15 Oct 2018 at 21:13, Laurenz Albe wrote: > > Joshua White wrote: > > > I'm hoping someone can point me in the right direction. I've got a > > > PostgreSQL 10 server > > > instance on Cen

Re: New tablespace: just an advice

2018-10-16 Thread Laurenz Albe
ers, etc)? All objects that are located in the default tablespace of the database will be moved. > 2. What will happen to who tries to access the database while it's being > moved from one tablespace to another? They will be "hanging" with a lock until the transaction is don

Re: Swap on postgres master server

2018-10-16 Thread Laurenz Albe
the only service running on that > machine. > > Is there anything we can do? > On the sync slave, the usage is just 400MB. I recommend that you set "vm.swappiness = 0" using "sysctl" to discourage the operating system from swapping as much as possible. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Enabling autovacuum per table

2018-10-16 Thread Laurenz Albe
olve your problem. Can you tell us more about the actual problem? Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Problem creating a database

2018-10-16 Thread Laurenz Albe
ent to connect to template1, it failed: > > # \connect template1 > FATAL: could not open file "base/1/2610": No such file or directory > Previous connection kept > > If template1 is corrupt, that would explain why I am unable to create new > databases. Right. I think that dumping what you can and importing it in a new cluster is the way to go. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: postgres server process crashes when using odbc_fdw

2018-10-18 Thread Laurenz Albe
st: usually, they know more about their product than the general public, and it also keeps mails off the main list that are of little interest to most people. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: pg_dump and search_path

2019-07-09 Thread Laurenz Albe
llowing object lookup along the search_path during pg_restore opens doors to abuse, because it can make a superuser inadvertedly execute code crafted by an attacker. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Issue: Creating Symlink for data directory of postgresql in CentOS7

2019-07-12 Thread Laurenz Albe
) that complains that there is nothing in /data/postgresql/data. Is that accurate? It looks like you succeeded in getting the startup process to look for the PostgreSQL data directory in the new location, but - alas - there is no data directory there yet. You could follow the instructions and run "initdb" to create the data directory. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Issue: Creating Symlink for data directory of postgresql in CentOS7

2019-07-13 Thread Laurenz Albe
of sym link. Well, where is the source for this fabled "postgresql-check-db-dir"? Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Issue: Creating Symlink for data directory of postgresql in CentOS7

2019-07-14 Thread Laurenz Albe
Adrian Klaver wrote: > On 7/13/19 4:30 AM, Laurenz Albe wrote: > > On Fri, 2019-07-12 at 18:08 +, Chatterjee, Shibayan wrote: > > > > Jul 12 10:00:51 postgresql-check-db-dir: "/data/postgresql/data" is > > > > missing or empty. > > > > J

Re: pg_advisory_lock lock FAILURE / What does those numbers mean (process 240828 waits for ExclusiveLock on advisory lock [1167570,16820923,3422556162,1];)?

2019-07-19 Thread Laurenz Albe
y64) >> 32), \ (uint32) (key64), \ 1) #define SET_LOCKTAG_INT32(tag, key1, key2) \ SET_LOCKTAG_ADVISORY(tag, MyDatabaseId, key1, key2, 2) Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Sorting composite types

2019-08-06 Thread Laurenz Albe
hat I > can simply and universally ORDER BY my_contrived_column? You'd have to define a default b-tree operator class for the type with operators that implement your desired sort order. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Postgres Database Backup Size

2019-08-12 Thread Laurenz Albe
l for a custom format dump to be bigger than the original database. How did you measure the database size? Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: How to gracefully keep my specific index in memory ?

2019-08-12 Thread Laurenz Albe
like "select idx_xyz into xxx" > and keep the specific index in memory forever? If the indexes are frequently used, they should remain cached anyway. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Changing work_mem

2019-08-14 Thread Laurenz Albe
. You should have noticed that fewer files are created when you increase "work_mem". Another thing to notice is that the temporary files use another, more compact format than the data in memory, so you need to increase "work_mem" to more than X if you want to avoid temporary files of size X. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Collumn level permissions ?

2019-08-20 Thread Laurenz Albe
column to fail with an error. If you don't like that, your technique is good, but don't forget to add "WITH (security_barrier = true)" so that nobody can subvert security. Yours, Laurenz Albe -- +43-670-6056265 Cybertec Schönig & Schönig GmbH Gröhrmühlgasse 26, A-2700 Wiener Neustadt Web: https://www.cybertec-postgresql.com

Re: Two Postgres master process are showing - one is on and off

2019-08-21 Thread Laurenz Albe
30 ?00:00:00 > /u01/postgres/9.5/bin/postgres -D /u02/pgdata01/9.5/data Perhaps it is a new client connection, and the process title just hasn't been changed (yet). What is your setting for "update_process_title"? Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

  1   2   3   4   5   6   7   8   9   10   >