Re: WAL replay issue from 9.6.8 to 9.6.10

2018-08-29 Thread Dave Peticolas
On Wed, Aug 29, 2018 at 1:50 PM Michael Paquier wrote: > On Wed, Aug 29, 2018 at 09:15:29AM -0700, Dave Peticolas wrote: > > Oh, perhaps I do, depending on what you mean by worker. There are a > couple > > of periodic processes that connect to the server to obtain metrics. Is > that > > what is t

Re: WAL replay issue from 9.6.8 to 9.6.10

2018-08-29 Thread Michael Paquier
On Wed, Aug 29, 2018 at 09:15:29AM -0700, Dave Peticolas wrote: > Oh, perhaps I do, depending on what you mean by worker. There are a couple > of periodic processes that connect to the server to obtain metrics. Is that > what is triggering this issue? In my case I could probably suspend them > unti

Re: pg_upgrade fails saying function unaccent(text) doesn't exist

2018-08-29 Thread Bruce Momjian
On Wed, Aug 29, 2018 at 06:09:53PM +, Gunnlaugur Thor Briem wrote: > Hi, > > I'm trying to upgrade an old PG 9.4 cluster to PG 10, and it's failing on > creating an index that uses the unaccent(text) function. > > That function is part of the unaccent extension, which is installed in the old

Re: Executing a Function with an INSERT INTO command fails

2018-08-29 Thread TalGloz
> Tom's assumption is possibly correct. If the client does not have > autocommit set then you need to explicitly commit the transaction. I feel a little bit stupid , I forgot the use Work.commit(); in the function on the client side! Thanks for the help everybody! Tal -- Sent from: http://ww

pg_upgrade fails saying function unaccent(text) doesn't exist

2018-08-29 Thread Gunnlaugur Thor Briem
Hi, I'm trying to upgrade an old PG 9.4 cluster to PG 10, and it's failing on creating an index that uses the unaccent(text) function. That function is part of the unaccent extension, which is installed in the old DB cluster. I expect pg_upgrade to create that extension as part of the upgrade. It

Re: Executing a Function with an INSERT INTO command fails

2018-08-29 Thread Charles Clavadetscher
Hi > On 29.08.2018, at 19:45, TalGloz wrote: > > >> This is very strange, even if I comment all the loops in the function and >> leave only the INSERT INTO command the insert still doesn't happen. > > Now If I execute the function locally in a query window like this: > > SELECT public.seal_d

RE: Executing a Function with an INSERT INTO command fails

2018-08-29 Thread TalGloz
> This is very strange, even if I comment all the loops in the function and > leave only the INSERT INTO command the insert still doesn't happen. Now If I execute the function locally in a query window like this: SELECT public.seal_diff_benchmark_pgsql('YW55IGNhcm5hbCBwbGVhc3VyZQ==') Then the

Re: Executing a Function with an INSERT INTO command fails

2018-08-29 Thread TalGloz
Tom Lane-2 wrote > Maybe you're rolling back the transaction after leaving the function? Why would it happen and how do I stop it if it is happening. I don't seem to have anything in the code to cause it Regards Tal -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f184378

Re: Executing a Function with an INSERT INTO command fails

2018-08-29 Thread TalGloz
> I was referring specifically to: > > https://www.postgresql.org/docs/10/static/plpgsql-errors-and-messages.html#PLPGSQL-STATEMENTS-RAISE > > I was going for a conceptual communication, not syntax. > > Though if you indeed get a syntax error then that precludes the "wrong > object" theory. I

Re: Executing a Function with an INSERT INTO command fails

2018-08-29 Thread David G. Johnston
On Wed, Aug 29, 2018 at 9:47 AM, TalGloz wrote: > > > Add "RAISE ERROR" to the top function's BEGIN block and verify that the > > next time you run your calling query it indeed fails. I'm suspecting > that > > the code you are iterating over is not the same code that is being > > executed > > (s

Re: Executing a Function with an INSERT INTO command fails

2018-08-29 Thread TalGloz
> Add "RAISE ERROR" to the top function's BEGIN block and verify that the > next time you run your calling query it indeed fails. I'm suspecting that > the code you are iterating over is not the same code that is being > executed > (search_path dynamics probably). Do you mean like this BEGIN RA

Re: Executing a Function with an INSERT INTO command fails

2018-08-29 Thread David G. Johnston
On Wed, Aug 29, 2018 at 9:27 AM, TalGloz wrote: > This is very strange, even if I comment all the loops in the function and > leave only the INSERT INTO command the insert still doesn't happen. > Add "RAISE ERROR" to the top function's BEGIN block and verify that the next time you run your calli

Re: Executing a Function with an INSERT INTO command fails

2018-08-29 Thread Tom Lane
TalGloz writes: > This is very strange, even if I comment all the loops in the function and > leave only the INSERT INTO command the insert still doesn't happen. Maybe you're rolling back the transaction after leaving the function? regards, tom lane

RE: Executing a Function with an INSERT INTO command fails

2018-08-29 Thread TalGloz
This is very strange, even if I comment all the loops in the function and leave only the INSERT INTO command the insert still doesn't happen. > The sealArray creation is modified, because I don't know how the function > public.seal_diff_benchmark is defined. >> public.seal_diff_benchmark(tempVar1

Unscibscribe

2018-08-29 Thread abhishekgautam009
-- Cheers, Abhishek Gautam +91-8828400620 +91-7506260850

Re: WAL replay issue from 9.6.8 to 9.6.10

2018-08-29 Thread Dave Peticolas
On Wed, Aug 29, 2018 at 4:54 AM Michael Paquier wrote: > On Wed, Aug 29, 2018 at 08:31:50AM +0200, Alexander Kukushkin wrote: > > 2018-08-29 6:02 GMT+02:00 Dave Peticolas : > >> Hello, I'm seeing some issues with WAL replay on a test server running > >> 9.6.10 using WAL archived from a 9.6.8 prim

Re: Issue with psqlrc with command line.

2018-08-29 Thread David G. Johnston
On Wed, Aug 29, 2018 at 8:31 AM, saurabh shelar wrote: > Hi David, > > Thank you for the help. > > I was just got confused with the below line mentioned in the document. > However, it seems it is still the same behaviour *(i.e --no-psqlrc)*. > > *"Before PostgreSQL 9.6, the -c option implied -X (

Re: Issue with psqlrc with command line.

2018-08-29 Thread saurabh shelar
Hi David, Thank you for the help. I was just got confused with the below line mentioned in the document. However, it seems it is still the same behaviour *(i.e --no-psqlrc)*. *"Before PostgreSQL 9.6, the -c option implied -X (--no-psqlrc); this is no longer the case."* On Wed, Aug 29, 2018 at 8

Re: Issue with psqlrc with command line.

2018-08-29 Thread David G. Johnston
On Wednesday, August 29, 2018, saurabh shelar wrote: > Hi David, > > Thank you for the swift response. > > However, could you please confirm if the below scenario is expected. > > - included the alias in the file. > - And passed the file with psql and it worked. > > *-bash-4.2$ cat test * > *:tes

Re: Issue with psqlrc with command line.

2018-08-29 Thread saurabh shelar
Hi David, Thank you for the swift response. However, could you please confirm if the below scenario is expected. - included the alias in the file. - And passed the file with psql and it worked. *-bash-4.2$ cat test * *:testing* *-bash-4.2$ /opt/PostgreSQL/9.6/bin/psql -f test * * id * ** *

Re: Issue with psqlrc with command line.

2018-08-29 Thread David G. Johnston
On Wednesday, August 29, 2018, saurabh shelar wrote: > > As per the document from PG-9.6 it is possible. > You cannot use psql variables with -c “ command must be either a command string that is completely parsable by the server (i.e., it contains no psql-specific features), or a single backslas

Issue with psqlrc with command line.

2018-08-29 Thread saurabh shelar
Hi All, I am facing issue while executing psqlrc alias commands via. "psql -c" option. Please find below details: -bash-4.2$ cat .psqlrc \set testing 'select * from test;' postgres=# select version(); version

Re: using a plpgsql function argument as a table column.

2018-08-29 Thread Adrian Klaver
On 08/28/2018 10:40 PM, ss wrote: CREATE OR REPLACE FUNCTION test(year VARCHAR) RETURNS TABLE (agencycode INT, bureaucode INT, acctname VARCHAR, beacat VARCHAR, onoffbudget VARCHAR, val INT) AS $$ BEGIN RETURN QUERY SELECT t1.agencycode, t1.bureaucode, t1.acctcode, t2.beacat, t2.onoffbudget,

Re: Erroneous behavior of primary key

2018-08-29 Thread Daniel J Peacock
As a further update on this, we dropped the offending PKs, removed the duplicated rows using delete from where ctid in (select max(ctid) from group by having count(*) > 1), and then rebuilt the primary key. Thus far, we've seen no further corruption. We were wondering if it was a restore corru

Re: pg_sample

2018-08-29 Thread Daniel Verite
Naveen Dabas wrote: > Creating sample schema sampledb1 > DBD::Pg::db do failed: ERROR: cannot execute CREATE SCHEMA in a read-only > transaction at ./pg_sample line 296. Maybe you ran this on a hot standby? It can't work because this program needs to write data into the database, which i

Re: Erroneous behavior of primary key

2018-08-29 Thread Daniel J Peacock
Copying the list this time. On Tue, Aug 28, 2018 at 7:54 AM Daniel J Peacock wrote: > > > On Mon, Aug 27, 2018 at 7:14 PM David Rowley > wrote: > >> 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 ke

RE: Executing a Function with an INSERT INTO command fails

2018-08-29 Thread Charles Clavadetscher
Hi > -Original Message- > From: TalGloz [mailto:glozman...@gmail.com] > Sent: Mittwoch, 29. August 2018 13:22 > To: pgsql-gene...@postgresql.org > Subject: RE: Executing a Function with an INSERT INTO command fails > > Charles Clavadetscher wrote > > Do you get any error? > > The functio

Re: WAL replay issue from 9.6.8 to 9.6.10

2018-08-29 Thread Michael Paquier
On Wed, Aug 29, 2018 at 08:31:50AM +0200, Alexander Kukushkin wrote: > 2018-08-29 6:02 GMT+02:00 Dave Peticolas : >> Hello, I'm seeing some issues with WAL replay on a test server running >> 9.6.10 using WAL archived from a 9.6.8 primary server. It reliably PANICs >> during replay with messages lik

RE: Executing a Function with an INSERT INTO command fails

2018-08-29 Thread TalGloz
Charles Clavadetscher wrote > Do you get any error? The function executes perfectly and does what it's supposed to except of the INSERT INTO part. I don't get any errors. > Does the select deliver any result at all? Yes, booth SELECT deliver everything they supposed to. > If yes, is there ma

RE: Executing a Function with an INSERT INTO command fails

2018-08-29 Thread Charles Clavadetscher
Hi > -Original Message- > From: TalGloz [mailto:glozman...@gmail.com] > Sent: Mittwoch, 29. August 2018 11:12 > To: pgsql-gene...@postgresql.org > Subject: Executing a Function with an INSERT INTO command fails > > Hello, > > I have this function that executes a C extention function in i

Executing a Function with an INSERT INTO command fails

2018-08-29 Thread TalGloz
Hello, I have this function that executes a C extention function in it and returns a SETOF TEXT CREATE OR REPLACE FUNCTION seal_diff_benchmark_pgsql(sealparams CHARACTER VARYING) RETURNS SETOF TEXT AS $outputVar$ DECLARE tempVar1 CHARACTER VARYING; tempVar2 CHARACTER VARYI