[GENERAL] CREATE TABLE LIKE including all not including storage parameters?

2017-09-05 Thread Milen Blagojevic
Hi all,

I am using CREATE TABLE LIKE  for creating partitions :

Lets say this is my main table:

\d+ test_tabl
Table "public.test_tabl"
Column|Type | Modifiers | Storage  | Stats
target | Description
--+-+---+---
---+--+-
 id   | integer | not null  | plain|
   |
 test_name| character varying(10)   |   | extended |
   |
 test_value   | numeric(19,3)   |   | main |
   |
 time_created | timestamp without time zone |   | plain|
   |
Indexes:
"test_tabl_pkey" PRIMARY KEY, btree (id)
"ix_test_tabl_time_created" btree (time_created)
Child tables: test_tabl_20170905
Options: fillfactor=75


I am creating new partitions with following query:

create table test_tabl_20170906 (like test_tabl INCLUDING ALL) inherits
(test_tabl);

\d+ test_tabl_20170906
   Table "public.test_tabl_20170906"
Column|Type | Modifiers | Storage  | Stats
target | Description
--+-+---+---
---+--+-
 id   | integer | not null  | plain|
   |
 test_name| character varying(10)   |   | extended |
   |
 test_value   | numeric(19,3)   |   | main |
   |
 time_created | timestamp without time zone |   | plain|
   |
Indexes:
"test_tabl_20170906_pkey" PRIMARY KEY, btree (id)
"test_tabl_20170906_time_created_idx" btree (time_created)
Inherits: test_tabl

According to PostgreSQL documentation:
INCLUDING ALL is an abbreviated form of INCLUDING DEFAULTS INCLUDING
CONSTRAINTS INCLUDING INDEXES INCLUDING STORAGE INCLUDING COMMENTS.

But in this case child table didn't inherit filfactor (behaviour is the
same for autovacuum parameters)

Version is 9.4.13:
version


 PostgreSQL 9.4.13 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.8.5
20150623 (Red Hat 4.8.5-11), 64-bit


Am I doing something wrong here?

Thanks in advance.

Regards,
Milen Blagojevic


Re: [GENERAL] CREATE TABLE LIKE including all not including storage parameters?

2017-09-05 Thread Achilleas Mantzios

On 05/09/2017 11:56, Milen Blagojevic wrote:

Hi all,

I am using CREATE TABLE LIKE  for creating partitions :

Lets say this is my main table:

\d+ test_tabl
Table "public.test_tabl"
Column|Type | Modifiers | Storage  | Stats 
target | Description
--+-+---+--+--+-
 id   | integer | not null  | plain|
  |
 test_name| character varying(10)   |   | extended |
  |
 test_value   | numeric(19,3)   |   | main |
  |
 time_created | timestamp without time zone |   | plain|
  |
Indexes:
"test_tabl_pkey" PRIMARY KEY, btree (id)
"ix_test_tabl_time_created" btree (time_created)
Child tables: test_tabl_20170905
Options: fillfactor=75


I am creating new partitions with following query:

create table test_tabl_20170906 (like test_tabl INCLUDING ALL) inherits 
(test_tabl);

\d+ test_tabl_20170906
   Table "public.test_tabl_20170906"
Column|Type | Modifiers | Storage  | Stats 
target | Description
--+-+---+--+--+-
 id   | integer | not null  | plain|
  |
 test_name| character varying(10)   |   | extended |
  |
 test_value   | numeric(19,3)   |   | main |
  |
 time_created | timestamp without time zone |   | plain|
  |
Indexes:
"test_tabl_20170906_pkey" PRIMARY KEY, btree (id)
"test_tabl_20170906_time_created_idx" btree (time_created)
Inherits: test_tabl

According to PostgreSQL documentation:
INCLUDING ALL is an abbreviated form of INCLUDING DEFAULTS INCLUDING 
CONSTRAINTS INCLUDING INDEXES INCLUDING STORAGE INCLUDING COMMENTS.

But in this case child table didn't inherit filfactor (behaviour is the same 
for autovacuum parameters)

Version is 9.4.13:
  version

 PostgreSQL 9.4.13 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.8.5 
20150623 (Red Hat 4.8.5-11), 64-bit




Same in PostgreSQL 10beta3 on x86_64-pc-linux-gnu.
testdb=# create table dad(foo text) WITH (fillfactor=99, 
autovacuum_freeze_max_age=2000);
CREATE TABLE
testdb=# create table dadkid1 (like dad INCLUDING STORAGE);
CREATE TABLE
testdb=# \d+ dadkid1
 Table "public.dadkid1"
 Column | Type | Collation | Nullable | Default | Storage  | Stats target | 
Description
+--+---+--+-+--+--+-
 foo| text |   |  | | extended |  |




Am I doing something wrong here?

Thanks in advance.

Regards,
Milen Blagojevic



--
Achilleas Mantzios
IT DEV Lead
IT DEPT
Dynacom Tankers Mgmt



Re: [GENERAL] CREATE TABLE LIKE including all not including storage parameters?

2017-09-05 Thread Michael Paquier
On Tue, Sep 5, 2017 at 6:45 PM, Achilleas Mantzios
 wrote:
> Am I doing something wrong here?

>From the documentation:
https://www.postgresql.org/docs/devel/static/sql-createtable.html
STORAGE settings for the copied column definitions will be copied only
if INCLUDING STORAGE is specified. The default behavior is to exclude
STORAGE settings, resulting in the copied columns in the new table
having type-specific default settings. For more on STORAGE settings,
see Section 66.2.

And in this case storage parameters refer to column-specific settings,
not table-level storage parameters, which are defined here by toast:
https://www.postgresql.org/docs/devel/static/storage-toast.html
-- 
Michael


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] CREATE TABLE LIKE including all not including storage parameters?

2017-09-05 Thread Achilleas Mantzios

On 05/09/2017 13:26, Michael Paquier wrote:

On Tue, Sep 5, 2017 at 6:45 PM, Achilleas Mantzios
 wrote:

Am I doing something wrong here?

I didn't sat that :) but you are right, STORAGE settings for copied col defs != 
tables's storage parameters. The key here is that LIKE deals with columns only, 
not other parameters of the table.

 From the documentation:
https://www.postgresql.org/docs/devel/static/sql-createtable.html
STORAGE settings for the copied column definitions will be copied only
if INCLUDING STORAGE is specified. The default behavior is to exclude
STORAGE settings, resulting in the copied columns in the new table
having type-specific default settings. For more on STORAGE settings,
see Section 66.2.

And in this case storage parameters refer to column-specific settings,
not table-level storage parameters, which are defined here by toast:
https://www.postgresql.org/docs/devel/static/storage-toast.html



--
Achilleas Mantzios
IT DEV Lead
IT DEPT
Dynacom Tankers Mgmt



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Not possible to compare regrole in a view query?

2017-09-05 Thread Tom Lane
Glen Huang  writes:
> I have this simple view definition:
> CREATE TEMP VIEW user_schema AS
> SELECT nspname AS name FROM pg_namespace
> WHERE nspname = 'public' OR nspowner = ‘rolename'::regrole;

> But it fails to create the view by complaining: constant of the type 
> "regrole" cannot be used here

It's not that you can't compare it, it's that you can't store the
constant, for arcane reasons having to do with how the view's dependency
on the role name would need to be represented.

You can work around it like this:

CREATE TEMP VIEW user_schema AS
SELECT nspname AS name FROM pg_namespace
WHERE nspname = 'public' OR nspowner = 'rolename'::text::regrole;

Here, the stored constant is just a string of type text, and the lookup
in pg_authid will happen at runtime (and throw an error then, if you've
dropped the role).

regards, tom lane


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Not possible to compare regrole in a view query?

2017-09-05 Thread Glen Huang
Thank you! It works.

I’d very much like to know why this solution works. Could you please elaborate 
a bit more? I can’t quite understand what you mean by "can’t store the 
constant”. Since a view can’t store data, do you mean it can’t have a query 
that contains a constant? But isn’t 'public'  a constant too?

Also what’s the difference between ‘rolename'::regrole and 
'rolename'::text::regrole? Is it correct that in the former case, the 
conversion between the constant string and regrole happens in the sql parse 
time whereas in the latter case it happens in the run time? (Probably wrong, 
since looks like it can happen in the parse time too) Why it could work around 
the "cannot be used here” issue?

Thanks.

> On 5 Sep 2017, at 8:07 PM, Tom Lane  wrote:
> 
> Glen Huang  writes:
>> I have this simple view definition:
>> CREATE TEMP VIEW user_schema AS
>>SELECT nspname AS name FROM pg_namespace
>>WHERE nspname = 'public' OR nspowner = ‘rolename'::regrole;
> 
>> But it fails to create the view by complaining: constant of the type 
>> "regrole" cannot be used here
> 
> It's not that you can't compare it, it's that you can't store the
> constant, for arcane reasons having to do with how the view's dependency
> on the role name would need to be represented.
> 
> You can work around it like this:
> 
> CREATE TEMP VIEW user_schema AS
>SELECT nspname AS name FROM pg_namespace
>WHERE nspname = 'public' OR nspowner = 'rolename'::text::regrole;
> 
> Here, the stored constant is just a string of type text, and the lookup
> in pg_authid will happen at runtime (and throw an error then, if you've
> dropped the role).
> 
>   regards, tom lane



-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] What's the best way in postgres to use ANY() with LIKE '%'?

2017-09-05 Thread Hellmuth Vargas
Hi

can see:

https://stackoverflow.com/questions/4928054/postgresql-wildcard-like-for-any-of-a-list-of-words

2017-09-04 22:42 GMT-05:00 Ryan Murphy :

> > I'm pretty sure it doesn't work syntactically.  Don't recall the details
> offhand.
>
> Ok, thanks!
>



-- 
Cordialmente,

Ing. Hellmuth I. Vargas S.
Esp. Telemática y Negocios por Internet
Oracle Database 10g Administrator Certified Associate
EnterpriseDB Certified PostgreSQL 9.3 Associate


Re: [GENERAL] What's the best way in postgres to use ANY() with LIKE '%'?

2017-09-05 Thread Ryan Murphy
Thanks, I saw that page earlier; what I'm looking for is kind of the
opposite - instead of comparing a single value to see if it matches any of
a list of patterns, I'm trying to take a list of values and see if any of
them match a given pattern.

Best,
Ryan

On Tue, Sep 5, 2017 at 8:01 AM Hellmuth Vargas  wrote:

> Hi
>
> can see:
>
>
> https://stackoverflow.com/questions/4928054/postgresql-wildcard-like-for-any-of-a-list-of-words
>
> 2017-09-04 22:42 GMT-05:00 Ryan Murphy :
>
>> > I'm pretty sure it doesn't work syntactically.  Don't recall the
>> details offhand.
>>
>> Ok, thanks!
>>
>
>
>
> --
> Cordialmente,
>
> Ing. Hellmuth I. Vargas S.
> Esp. Telemática y Negocios por Internet
> Oracle Database 10g Administrator Certified Associate
> EnterpriseDB Certified PostgreSQL 9.3 Associate
>
>


Re: [GENERAL] What's the best way in postgres to use ANY() with LIKE '%'?

2017-09-05 Thread Thomas Kellerer
Ryan Murphy schrieb am 05.09.2017 um 16:19:
> Thanks, I saw that page earlier; what I'm looking for is kind of the
> opposite - instead of comparing a single value to see if it matches
> any of a list of patterns, I'm trying to take a list of values and
> see if any of them match a given pattern.
> 

You mean something like this?

https://stackoverflow.com/q/46047339/330315

Thomas




-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Create Action for psql when NOTIFY Recieved

2017-09-05 Thread Steve Atkins

> On Sep 4, 2017, at 10:25 PM, Nico Williams  wrote:
> 
> On Mon, Sep 4, 2017 at 4:21 PM Steve Atkins  wrote:
> > 
> 
> Me too.
> 
> https://github.com/wttw/pgsidekick
> 
> Select-based, sends periodic keep-alives to keep the connection open, outputs 
> payloads in a way that's friendly to pipe into xargs. (Also the bare bones of 
> a notify-based scheduler).
> 
> Without any kind of access controls on NOTIFY channels, nor any kind of 
> payload validation, i just don't feel comfortable using the payload at all.  
> Besides, the payload is hardly necessary given that there's a database on 
> which you can scribble the payload :)  It suffices that you receive a 
> notification, and you can then check if there's anything to do.
> 
> My version of this doesn't have connection keepalives, but that's ok because 
> that can be added in the form of notifications, and the consumer of 
> pqasyncnotifier can implement timeouts.  But i agree that timeouts and 
> keepalives would be nice, and even invoking a given SQL function would be 
> nice.
> 
> But the question i have is: how to get such functionality integrated into 
> PostgreSQL?  Is a standalone program (plus manpage plus Makefile changes) 
> enough, or would a psql \wait command be better?

There's not really any need to integrate it into postgresql at all. It doesn't 
rely on any details of the core implementation - it's just a normal SQL client, 
a pretty trivial one.

(Whether psql could usefully be reworked to listen for activity on the 
connection when it's not actively executing a query is another question).

Cheers,
  Steve

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Create Action for psql when NOTIFY Recieved

2017-09-05 Thread Nico Williams
On Tue, Sep 05, 2017 at 08:19:13AM -0700, Steve Atkins wrote:
> > On Sep 4, 2017, at 10:25 PM, Nico Williams  wrote:
> > On Mon, Sep 4, 2017 at 4:21 PM Steve Atkins  wrote:
> > > https://github.com/wttw/pgsidekick

[BTW, I must say I like pgsidekick, but for the use of the payload bit.]

> > But the question i have is: how to get such functionality integrated
> > into PostgreSQL?  Is a standalone program (plus manpage plus
> > Makefile changes) enough, or would a psql \wait command be better?
> 
> There's not really any need to integrate it into postgresql at all. It
> doesn't rely on any details of the core implementation - it's just a
> normal SQL client, a pretty trivial one.

It's a bit of an FAQ though, isn't it.  I do think it odd that PG has
this functionality on the server side and in the client-side API, but
its client-side utility functionality for it is very limited.

> (Whether psql could usefully be reworked to listen for activity on the
> connection when it's not actively executing a query is another
> question).

A \wait would simply wait for notifications from the server.  It would
be interruptible by ^C, but it would not listen for input on stdin.  I
think that should be a simple-enough patch to psql.

Nico
-- 


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] Postgresql init and cleanup module functions

2017-09-05 Thread Yan Pas
High!

I'm writing C postgresql module with some psql-functions and global state.
Do module API provide any init and cleanup functions? If yes then it would
be fine to see them in "35.9. C-Language Functions" help page."

Regards, Yan


[GENERAL] Accessiing database from inside of postgresql C function

2017-09-05 Thread Yan Pas
High!

I'm writing C postgresql module with postgresql functions and want to
access the tables from inside (SELECT mostly and maybe INSERT). Is it
possible? If yes what API can I use except classic TCP connection (not sure
if it's even legal)?

Kind Regards,
Yan


Re: [GENERAL] Accessiing database from inside of postgresql C function

2017-09-05 Thread Tom Lane
Yan Pas  writes:
> I'm writing C postgresql module with postgresql functions and want to
> access the tables from inside (SELECT mostly and maybe INSERT). Is it
> possible? If yes what API can I use except classic TCP connection (not sure
> if it's even legal)?

Recommended way is to use SPI:
https://www.postgresql.org/docs/current/static/spi.html

Aside from that documentation, there are lots of examples to study in the
core code and contrib.

regards, tom lane


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] BDR, wal segment has been removed, is it possible move forward?

2017-09-05 Thread milist ujang
Hi all,

due to space issue and high volume transaction, some wal segments removed
from pg_xlog on bdr environment.

warning log at node1 saying "requested WAL segment . has already been
removed" following Connection reset by peer.

log at node2 :
Sending replication command: START_REPLICATION SLOT
...
...
XX000: data stream ended


I had played streams and goldengate (oracle product) , that at capture side
we can move forward to certain sequence (archivedlog/redolog - wal segment
in postgres).

So, is it possible to move forward to read recent wal segment in bdr
environment? (assume data reconciliation will be done manually).


-- 
regards

ujang jaenudin | DBA Consultant (Freelancer)
http://ora62.wordpress.com
http://id.linkedin.com/pub/ujang-jaenudin/12/64/bab


Re: [GENERAL] Postgresql init and cleanup module functions

2017-09-05 Thread Andres Freund
On 2017-09-05 20:15:57 +0300, Yan Pas wrote:
> I'm writing C postgresql module with some psql-functions and global state.
> Do module API provide any init and cleanup functions? If yes then it would
> be fine to see them in "35.9. C-Language Functions" help page."

The relevant doc page is at
https://www.postgresql.org/docs/current/static/xfunc-c.html

what you're looking for is _PG_init(). There effectively is no cleanup
logic, as modules cannot be unloaded anymore.

- Andres


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] BDR, wal segment has been removed, is it possible move forward?

2017-09-05 Thread Craig Ringer
On 6 September 2017 at 01:52, milist ujang  wrote:

> Hi all,
>
> due to space issue and high volume transaction, some wal segments removed
> from pg_xlog on bdr environment.
>

What, you deleted them?


> I had played streams and goldengate (oracle product) , that at capture
> side we can move forward to certain sequence (archivedlog/redolog - wal
> segment in postgres).
>
> So, is it possible to move forward to read recent wal segment in bdr
> environment? (assume data reconciliation will be done manually).
>

BDR can, see bdr.skip_changes_upto .

But PostgreSQL's logical decoding requires a contiguous WAL stream to
maintain a valid catalog_xmin and restart_lsn, so it'll still fail to
advance. So your replication from that node is broken, and you have to part
the node then rejoin. You'll need to manually recover any diverged data.

Don't go in and randomly delete things in the postgres data directory, or
things will break.

The BDR manual warns of the importance of disk space monitoring...

-- 
 Craig Ringer   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


Re: [GENERAL] BDR, wal segment has been removed, is it possible move forward?

2017-09-05 Thread milist ujang
Hi Craig

On Wed, Sep 6, 2017 at 7:21 AM, Craig Ringer  wrote:
>
>
> BDR can, see bdr.skip_changes_upto .
>
> Unluckily my bdr is 0.9.3


> But PostgreSQL's logical decoding requires a contiguous WAL stream to
> maintain a valid catalog_xmin and restart_lsn, so it'll still fail to
> advance. So your replication from that node is broken, and you have to part
> the node then rejoin. You'll need to manually recover any diverged data.
>
> Yup, I willing to reconcile data manualy via dblink or else,
is it still possible to move wal segment in 0.9.3?

I've played these at dev env to simulate, but no luck:

# select * from pg_replication_identifier_progress;
 local_id |  external_id   | remote_lsn | local_lsn
--+++---
1 | bdr_6461744703437035137_1_34424_30406_ | 0/4288950  | 0/3007588
(1 row)

# SELECT
pg_replication_identifier_setup_replaying_from('bdr_6461744703437035137_1_34424_30406_');
 pg_replication_identifier_setup_replaying_from


(1 row)

# SELECT
pg_replication_identifier_setup_tx_origin('0/4288960','2017-09-06');
 pg_replication_identifier_setup_tx_origin
---

(1 row)

# select * from pg_replication_identifier_progress;
 local_id |  external_id   | remote_lsn | local_lsn
--+++---
1 | bdr_6461744703437035137_1_34424_30406_ | 0/4288950  | 0/3007588
(1 row)


-- 
regards

ujang jaenudin | DBA Consultant (Freelancer)
http://ora62.wordpress.com
http://id.linkedin.com/pub/ujang-jaenudin/12/64/bab


[GENERAL] Postgres logs showing error after replication

2017-09-05 Thread Vijay Chaudhery
Hi,

I am not sure if the sending email is the right way to get the forum help. 
Could you please let me know how to open forum query to ask postgres questions.

Thanks
vijay


::DISCLAIMER::


The contents of this e-mail and any attachment(s) are confidential and intended 
for the named recipient(s) only.
E-mail transmission is not guaranteed to be secure or error-free as information 
could be intercepted, corrupted,
lost, destroyed, arrive late or incomplete, or may contain viruses in 
transmission. The e mail and its contents
(with or without referred errors) shall therefore not attach any liability on 
the originator or HCL or its affiliates.
Views or opinions, if any, presented in this email are solely those of the 
author and may not necessarily reflect the
views or opinions of HCL or its affiliates. Any form of reproduction, 
dissemination, copying, disclosure, modification,
distribution and / or publication of this message without the prior written 
consent of authorized representative of
HCL is strictly prohibited. If you have received this email in error please 
delete it and notify the sender immediately.
Before opening any email and/or attachments, please check them for viruses and 
other defects.




Re: [GENERAL] Postgres logs showing error after replication

2017-09-05 Thread Tatsuo Ishii
> I am not sure if the sending email is the right way to get the forum help. 
> Could you please let me know how to open forum query to ask postgres 
> questions.

Sending email to this mailing list regarding your questions is the
perfect way to get help.

Other than this, there's an IRC channel for PostgreSQL.
https://www.postgresql.org/community/irc/

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Postgres logs showing error after replication

2017-09-05 Thread Vijay Chaudhery
Ok thank you,

I have promoted slave server as master in postgres streaming replication , 
howerver application is working fine after promotion , but getting some error 
messages in the postgres log (slave which promoted to master) 

what does it mean?


>ERROR: could not obtain lock on row in relation "main_instance"
< 2017-09-05 13:08:45.434 UTC >STATEMENT: SELECT "main_instance"."id", 
"main_instance"."uuid", "main_instance"."hostname", "main_instance"."created", 
"main_instance"."modified", "main_instance"."version", 
"main_instance"."capacity" FROM "main_instance" LIMIT 1 FOR UPDATE NOWAIT



-Original Message-
From: Tatsuo Ishii [mailto:is...@sraoss.co.jp] 
Sent: 06 September 2017 10:02 AM
To: Vijay Chaudhery 
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Postgres logs showing error after replication

> I am not sure if the sending email is the right way to get the forum help. 
> Could you please let me know how to open forum query to ask postgres 
> questions.

Sending email to this mailing list regarding your questions is the perfect way 
to get help.

Other than this, there's an IRC channel for PostgreSQL.
https://www.postgresql.org/community/irc/

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp


::DISCLAIMER::


The contents of this e-mail and any attachment(s) are confidential and intended 
for the named recipient(s) only.
E-mail transmission is not guaranteed to be secure or error-free as information 
could be intercepted, corrupted,
lost, destroyed, arrive late or incomplete, or may contain viruses in 
transmission. The e mail and its contents
(with or without referred errors) shall therefore not attach any liability on 
the originator or HCL or its affiliates.
Views or opinions, if any, presented in this email are solely those of the 
author and may not necessarily reflect the
views or opinions of HCL or its affiliates. Any form of reproduction, 
dissemination, copying, disclosure, modification,
distribution and / or publication of this message without the prior written 
consent of authorized representative of
HCL is strictly prohibited. If you have received this email in error please 
delete it and notify the sender immediately.
Before opening any email and/or attachments, please check them for viruses and 
other defects.





-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Postgres logs showing error after replication

2017-09-05 Thread Tatsuo Ishii
> Ok thank you,
> 
> I have promoted slave server as master in postgres streaming replication , 
> howerver application is working fine after promotion , but getting some error 
> messages in the postgres log (slave which promoted to master) 
> 
> what does it mean?
> 
> 
>>ERROR: could not obtain lock on row in relation "main_instance"
> < 2017-09-05 13:08:45.434 UTC >STATEMENT: SELECT "main_instance"."id", 
> "main_instance"."uuid", "main_instance"."hostname", 
> "main_instance"."created", "main_instance"."modified", 
> "main_instance"."version", "main_instance"."capacity" FROM "main_instance" 
> LIMIT 1 FOR UPDATE NOWAIT

Your session (transction) tried to get a row lock on the row but other
session (transaction) has already gotten the row lock on the same row.

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Postgres logs showing error after replication

2017-09-05 Thread Vijay Chaudhery
Ok is it possible to release the lock? or it is just a warning messages only?
thanks

-Original Message-
From: Tatsuo Ishii [mailto:is...@sraoss.co.jp] 
Sent: 06 September 2017 10:31 AM
To: Vijay Chaudhery 
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Postgres logs showing error after replication

> Ok thank you,
> 
> I have promoted slave server as master in postgres streaming 
> replication , howerver application is working fine after promotion , 
> but getting some error messages in the postgres log (slave which 
> promoted to master)
> 
> what does it mean?
> 
> 
>>ERROR: could not obtain lock on row in relation "main_instance"
> < 2017-09-05 13:08:45.434 UTC >STATEMENT: SELECT "main_instance"."id", 
> "main_instance"."uuid", "main_instance"."hostname", 
> "main_instance"."created", "main_instance"."modified", 
> "main_instance"."version", "main_instance"."capacity" FROM 
> "main_instance" LIMIT 1 FOR UPDATE NOWAIT

Your session (transction) tried to get a row lock on the row but other session 
(transaction) has already gotten the row lock on the same row.

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp


::DISCLAIMER::


The contents of this e-mail and any attachment(s) are confidential and intended 
for the named recipient(s) only.
E-mail transmission is not guaranteed to be secure or error-free as information 
could be intercepted, corrupted,
lost, destroyed, arrive late or incomplete, or may contain viruses in 
transmission. The e mail and its contents
(with or without referred errors) shall therefore not attach any liability on 
the originator or HCL or its affiliates.
Views or opinions, if any, presented in this email are solely those of the 
author and may not necessarily reflect the
views or opinions of HCL or its affiliates. Any form of reproduction, 
dissemination, copying, disclosure, modification,
distribution and / or publication of this message without the prior written 
consent of authorized representative of
HCL is strictly prohibited. If you have received this email in error please 
delete it and notify the sender immediately.
Before opening any email and/or attachments, please check them for viruses and 
other defects.





-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general