Re: Parameter value from (mb/gb) to bytes

2020-11-19 Thread Raul Kaubi
Hi Thanks, you solution works for most of the databases. But now I noticed that we have single 9.5 version also. And seems like this function *pg_size_bytes* came from 9.6 # psql -U postgres -Atc "select > pg_size_bytes(current_setting('shared_buffers'));" > ERROR: function pg_size_bytes(text) d

Meaning of below statement

2020-11-19 Thread Srinivasa T N
Hi, I have the following in my log files: 2020-11-20 11:20:46.216 IST [38207] LOG: execute S_1/C_2: SELECT "gid",encode(ST_AsBinary(ST_Simplify(ST_Force2D("shape"), 14.929338247701526, true)),'base64') as "shape" FROM "ami_smart_new"."aoi_boundary" WHERE ("sectioncode" IN ('4683', '4587') AND "

Set COLLATE on a session level

2020-11-19 Thread Dirk Mika
Hello, we come from the Oracle world and we have an application that, depending on a setting, sends the command ALTER SESSION SET NLS_SORT=... when connecting to the database. Is there a similar way to set a COLLATE for a session in PostgreSQL? I know that I can specify a COLLATE for a SELECT

Re: Locking and postgres_fdw extension

2020-11-19 Thread Tom Lane
Steve Baldwin writes: > However if I want it to fail immediately if unable to obtain the lock, it > seems nowait is ignored for foreign tables (or at least with my version of > postgres_fdw). Hmm ... this seems to be intentional, per the comments in deparseLockingClause(): * For

Re: received immediate shutdown request caused cluster failover

2020-11-19 Thread Tom Lane
Yi Sun writes: > Besides command run(like pg_ctl) can cause "received immediate shutdown > request" any other reason can cause this please? That message indicates that something sent the postmaster process a SIGQUIT signal (which is all that "pg_ctl stop -m immediate" does). There's no speculati

Re: received immediate shutdown request caused cluster failover

2020-11-19 Thread Yi Sun
Hi guys, Besides command run(like pg_ctl) can cause "received immediate shutdown request" any other reason can cause this please? This production DB, support colleague said didn't run it Yi Sun 于2020年11月18日周三 上午11:54写道: > Hi all > > There are 3 nodes in our prd db in patroni cluster, vm01 is

Locking and postgres_fdw extension

2020-11-19 Thread Steve Baldwin
Hi all, I have two DB instances - 'online' and 'offline'. In 'offline' I have a foreign table 'f' imported from 'online'. I want to execute a query from 'offline' to obtain a row lock, and this works fine: select id from f where id = 1 for no key update; However if I want it to fail immediately

Re: Upgrade 9.4 to 12 on windows system

2020-11-19 Thread Asya Nevra Buyuksoy
I set my firewall to off however there is no change. I think my problem is windows user name tries to login with the wrong name instead of postgres user name. 2020-11-19 04:06:10 PST FATAL: role "WIN-EGPKV5AU75R$" does not exist (pg_log file) my user name seemed like WIN-EGPKV5AU75R\postgres Ho

Re: maintenance_work_mem

2020-11-19 Thread Philip Semanchuk
> On Nov 19, 2020, at 3:05 AM, Atul Kumar wrote: > > Hi, > > I have below queries: > > 1. How do i check the maintenance_work_mem for current session, before > setting some other value for this parameter for the same session. > > 2. and How do I set maintenance_work_mem for a session only,

Re: Upgrade 9.4 to 12 on windows system

2020-11-19 Thread Adrian Klaver
On 11/19/20 7:08 AM, Andreas Kretschmer wrote: Am 19.11.20 um 15:05 schrieb Asya Nevra Buyuksoy: connection to database failed: could not connect to server: Connection refused (0x274D/10061) Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 50432?

Re: Upgrade 9.4 to 12 on windows system

2020-11-19 Thread Andreas Kretschmer
Am 19.11.20 um 15:05 schrieb Asya Nevra Buyuksoy: connection to database failed: could not connect to server: Connection refused (0x274D/10061) Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 50432? could not connect to server: Connection refuse

Re: create type with %type or %rowtype

2020-11-19 Thread Adrian Klaver
On 11/18/20 10:04 PM, Paul Förster wrote: Hi, On 18. Nov, 2020, at 22:08, Post Gresql wrote: I might be stupid, but where in the document for create function does it say that the return type can be a table? From the doc for version 13 https://www.postgresql.org/docs/13/sql-createfunction.

Upgrade 9.4 to 12 on windows system

2020-11-19 Thread Asya Nevra Buyuksoy
Hello my friends, I want to upgrade my Postgres DBMS 9.4 to 12 on the Windows system. I follow these steps on this website. ( https://qasymphony.zendesk.com/hc/en-us/articles/115002398166-09-Upgrade-PostgreSQL-9-4-to-9-5-on-Windows ) However when everything goes ok, the same error is raising in ev

Linux package upgrade without dependency conflicts

2020-11-19 Thread Zwettler Markus (OIZ)
We run Postgres 9.6 + 12 Community Edition on RHEL7 which we install directly out of the PGDG channels using RPMs. We also run Patroni installed with RPMs provided by Github. Currently we have major dependency conflicts with each quarterly Linux package upgrade (yum upgrade), especially on Post

Re: Multiple result set to be returned in procedure/function

2020-11-19 Thread Thomas Kellerer
Daniel Verite schrieb am 19.11.2020 um 13:06: >>arthur=> select * from get_results(); >>get_results >> >> >> > > Friendlier names may be used by assigning them in the function, > i.e. plpgsql does support: > > declare > c1 refcursor := 'mycursorname'

Multiple result set not working

2020-11-19 Thread Muthukumar.GK
Hi team, is it possible to return Multiple results set from procedure/function on single execution. Please advise me on this. I have written sample code below and when i execute it i dont get any result set CREATE OR REPLACE FUNCTION multiResultset( ref1 refcursor,

Re: Multiple result set to be returned in procedure/function

2020-11-19 Thread Daniel Verite
Thomas Kellerer wrote: >arthur=> \set AUTOCOMMIT off Alternatively, start an explicit transaction block with BEGIN. The point is that the lifespan of the cursor is the transaction block in which it's instantiated. >arthur=> select * from get_results(); >get_results >

Re: Performance degradation with non-null proconfig

2020-11-19 Thread Simon Riggs
On Thu, 19 Nov 2020 at 09:10, Alastair McKinley wrote: > > Hi all, > > I recently came across a subtle performance issue when working with some > compiled UDFs to optimise a workload. > > These UDFs accidently had "set search_path = 'public'" in their definition. > When profiling with perf, I n

Re: \COPY command and indexes in tables

2020-11-19 Thread Paul Förster
Hi Jayadevan, > On 19. Nov, 2020, at 11:07, Jayadevan M wrote: > > May be you could also make sure that loading actually stopped, by checking > the size of the data directory. In another session, you could try > watch du -h -s that might be misleading if you have the pg_wal directory inside

Re: \COPY command and indexes in tables

2020-11-19 Thread Jayadevan M
> > We load large tables in some customer installation (some millions of rows) > from file with: > > TRUNCATE TABLE tableName ; > \COPY tableName FROM 'fileName' WITH ( DELIMITER '|' ) > > May be you could also make sure that loading actually stopped, by checking the size of the data direct

Performance degradation with non-null proconfig

2020-11-19 Thread Alastair McKinley
Hi all, I recently came across a subtle performance issue when working with some compiled UDFs to optimise a workload. These UDFs accidently had "set search_path = 'public'" in their definition. When profiling with perf, I noticed a large amount of elapsed time spent in the function void

Re: Multiple result set to be returned in procedure/function

2020-11-19 Thread Thomas Kellerer
Muthukumar.GK schrieb am 19.11.2020 um 09:27: > is it possible to return Multiple results set from procedure/function > on single execution. Please advise me on this. we are planning to > migrate things from sqlserver to postgresql where my existing sql > stored procs will return multiple result se

Multiple result set to be returned in procedure/function

2020-11-19 Thread Muthukumar.GK
Hi team, is it possible to return Multiple results set from procedure/function on single execution. Please advise me on this. we are planning to migrate things from sqlserver to postgresql where my existing sql stored procs will return multiple result set. so we need achieve same thing in postgres

Re: maintenance_work_mem

2020-11-19 Thread Andreas Schmitz
https://www.postgresql.org/docs/13/sql-show.html https://www.postgresql.org/docs/13/sql-set.html Regards Andreas Am 11/19/2020 um 9:05 AM schrieb Atul Kumar: > Hi, > > I have below queries: > > 1. How do i check the maintenance_work_mem for current session, before > setting some other value f

maintenance_work_mem

2020-11-19 Thread Atul Kumar
Hi, I have below queries: 1. How do i check the maintenance_work_mem for current session, before setting some other value for this parameter for the same session. 2. and How do I set maintenance_work_mem for a session only, and how will it be "rollback" once my maintainance work is done, Do I ne