Function execution is taking more than 2hrs

2018-02-06 Thread Raghavendra Rao J S V
Device id column logic has changed in my organization. Therefore, I need to
modify all the old device id values to new device id value of the tables
which contains the device id column. Old device id and  new device id
columns are mapped in “old_new_deviceids” table.



There are twenty tables which contains device id column. Therefore I need
to modify the device id’s in all those twenty tables based on
“old_new_deviceids” table . Each and every table will contains around
2Lakhs records.



I have created a dynamic procedure  using* EXECUTE FORMAT* ,which accepts
table name and column name as input parameter as below.



*CREATE OR REPLACE FUNCTION pop_endpoints_with_new_deviceid() *

RETURNS void

AS $$

DECLARE

  --tables text[] =
ARRAY['tcconfig_endpointlist','medianode','calldetailrecord','calldetailrecord','statsciscotbgcallstreamsource','statsciscotbgcallchannelsaudio','statsciscotbgcallchannelsvideo','statsciscotbgperipheral','statsciscotbgperipheralhistory','statsciscotbgcall','statsciscotpcall','statsciscotpcallstreamsource','statsciscotpperipheral','statsciscotpperipheralhistory','statsciscotpcallstreamtype','statsciscophonecallstream','monthlyendpointnoshow','monthlyendpointutilization','mtg_src_nd_prtcpnts'];

  --columns text[]=
ARRAY['element','deviceid','deviceid','destdeviceid','deviceid','deviceid','deviceid','deviceid','deviceid','deviceid','deviceid','deviceid','deviceid','deviceid','deviceid','deviceid','deviceid','deviceid','source'];

  --v_select varchar(5000);

 -- rec record;

BEGIN



  --This  funciton updates the deviceid column for all tables
which contains endpoint details  using endpoint_deviceids_barediscovery
table through pop_new_deviceid funciton



  RAISE NOTICE 'Updation of deviceid column for dependent
tables which contains endpoints related information has started';

  PERFORM insert_log('INFO' ,'pop_endpoints_with_new_deviceid'
,'Updation of deviceid column for dependent tables which contains endpoints
related information has started');



PERFORM pop_new_deviceid_for_table(‘Table_Name1','deviceid');

PERFORM pop_new_deviceid_for_table(‘Table_Name2','deviceid');

PERFORM pop_new_deviceid_for_table(‘Table_Name3','deviceid');

PERFORM pop_new_deviceid_for_table(‘Table_Name4','deviceid');

PERFORM pop_new_deviceid_for_table(‘Table_Name5','deviceid');

PERFORM pop_new_deviceid_for_table(‘Table_Name6','deviceid');

PERFORM pop_new_deviceid_for_table(‘Table_Name7','deviceid');

PERFORM pop_new_deviceid_for_table(‘Table_Name8','deviceid');

PERFORM pop_new_deviceid_for_table(‘Table_Name9','deviceid');

PERFORM pop_new_deviceid_for_table(‘Table_Name10','deviceid');

PERFORM pop_new_deviceid_for_table(‘Table_Name11','deviceid');

PERFORM pop_new_deviceid_for_table(‘Table_Name12',deviceid');

PERFORM pop_new_deviceid_for_table(‘Table_Name13','deviceid');

PERFORM pop_new_deviceid_for_table(‘Table_Name14','deviceid');

PERFORM pop_new_deviceid_for_table(‘Table_Name15','deviceid');

PERFORM pop_new_deviceid_for_table(‘Table_Name16','deviceid');

PERFORM pop_new_deviceid_for_table(‘Table_Name17','deviceid');

PERFORM pop_new_deviceid_for_table(‘Table_Name18','deviceid');

PERFORM pop_new_deviceid_for_table(‘Table_Name19','deviceid');

PERFORM pop_new_deviceid_for_table(‘Table_Name20','deviceid');



  RAISE NOTICE 'Updation of deviceid column for dependent
tables which contains endpoints related information has completed
successfully';

  PERFORM insert_log('INFO' ,'pop_endpoints_with_new_deviceid'
,'Updation of deviceid column for dependent tables which contains endpoints
related information has completed successfully');



EXCEPTION WHEN OTHERS THEN

  RAISE NOTICE 'Error occurred while executing
pop_endpoints_with_new_deviceid  % %', SQLERRM, SQLSTATE;

PERFORM insert_log('ERROR'
,'pop_endpoints_with_new_deviceid' ,'Error occurred while executing
pop_endpoints_with_new_deviceid
'||SQLSTATE||'  '||SQLERRM);

*END;*

*$$ LANGUAGE plpgsql;*





*CREATE OR REPLACE FUNCTION pop_new_deviceid_for_table(p_table
varchar,p_column varchar) *

*RETURNS void *

AS $$

DECLARE



v_select varchar(5000);

id_error_count int:=0;

rec record;



BEGIN



--This  funciton updates the deviceid column for spcified table using
endpoint_deviceids_barediscovery table after rediscovery

  v_select:='SELECT distinct t2.deviceid_old,t2.deviceid_new

  FROM  '|| p_table
||' t1,endpoint_deviceids_barediscovery t2

WHERE t1.'||p_column||'=t2.deviceid_old

  AND
t2.deviceid_new is not null';





  RAISE NOTICE 'Updation of endpoints with newdeviceid for %
started and query is %',p_table,v_select;

  PERFORM insert_log('INFO' ,'pop_new_deviceid_for_table'
,'Updation of  endpoints with newdeviceid for '||p_table||' st

PostgreSQL Active-Active

2018-02-06 Thread Dhandapani Shanmugam
Hi Gurus,

Do we have active-active setup in postgreSQL, like we have in oracle RAC?.
Sorry if this question has been addressed already. What will be best open
source HA for postgresql with zero RTO and RPO.

-D


Re: Function execution is taking more than 2hrs

2018-02-06 Thread Laurenz Albe
Raghavendra Rao J S V wrote:
> Device id column logic has changed in my organization.
> Therefore, I need to modify all the old device id values to new device id 
> value
> of the tables which contains the device id column.
> Old device id and  new device id columns are mapped in “old_new_deviceids” 
> table.
>  
> There are twenty tables which contains device id column.
> Therefore I need to modify the device id’s in all those twenty tables based 
> on “old_new_deviceids” table .
> Each and every table will contains around 2Lakhs records.

That is a sign of a bad design.  Any value that can change should only
occur once in the database.

20 rows is not a lot; you should stick with international measures
to make yourself understood.

> I have created a dynamic procedure  using EXECUTE FORMAT ,which accepts table 
> name and column name as input parameter as below.
>  
> CREATE OR REPLACE FUNCTION pop_endpoints_with_new_deviceid()
> RETURNS void
> AS $$
[...]
> PERFORM pop_new_deviceid_for_table(‘Table_Name1','deviceid');
[...]
> $$ LANGUAGE plpgsql;
>  
>  
> CREATE OR REPLACE FUNCTION pop_new_deviceid_for_table(p_table 
> varchar,p_column varchar)
> RETURNS void
> AS $$
[...]
>   v_select:='SELECT distinct t2.deviceid_old,t2.deviceid_new
>   FROM  '|| p_table 
> ||' t1,endpoint_deviceids_barediscovery t2
> WHERE t1.'||p_column||'=t2.deviceid_old
[...]
>   FOR rec IN EXECUTE v_selectLOOP
[...]
>   EXECUTE FORMAT('UPDATE %I set %I = %s where 
> %I=%s',p_table,p_column,rec.deviceid_new,p_column,rec.deviceid_old);
[...]
>   END LOOP;
[...]
> $$ LANGUAGE plpgsql;
[...]
> Sometimes “select pop_endpoints_with_new_deviceid()”  is taking just 5 minutes
> and some times more than 2hrs 25 minutes. how to narrow down the issue

The problem is clear.  Rather than changing all rows with a single UPDATE
statement, you perform one UPDATE per row.

> How to tack the time taken by each function in postgres?

You could use pg_stat_statements with pg_stat_statements.track = all
or use PL Profiler: https://bitbucket.org/openscg/plprofiler

Yours,
Laurenz Albe



Re: PostgreSQL Active-Active

2018-02-06 Thread Andreas Kretschmer



Am 06.02.2018 um 12:01 schrieb Dhandapani Shanmugam:

Hi Gurus,

Do we have active-active setup in postgreSQL, like we have in oracle 
RAC?. Sorry if this question has been addressed already. What will be 
best open source HA for postgresql with zero RTO and RPO.


-D


we have BDR, but this isn't the same as Oracle RAC. BDR is more for 
replication over long distances (around the globe), and BDR isn't a 
solution for HA.
For HA you should consider normal streaming replication and our repmgr, 
for instance. And for Backup (RTO, RPO) our Barman.


http://www.pgbarman.org/
https://blog.2ndquadrant.com/news-and-roadmap-for-bdr-multi-master-postgresql/


Regards, Andreas

--
2ndQuadrant - The PostgreSQL Support Company.
www.2ndQuadrant.com




Re: PostgreSQL Active-Active

2018-02-06 Thread Stephen Frost
Greetings,

* Dhandapani Shanmugam (postgresq...@gmail.com) wrote:
> Do we have active-active setup in postgreSQL, like we have in oracle RAC?.
> Sorry if this question has been addressed already. What will be best open
> source HA for postgresql with zero RTO and RPO.

What you're probably looking for is a 3 (or more) node setup with
patroni, etcd, and synchronous replication.  Note that this will be a
shared-nothing architecture, avoiding the risk that something bad
happens with the storage system but requiring that the data be
replicated multiple times.  Using synchronous replication means that you
have to have the nodes all close to each other, of course, but meets the
zero RPO.  Zero RTO is just silly, but with patroni and haproxy you can
detect and failover pretty darn fast.

Thanks!

Stephen


signature.asc
Description: PGP signature


Re: PostgreSQL Active-Active

2018-02-06 Thread Stephen Frost
Greetings,

* Andreas Kretschmer (andr...@a-kretschmer.de) wrote:
> Am 06.02.2018 um 12:01 schrieb Dhandapani Shanmugam:
> >Do we have active-active setup in postgreSQL, like we have in oracle RAC?.
> >Sorry if this question has been addressed already. What will be best open
> >source HA for postgresql with zero RTO and RPO.
>
> we have BDR, but this isn't the same as Oracle RAC. BDR is more for
> replication over long distances (around the globe), and BDR isn't a solution
> for HA.

BDR and logical replication are options but that's independent of the
"zero" RTO/RPO goal.  If you're looking for write-scaling, that's a
different question (note that to actually get real write-scaling, even
with Oracle RAC, you have to be prepared to make app-level changes..).

> For HA you should consider normal streaming replication and our repmgr, for
> instance. And for Backup (RTO, RPO) our Barman.

There's a number of different options both for managing streaming
replication and for backup.  As mentioned, Patroni is quite good for HA
requirements and for for backup, I'd suggest also considering
pgbackrest: http://pgbackrest.org

Thanks!

Stephen


signature.asc
Description: PGP signature


Re: Postgres install

2018-02-06 Thread Samuel Teixeira Santos
Hi to all.


I usually install Postgresql on my user to local development using the
Postgresql
Binaries 

I follow some tips from this link Installing Postgresql 9.1 to windows 7
from the binary zip distribution


You could do this installation and definitons programmatically, but you
must define a user to run postgres at end.

In my case I use my own linux account.

Always work.

Hope its helps



Samuel


Re: PostgreSQL Active-Active

2018-02-06 Thread Laurenz Albe
Dhandapani Shanmugam wrote:
> Do we have active-active setup in postgreSQL, like we have in oracle RAC?.
> Sorry if this question has been addressed already.
> What will be best open source HA for postgresql with zero RTO and RPO.

No, PostgreSQL does not have a shared storage cluster technology like RAC,
and I don't think it ever will: too complicated, does not scale well
(cache fusion, global SCN).

The normal way is to use physical replication with some third-party
cluster software that handles the failover.

There is *always* a short down time, but it shouldn't be more than a minute.
If you need to avoid data loss, use synchronous replication, but be aware
that it requires a low latency network, else your write throughput will
be very bad.

Yours,
Laurenz Albe



Re: PostgreSQL Active-Active

2018-02-06 Thread Shreeyansh Dba
You can achieve this HA with forward and backward reverse synchronous
streaming replication with 3 nodes automatic failover with pgpool in
PostgreSQL.

There is always downtime but it should not be more than a minute its
depends on your hardware and network bandwidth speed availability.

-- 
[image: http://www.shreeyansh.com] 


On Tue, Feb 6, 2018 at 4:31 PM, Dhandapani Shanmugam  wrote:

> Hi Gurus,
>
> Do we have active-active setup in postgreSQL, like we have in oracle RAC?.
> Sorry if this question has been addressed already. What will be best open
> source HA for postgresql with zero RTO and RPO.
>
> -D
>


​


Pgcrypto (PostgreSQL 10) on Debain 9?

2018-02-06 Thread Thiemo Kellner

Hi all

I use Debian Strech (9) with PostgreSQL repository (as described on  
https://wiki.postgresql.org/wiki/Apt). I would like to use pgcrypto or  
uuid-ossp but to the contrary of 9.x there is no contribution package  
for 10 so neither of the modules is installable. What did I miss?


Kind regards

Thiemo

--
Öffentlicher PGP-Schlüssel:  
http://pgp.mit.edu/pks/lookup?op=get&search=0x8F70EFD2D972CBEF



This message was sent using IMP, the Internet Messaging Program.



pgcrypto.gen_random_uuid() or uuid-ossp.uuid_generate_v4()?

2018-02-06 Thread Thiemo Kellner

Hi all

I consider using uuid as primary key type. The documentation of  
uuid-ossp states  
(https://www.postgresql.org/docs/10/static/uuid-ossp.html#idm46428633607040)  
makes a note to consider the pgcrypto function instead but not why.  
Can somebody shed some light on that matter?


Kind regards

Thiemo

--
Öffentlicher PGP-Schlüssel:  
http://pgp.mit.edu/pks/lookup?op=get&search=0x8F70EFD2D972CBEF



This message was sent using IMP, the Internet Messaging Program.



Re: Pgcrypto (PostgreSQL 10) on Debain 9?

2018-02-06 Thread Magnus Hagander
On Tue, Feb 6, 2018 at 1:37 PM, Thiemo Kellner 
wrote:

> Hi all
>
> I use Debian Strech (9) with PostgreSQL repository (as described on
> https://wiki.postgresql.org/wiki/Apt). I would like to use pgcrypto or
> uuid-ossp but to the contrary of 9.x there is no contribution package for
> 10 so neither of the modules is installable. What did I miss?
>

pgcrypto and uuid-ossp are both in the core package for PostgreSQL 10.


-- 
 Magnus Hagander
 Me: https://www.hagander.net/ 
 Work: https://www.redpill-linpro.com/ 


Re: Pgcrypto (PostgreSQL 10) on Debain 9?

2018-02-06 Thread Thiemo Kellner, NHC Barhufpflege

Zitat von Magnus Hagander :


On Tue, Feb 6, 2018 at 1:37 PM, Thiemo Kellner 
wrote:

pgcrypto and uuid-ossp are both in the core package for PostgreSQL 10.


So, I take the documentation would be outdated?

But why do I get following error?
ERROR: function gen_random_uuid() does not exist.
create table ENTITY (ID uuid not null default gen_random_uuid());


--
+49 (0)1578-772 37 37
+41 (0)78 947 36 21
Öffentlicher PGP-Schlüssel:  
http://pgp.mit.edu/pks/lookup?op=get&search=0x8F70EFD2D972CBEF



This message was sent using IMP, the Internet Messaging Program.



Re: pgcrypto.gen_random_uuid() or uuid-ossp.uuid_generate_v4()?

2018-02-06 Thread Adam Brusselback
In my testing, gen_random_uuid() is quite a bit faster than uuid_generate_v4().



Re: pgcrypto.gen_random_uuid() or uuid-ossp.uuid_generate_v4()?

2018-02-06 Thread Thiemo Kellner, NHC Barhufpflege
In my testing, gen_random_uuid() is quite a bit faster than  
uuid_generate_v4().


Thx for sharing your experience.


--
Öffentlicher PGP-Schlüssel:  
http://pgp.mit.edu/pks/lookup?op=get&search=0x8F70EFD2D972CBEF



This message was sent using IMP, the Internet Messaging Program.



Re: pgcrypto.gen_random_uuid() or uuid-ossp.uuid_generate_v4()?

2018-02-06 Thread Tom Lane
Thiemo Kellner  writes:
> I consider using uuid as primary key type. The documentation of  
> uuid-ossp states  
> (https://www.postgresql.org/docs/10/static/uuid-ossp.html#idm46428633607040)  
> makes a note to consider the pgcrypto function instead but not why.  
> Can somebody shed some light on that matter?

I believe the point of the recommendation is that if you only need type-4
UUIDs, you can get that from pgcrypto without needing the external
dependency of the OSSP UUID library.  This is a bit less urgent than when
that text was written, because now we also support building that contrib
module against some other implementations; but there are still going to
be systems on which installing uuid-ossp is inconvenient.

There may also be a belief that pgcrypto's result is more
cryptographically secure, though I wouldn't swear to that.

regards, tom lane



Re: pgcrypto.gen_random_uuid() or uuid-ossp.uuid_generate_v4()?

2018-02-06 Thread Thiemo Kellner, NHC Barhufpflege

Zitat von Tom Lane :


I believe the point of the recommendation is that if you only need type-4
UUIDs, you can get that from pgcrypto without needing the external
dependency of the OSSP UUID library.  This is a bit less urgent than when
that text was written, because now we also support building that contrib
module against some other implementations; but there are still going to
be systems on which installing uuid-ossp is inconvenient.

There may also be a belief that pgcrypto's result is more
cryptographically secure, though I wouldn't swear to that.


Thanks for the light :-)

Kind regards Thiemo


--
Öffentlicher PGP-Schlüssel:  
http://pgp.mit.edu/pks/lookup?op=get&search=0x8F70EFD2D972CBEF



This message was sent using IMP, the Internet Messaging Program.



Re: Regex Replace with 2 conditions

2018-02-06 Thread George Neuner
On Mon, 5 Feb 2018 18:22:02 +0100, Francisco Olarte
 wrote:


>I repeat for the last time. YOU ARE NOT USING ASCII. ASCII IS A SEVEN
>BIT CODE, 0-128. "?" IS NOT IN THE ASCII CHARACTER SET.

What ASCII table are you reading?  The question mark symbol is #63. It
lies between the numbers and the capital letter set.

George




Re: Regex Replace with 2 conditions

2018-02-06 Thread David G. Johnston
On Tue, Feb 6, 2018 at 8:46 AM, George Neuner  wrote:

> On Mon, 5 Feb 2018 18:22:02 +0100, Francisco Olarte
>  wrote:
>
>
> >I repeat for the last time. YOU ARE NOT USING ASCII. ASCII IS A SEVEN
> >BIT CODE, 0-128. "?" IS NOT IN THE ASCII CHARACTER SET.
>
> What ASCII table are you reading?  The question mark symbol is #63. It
> lies between the numbers and the capital letter set.
>
>
​Your mail client mangled that sentence - the "?" you are seeing is a
placeholder for the non-ASCII character "'a' with a bowl on top of it"​...

David J.


Re: Pgcrypto (PostgreSQL 10) on Debain 9?

2018-02-06 Thread Raymond O'Donnell

On 06/02/18 13:25, Thiemo Kellner, NHC Barhufpflege wrote:

Zitat von Magnus Hagander :

On Tue, Feb 6, 2018 at 1:37 PM, Thiemo Kellner 


wrote:

pgcrypto and uuid-ossp are both in the core package for PostgreSQL 10.


So, I take the documentation would be outdated?

But why do I get following error?
ERROR: function gen_random_uuid() does not exist.
create table ENTITY (ID uuid not null default gen_random_uuid());


Only a guess, but maybe you need to install the extension first? -

   create extension ;

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
r...@iol.ie



Re: Regex Replace with 2 conditions

2018-02-06 Thread George Neuner


On 2/6/2018 10:52 AM, David G. Johnston wrote:
On Tue, Feb 6, 2018 at 8:46 AM, George Neuner >wrote:


On Mon, 5 Feb 2018 18:22:02 +0100, Francisco Olarte
mailto:fola...@peoplecall.com>> wrote:


>I repeat for the last time. YOU ARE NOT USING ASCII. ASCII IS A SEVEN
>BIT CODE, 0-128. "?" IS NOT IN THE ASCII CHARACTER SET.

What ASCII table are you reading?  The question mark symbol is #63. It
lies between the numbers and the capital letter set.


​Your mail client mangled that sentence - the "?" you are seeing is a 
placeholder for the non-ASCII character "'a' with a bowl on top of it"​...


Thanks David.   Apologies to everyone for the noise.

George



Re: Found non-empty schema without metadata table error while migrating

2018-02-06 Thread Adrian Klaver

On 02/05/2018 10:52 PM, Abhra Kar wrote:

Hi,

Getting below error—


exec] Flyway (Command-line Tool) v.1.1

[exec]

[exec] Metadata table created: schema_version

[exec] Schema initialized with version: 0

[exec] Flyway (Command-line Tool) v.1.1

[exec]

[exec] ValidationException: Found non-empty schema without metadata 
table! Use init() first to initialise the metadata table.


Did you do the above?

The below seems to be a question for the Flyway folks. They don't seem 
to have a mailing list, they do point at a SO page:


https://stackoverflow.com/questions/tagged/flyway




It stuck when going to execute below configuration in ant build.xml for 
migrate db(populate tables into schema abc)—





















failonerror="true">

















abc schema is created properly registered with abc user.


 didn’t solve the problem


What need to be change here.






Thanks






--
Adrian Klaver
adrian.kla...@aklaver.com



Re: Regex Replace with 2 conditions

2018-02-06 Thread Francisco Olarte
George:

On Tue, Feb 6, 2018 at 4:46 PM, George Neuner  wrote:
> On Mon, 5 Feb 2018 18:22:02 +0100, Francisco Olarte
>  wrote:
>>I repeat for the last time. YOU ARE NOT USING ASCII. ASCII IS A SEVEN
>>BIT CODE, 0-128. "?" IS NOT IN THE ASCII CHARACTER SET.

I made a typo there, 0..127, not 128 ( or [0,128)  ;-) )

> What ASCII table are you reading?  The question mark symbol is #63. It
> lies between the numbers and the capital letter set.

I'm not reading any ascii table, and I did NOT send a question mark.
IIRC I copied an a with something looking like an inverted circumflex
above. I was using gmail in ubuntu in firefox, wihich I think works in
unicode and sends mail in UTF-8, AAMOF I've looked at it and I see:

>>>
From: Francisco Olarte 
To: Denisa Cirstescu 
Cc: Tom Lane , "pgsql-gene...@postgresql.org"

Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<<<

and a little below:

>>>
I repeat for the last time. YOU ARE NOT USING ASCII. ASCII IS A SEVEN
BIT CODE, 0-128. "=C4=83" IS NOT IN THE ASCII CHARACTER SET.
<<<

So, no question mark sent, I suspect your mail chain may be playing
tricks on you, or may be you are translating to 7 bits on purpose
since your mail came with the headers:

>>>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
<<<

I'll suggest you fix that before participating in threads with unicode
content. Also, many programs use ? as a placeholder for something not
in its charset, so always suspect you are not seeing the right char
when you encounter one of this things.

Francisco Olarte.



Re: Regex Replace with 2 conditions

2018-02-06 Thread George Neuner
On Tue, 6 Feb 2018 17:57:33 +0100, Francisco Olarte
 wrote:

>So, no question mark sent, I suspect your mail chain may be playing
>tricks on you, or may be you are translating to 7 bits on purpose
>since your mail came with the headers:
>

>Content-Type: text/plain; charset=us-ascii
>Content-Transfer-Encoding: 7bit
><<<
>
>I'll suggest you fix that before participating in threads with unicode
>content. Also, many programs use ? as a placeholder for something not
>in its charset, so always suspect you are not seeing the right char
>when you encounter one of this things.

Usually I do see unicode characters correctly.

My news client defaults to *sending* in ISO-8859-1 (US acsii), but it
displays incoming messages in UTF-8, and in HTML if applicable ... so
I'm not sure why I'm not seeing whatever it was that you actually
typed.  It does keep coming through as a question mark in all the
responses.

I read this group through the Gmane mail->news reflector ... maybe
that has something to do with it?

George




pgadmin4: not possible to create server

2018-02-06 Thread robert rottermann

Hi there,

I have installed pgadmin4 locally using its docker image.

this i did running the following command:

docker run -p 80:80 -e "PGADMIN_DEFAULT_EMAIL=admin" -e 
"PGADMIN_DEFAULT_PASSWORD=admin" -d dpage/pgadmin4


I then could access it and log into it.

However all my attempts end in:

Unable to connect to server:

could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?


can anybody give me a hint, what to do?

thanks

robert


in /etc/postgresql/10/main/postgresql.conf

i have:

#--
# CONNECTIONS AND AUTHENTICATION
#--

# - Connection Settings -

listen_addresses = '*'  # what IP address(es) to listen on;
    # comma-separated list of 
addresses;



and this is my /etc/postgresql/10/main/pg_hba.conf

# DO NOT DISABLE!
# If you change this first entry you will need to make sure that the
# database superuser can access the database using some other method.
# Noninteractive access to all databases is required during automatic
# maintenance (custom daily cronjobs, replication, and similar tasks).
#
# Database administrative login by Unix domain socket
local   all postgres peer

# TYPE  DATABASE    USER    ADDRESS METHOD

# "local" is for Unix domain socket connections only
local   all all trust
# IPv4 local connections:
host    all all 127.0.0.1/32 trust
# IPv6 local connections:
host    all all ::1/128 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
local   replication all peer
host    replication all 127.0.0.1/32 md5
host    replication all ::1/128 md5






Re: pgadmin4: not possible to create server

2018-02-06 Thread Adrian Klaver

On 02/06/2018 09:24 AM, robert rottermann wrote:

Hi there,

I have installed pgadmin4 locally using its docker image.

this i did running the following command:

docker run -p 80:80 -e "PGADMIN_DEFAULT_EMAIL=admin" -e 
"PGADMIN_DEFAULT_PASSWORD=admin" -d dpage/pgadmin4


I then could access it and log into it.

However all my attempts end in:

Unable to connect to server:

could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?


So where is the Postgres server located?




can anybody give me a hint, what to do?

thanks

robert


in /etc/postgresql/10/main/postgresql.conf

i have:

#-- 


# CONNECTIONS AND AUTHENTICATION
#-- 



# - Connection Settings -

listen_addresses = '*'  # what IP address(es) to listen on;
     # comma-separated list of 
addresses;



and this is my /etc/postgresql/10/main/pg_hba.conf

# DO NOT DISABLE!
# If you change this first entry you will need to make sure that the
# database superuser can access the database using some other method.
# Noninteractive access to all databases is required during automatic
# maintenance (custom daily cronjobs, replication, and similar tasks).
#
# Database administrative login by Unix domain socket
local   all postgres peer

# TYPE  DATABASE    USER    ADDRESS METHOD

# "local" is for Unix domain socket connections only
local   all all trust
# IPv4 local connections:
host    all all 127.0.0.1/32 trust
# IPv6 local connections:
host    all all ::1/128 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
local   replication all peer
host    replication all 127.0.0.1/32 md5
host    replication all ::1/128 md5







--
Adrian Klaver
adrian.kla...@aklaver.com



Re: pgadmin4: not possible to create server

2018-02-06 Thread Murtuza Zabuawala
Add following in your pg_hba.conf,

hostall all 0.0.0.0/ 0 md5

restart your Postgres database server and try to connect again from
pgAdmin4.

On Tue, Feb 6, 2018 at 10:54 PM, robert rottermann  wrote:

> Hi there,
>
> I have installed pgadmin4 locally using its docker image.
>
> this i did running the following command:
>
> docker run -p 80:80 -e "PGADMIN_DEFAULT_EMAIL=admin" -e
> "PGADMIN_DEFAULT_PASSWORD=admin" -d dpage/pgadmin4
>
> I then could access it and log into it.
>
> However all my attempts end in:
>
> Unable to connect to server:
>
> could not connect to server: Connection refused
> Is the server running on host "localhost" (::1) and accepting
> TCP/IP connections on port 5432?
> could not connect to server: Connection refused
> Is the server running on host "localhost" (127.0.0.1) and accepting
> TCP/IP connections on port 5432?
>
>
> can anybody give me a hint, what to do?
>
> thanks
>
> robert
>
>
> in /etc/postgresql/10/main/postgresql.conf
>
> i have:
>
> #---
> ---
> # CONNECTIONS AND AUTHENTICATION
> #---
> ---
>
> # - Connection Settings -
>
> listen_addresses = '*'  # what IP address(es) to listen on;
> # comma-separated list of
> addresses;
>
>
> and this is my /etc/postgresql/10/main/pg_hba.conf
>
> # DO NOT DISABLE!
> # If you change this first entry you will need to make sure that the
> # database superuser can access the database using some other method.
> # Noninteractive access to all databases is required during automatic
> # maintenance (custom daily cronjobs, replication, and similar tasks).
> #
> # Database administrative login by Unix domain socket
> local   all postgres peer
>
> # TYPE  DATABASEUSERADDRESS METHOD
>
> # "local" is for Unix domain socket connections only
> local   all all trust
> # IPv4 local connections:
> hostall all 127.0.0.1/32 trust
> # IPv6 local connections:
> hostall all ::1/128 trust
> # Allow replication connections from localhost, by a user with the
> # replication privilege.
> local   replication all peer
> hostreplication all 127.0.0.1/32 md5
> hostreplication all ::1/128 md5
>
>
>
>
>


Re: pgadmin4: not possible to create server

2018-02-06 Thread robert

thanks

unfortunately id did not help
On 06.02.2018 18:29, Murtuza Zabuawala wrote:

Add following in your pg_hba.conf,

host all all             0.0.0.0/ 0md5

restart your Postgres database server and try to connect again from 
pgAdmin4.

from pgadmin3 I can connect

any more ideas?
robert
On Tue, Feb 6, 2018 at 10:54 PM, robert rottermann >wrote:


Hi there,

I have installed pgadmin4 locally using its docker image.

this i did running the following command:

docker run -p 80:80 -e "PGADMIN_DEFAULT_EMAIL=admin" -e
"PGADMIN_DEFAULT_PASSWORD=admin" -d dpage/pgadmin4

I then could access it and log into it.

However all my attempts end in:

Unable to connect to server:

could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?


can anybody give me a hint, what to do?

thanks

robert


in /etc/postgresql/10/main/postgresql.conf

i have:


#--
# CONNECTIONS AND AUTHENTICATION

#--

# - Connection Settings -

listen_addresses = '*'  # what IP address(es) to listen on;
  # comma-separated list of addresses;


and this is my /etc/postgresql/10/main/pg_hba.conf

# DO NOT DISABLE!
# If you change this first entry you will need to make sure that the
# database superuser can access the database using some other method.
# Noninteractive access to all databases is required during automatic
# maintenance (custom daily cronjobs, replication, and similar tasks).
#
# Database administrative login by Unix domain socket
local   all postgres peer

# TYPE  DATABASE    USER    ADDRESS METHOD

# "local" is for Unix domain socket connections only
local   all all trust
# IPv4 local connections:
host    all all 127.0.0.1/32  trust
# IPv6 local connections:
host    all all ::1/128 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
local   replication all peer
host    replication all 127.0.0.1/32  md5
host    replication all ::1/128 md5









Re: pgadmin4: not possible to create server

2018-02-06 Thread robert



On 06.02.2018 18:28, Adrian Klaver wrote:

On 02/06/2018 09:24 AM, robert rottermann wrote:

Hi there,

I have installed pgadmin4 locally using its docker image.

this i did running the following command:

docker run -p 80:80 -e "PGADMIN_DEFAULT_EMAIL=admin" -e 
"PGADMIN_DEFAULT_PASSWORD=admin" -d dpage/pgadmin4


I then could access it and log into it.

However all my attempts end in:

Unable to connect to server:

could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?


So where is the Postgres server located?

on my local desktop
robert



Re: pgadmin4: not possible to create server

2018-02-06 Thread Adrian Klaver

On 02/06/2018 02:08 PM, robert wrote:



On 06.02.2018 18:28, Adrian Klaver wrote:

On 02/06/2018 09:24 AM, robert rottermann wrote:

Hi there,

I have installed pgadmin4 locally using its docker image.

this i did running the following command:

docker run -p 80:80 -e "PGADMIN_DEFAULT_EMAIL=admin" -e 
"PGADMIN_DEFAULT_PASSWORD=admin" -d dpage/pgadmin4


I then could access it and log into it.

However all my attempts end in:

Unable to connect to server:

could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?


So where is the Postgres server located?

on my local desktop


So you pgAdmin4 running in a container on your local machine and 
Postgres running in the native OS(the OS is?) on your local machine. Is 
the Docker container set up to 'see' the local machine?



robert




--
Adrian Klaver
adrian.kla...@aklaver.com



Re: pgadmin4: not possible to create server

2018-02-06 Thread robert



On 06.02.2018 23:12, Adrian Klaver wrote:

On 02/06/2018 02:08 PM, robert wrote:



On 06.02.2018 18:28, Adrian Klaver wrote:

On 02/06/2018 09:24 AM, robert rottermann wrote:

Hi there,

I have installed pgadmin4 locally using its docker image.

this i did running the following command:

docker run -p 80:80 -e "PGADMIN_DEFAULT_EMAIL=admin" -e 
"PGADMIN_DEFAULT_PASSWORD=admin" -d dpage/pgadmin4


I then could access it and log into it.

However all my attempts end in:

Unable to connect to server:

could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?


So where is the Postgres server located?

on my local desktop


So you pgAdmin4 running in a container on your local machine and 
Postgres running in the native OS(the OS is?) on your local machine. 
Is the Docker container set up to 'see' the local machine?




Re: pgadmin4: not possible to create server

2018-02-06 Thread robert



On 06.02.2018 23:12, Adrian Klaver wrote:

On 02/06/2018 02:08 PM, robert wrote:



On 06.02.2018 18:28, Adrian Klaver wrote:

On 02/06/2018 09:24 AM, robert rottermann wrote:

Hi there,

I have installed pgadmin4 locally using its docker image.

this i did running the following command:

docker run -p 80:80 -e "PGADMIN_DEFAULT_EMAIL=admin" -e 
"PGADMIN_DEFAULT_PASSWORD=admin" -d dpage/pgadmin4


I then could access it and log into it.

However all my attempts end in:

Unable to connect to server:

could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?


So where is the Postgres server located?

on my local desktop


So you pgAdmin4 running in a container on your local machine and 
Postgres running in the native OS(the OS is?) on your local machine. 
Is the Docker container set up to 'see' the local machine?


what do you mean by see?




Re: pgadmin4: not possible to create server

2018-02-06 Thread Adrian Klaver

On 02/06/2018 02:19 PM, robert wrote:



On 06.02.2018 23:12, Adrian Klaver wrote:

On 02/06/2018 02:08 PM, robert wrote:



On 06.02.2018 18:28, Adrian Klaver wrote:

On 02/06/2018 09:24 AM, robert rottermann wrote:

Hi there,

I have installed pgadmin4 locally using its docker image.

this i did running the following command:

docker run -p 80:80 -e "PGADMIN_DEFAULT_EMAIL=admin" -e 
"PGADMIN_DEFAULT_PASSWORD=admin" -d dpage/pgadmin4


I then could access it and log into it.

However all my attempts end in:

Unable to connect to server:

could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?


So where is the Postgres server located?

on my local desktop


So you pgAdmin4 running in a container on your local machine and 
Postgres running in the native OS(the OS is?) on your local machine. 
Is the Docker container set up to 'see' the local machine?


what do you mean by see?


For fuller explanation see:

https://stackoverflow.com/questions/24319662/from-inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach






--
Adrian Klaver
adrian.kla...@aklaver.com



Re: pgadmin4: not possible to create server

2018-02-06 Thread Adrian Klaver

On 02/06/2018 02:19 PM, robert wrote:




So you pgAdmin4 running in a container on your local machine and 
Postgres running in the native OS(the OS is?) on your local machine. 
Is the Docker container set up to 'see' the local machine?


what do you mean by see?



Meant to ask earlier, why you are using the Docker image instead of one 
of the binaries listed here:


https://www.pgadmin.org/download/


--
Adrian Klaver
adrian.kla...@aklaver.com



solution: Re: pgadmin4: not possible to create server

2018-02-06 Thread robert

Adrian


So you pgAdmin4 running in a container on your local machine and 
Postgres running in the native OS(the OS is?) on your local machine. 
Is the Docker container set up to 'see' the local machine?


what do you mean by see?


For fuller explanation see:

https://stackoverflow.com/questions/24319662/from-inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach 




your hint pointed in the right direction:
it is not localhost, on which the server is running, because localhost 
is relative to the container, so it is in effect the container itself.

Postgres is running on the gatway of the containers network.
This I found out by issuing:
docker inspect reverent_volhard (where reverent_volhard is the 
containers name in which pgadmin4 runs)

this providest:
...
  "Networks": {
    "bridge": {
    "IPAMConfig": null,
    "Links": null,
    "Aliases": null,
    "NetworkID": 
"df33249ff65c37ea1ca1f142b4a74283c4429c44c3ed1eb5ea80c695c87ab86d",
    "EndpointID": 
"905c0c78145ef1847854f221200d8e4a7788f99b901030460111258ab9156b29",

    "Gateway": "172.17.0.1",
    "IPAddress": "172.17.0.2",
    "IPPrefixLen": 16,
    "IPv6Gateway": "",
    "GlobalIPv6Address": "",
    "GlobalIPv6PrefixLen": 0,
    "MacAddress": "02:42:ac:11:00:02",
    "DriverOpts": null
    }

so postgres runs on 172.17.0.1

and bingo, it works

thanks again
robert



Re: pgadmin4: not possible to create server

2018-02-06 Thread robert



On 06.02.2018 23:33, Adrian Klaver wrote:

On 02/06/2018 02:19 PM, robert wrote:




So you pgAdmin4 running in a container on your local machine and 
Postgres running in the native OS(the OS is?) on your local machine. 
Is the Docker container set up to 'see' the local machine?


what do you mean by see?



Meant to ask earlier, why you are using the Docker image instead of 
one of the binaries listed here:


https://www.pgadmin.org/download/

i tried to install pgadmin4 some 10 months ago and found it confusing 
with the server and desktop mode




Re: pgadmin4: not possible to create server

2018-02-06 Thread Adrian Klaver

On 02/06/2018 03:11 PM, robert wrote:



On 06.02.2018 23:33, Adrian Klaver wrote:

On 02/06/2018 02:19 PM, robert wrote:




So you pgAdmin4 running in a container on your local machine and 
Postgres running in the native OS(the OS is?) on your local machine. 
Is the Docker container set up to 'see' the local machine?


what do you mean by see?



Meant to ask earlier, why you are using the Docker image instead of 
one of the binaries listed here:


https://www.pgadmin.org/download/

i tried to install pgadmin4 some 10 months ago and found it confusing 
with the server and desktop mode


When I was kicking the tires on pgAdmin4 I found the easiest way to use 
it was to install the Python wheel into a Python virtual environment:


https://www.pgadmin.org/download/pgadmin-4-python-wheel/

I have not played with for a while though as a find psql is the better 
interface.



--
Adrian Klaver
adrian.kla...@aklaver.com



Re: Alter table set logged hanging after writing out all WAL

2018-02-06 Thread Michael Paquier
On Tue, Feb 06, 2018 at 01:36:04AM -0600, Jeremy Finzel wrote:
> Here is the basic structure - is the gist index significant?:
> 
> CREATE UNLOGGED TABLE foo (
> as_of_date daterange NOT NULL,
> customer_id integer,
> bunch_of_fields_here);
> 
> ALTER TABLE ONLY foo
> ADD CONSTRAINT foo_as_of_date_excl EXCLUDE USING gist (customer_id WITH
> =, as_of_date WITH &&);
> 
> CREATE UNIQUE INDEX foo_idx1 ON foo USING btree (customer_id) WHERE
> (upper(as_of_date) = 'infinity'::date);
> 
> CREATE INDEX foo_idx2 ON foo USING btree (customer_id, lower(as_of_date))
> WHERE (upper(as_of_date) = 'infinity'::date);
> 
> CREATE UNIQUE INDEX foo_idx3 ON foo USING btree (customer_id,
> lower(as_of_date));

I am not sure, but I would think about something related to gist here
when heavy insertions are done on it...  I cannot put my finger on the
thread though.

> This is all I see - please help me if there's a better command I can
> run:

If the process is still running, can you attach gdb to it and then run
the command bt? You may need to install debugging symbols to make the
trace readable.
--
Michael


signature.asc
Description: PGP signature


Fwd: postgres instalation

2018-02-06 Thread Azimuddin Mohammed
Hello,
I have installed postgres I saw the message postgres installation complete.
But when I look in the install directory I only see
bin
lib
include
share

I do not see man and docs, may I know how I can install the man and docs
and what is the use of it?

-- 

Regards,
Azim




-- 

Regards,
Azim



Virus-free.
www.avast.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>


Re: Fwd: postgres instalation

2018-02-06 Thread Adrian Klaver

On 02/06/2018 06:05 PM, Azimuddin Mohammed wrote:


Hello,
I have installed postgres I saw the message postgres installation 
complete. But when I look in the install directory I only see

bin
lib
include
share

I do not see man and docs, may I know how I can install the man and 
docs  and what is the use of it?


How did you install, from source or via packages?

If from source:

https://www.postgresql.org/docs/10/static/install-procedure.html

"If you want to build everything that can be built, including the 
documentation (HTML and man pages), and the additional modules 
(contrib), type instead:


make world





--

Regards,
Azim




--

Regards,
Azim


 
	Virus-free. www.avast.com 
 



<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>



--
Adrian Klaver
adrian.kla...@aklaver.com



Re: Fwd: postgres instalation

2018-02-06 Thread Azimuddin Mohammed
I built it from source code.
It says contib is installed too. But i dont see thrm under the prefix
directory.

On Feb 6, 2018 9:17 PM, "Adrian Klaver"  wrote:

> On 02/06/2018 06:05 PM, Azimuddin Mohammed wrote:
>
>>
>> Hello,
>> I have installed postgres I saw the message postgres installation
>> complete. But when I look in the install directory I only see
>> bin
>> lib
>> include
>> share
>>
>> I do not see man and docs, may I know how I can install the man and docs
>> and what is the use of it?
>>
>
> How did you install, from source or via packages?
>
> If from source:
>
> https://www.postgresql.org/docs/10/static/install-procedure.html
>
> "If you want to build everything that can be built, including the
> documentation (HTML and man pages), and the additional modules (contrib),
> type instead:
>
> make world
>
>
>
>
>> --
>>
>> Regards,
>> Azim
>>
>>
>>
>>
>> --
>>
>> Regards,
>> Azim
>>
>>
>> > =link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon>
>>  Virus-free. www.avast.com > il?utm_medium=email&utm_source=link&utm_campaign=sig-email&
>> utm_content=webmail&utm_term=link>
>>
>> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>>
>
>
> --
> Adrian Klaver
> adrian.kla...@aklaver.com
>


Re: Fwd: postgres instalation

2018-02-06 Thread Adrian Klaver

On 02/06/2018 07:32 PM, Azimuddin Mohammed wrote:

I built it from source code.
It says contib is installed too. But i dont see thrm under the prefix 
directory.


When you did the original build did you do make world or just make?

See also:

https://www.postgresql.org/docs/10/static/install-procedure.html
"
Installing the Files
Note

If you are upgrading an existing system be sure to read Section 18.6 
which has instructions about upgrading a cluster.


To install PostgreSQL enter:

make install

This will install files into the directories that were specified in Step 
1. Make sure that you have appropriate permissions to write into that 
area. Normally you need to do this step as root. Alternatively, you can 
create the target directories in advance and arrange for appropriate 
permissions to be granted.


To install the documentation (HTML and man pages), enter:

make install-docs

If you built the world above, type instead:

make install-world

This also installs the documentation.
"




On Feb 6, 2018 9:17 PM, "Adrian Klaver" > wrote:


On 02/06/2018 06:05 PM, Azimuddin Mohammed wrote:


Hello,
I have installed postgres I saw the message postgres
installation complete. But when I look in the install directory
I only see
bin
lib
include
share

I do not see man and docs, may I know how I can install the man
and docs  and what is the use of it?


How did you install, from source or via packages?

If from source:

https://www.postgresql.org/docs/10/static/install-procedure.html


"If you want to build everything that can be built, including the
documentation (HTML and man pages), and the additional modules
(contrib), type instead:

make world




-- 


Regards,
Azim




-- 


Regards,
Azim



> 
    Virus-free. www.avast.com 


>


<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>



-- 
Adrian Klaver

adrian.kla...@aklaver.com 




--
Adrian Klaver
adrian.kla...@aklaver.com



Re: Alter table set logged hanging after writing out all WAL

2018-02-06 Thread Jeremy Finzel
On Tue, Feb 6, 2018 at 6:02 PM Michael Paquier 
wrote:

> On Tue, Feb 06, 2018 at 01:36:04AM -0600, Jeremy Finzel wrote:
> > Here is the basic structure - is the gist index significant?:
> >
> > CREATE UNLOGGED TABLE foo (
> > as_of_date daterange NOT NULL,
> > customer_id integer,
> > bunch_of_fields_here);
> >
> > ALTER TABLE ONLY foo
> > ADD CONSTRAINT foo_as_of_date_excl EXCLUDE USING gist (customer_id
> WITH
> > =, as_of_date WITH &&);
> >
> > CREATE UNIQUE INDEX foo_idx1 ON foo USING btree (customer_id) WHERE
> > (upper(as_of_date) = 'infinity'::date);
> >
> > CREATE INDEX foo_idx2 ON foo USING btree (customer_id, lower(as_of_date))
> > WHERE (upper(as_of_date) = 'infinity'::date);
> >
> > CREATE UNIQUE INDEX foo_idx3 ON foo USING btree (customer_id,
> > lower(as_of_date));
>
> I am not sure, but I would think about something related to gist here
> when heavy insertions are done on it...  I cannot put my finger on the
> thread though.
>
> > This is all I see - please help me if there's a better command I can
> > run:
>
> If the process is still running, can you attach gdb to it and then run
> the command bt? You may need to install debugging symbols to make the
> trace readable.
> --
> Michael


I am trying a few other scenarios to see if I can reproduce. I was able to
set to logged a copy of the table with no indexes. I am now attempting same
with only the gist index. If I can reproduce it on a non production server
I will try gdb.

Thank you much for the follow up.

Jeremy


Re: Pgcrypto (PostgreSQL 10) on Debain 9?

2018-02-06 Thread Michael Paquier
On Tue, Feb 06, 2018 at 03:58:14PM +, Raymond O'Donnell wrote:
> On 06/02/18 13:25, Thiemo Kellner, NHC Barhufpflege wrote:
>> But why do I get following error?
>> ERROR: function gen_random_uuid() does not exist.
>> create table ENTITY (ID uuid not null default gen_random_uuid());
> 
> Only a guess, but maybe you need to install the extension first? -
> 
>create extension ;

For gen_random_uuid(), you need to enable pgcrypto:
create extension pgcrypto;
For a couple of other UUID-related functions, you need to enable
uuid-ossp:
create extension "uuid-ossp";
--
Michael


signature.asc
Description: PGP signature


Re: Fwd: postgres instalation

2018-02-06 Thread Shreeyansh Dba
While you installing PostgreSQL via Source then by default it will contain
only (Bin, lib, include, share) if you want to install the documentation
(HTML and man pages)
 use following command:-

make install-docs.



On Wed, Feb 7, 2018 at 9:11 AM, Adrian Klaver 
wrote:

> On 02/06/2018 07:32 PM, Azimuddin Mohammed wrote:
>
>> I built it from source code.
>> It says contib is installed too. But i dont see thrm under the prefix
>> directory.
>>
>
> When you did the original build did you do make world or just make?
>
> See also:
>
> https://www.postgresql.org/docs/10/static/install-procedure.html
> "
> Installing the Files
> Note
>
> If you are upgrading an existing system be sure to read Section 18.6 which
> has instructions about upgrading a cluster.
>
> To install PostgreSQL enter:
>
> make install
>
> This will install files into the directories that were specified in Step
> 1. Make sure that you have appropriate permissions to write into that area.
> Normally you need to do this step as root. Alternatively, you can create
> the target directories in advance and arrange for appropriate permissions
> to be granted.
>
> To install the documentation (HTML and man pages), enter:
>
> make install-docs
>
> If you built the world above, type instead:
>
> make install-world
>
> This also installs the documentation.
> "
>
>
>
>> On Feb 6, 2018 9:17 PM, "Adrian Klaver" > > wrote:
>>
>> On 02/06/2018 06:05 PM, Azimuddin Mohammed wrote:
>>
>>
>> Hello,
>> I have installed postgres I saw the message postgres
>> installation complete. But when I look in the install directory
>> I only see
>> bin
>> lib
>> include
>> share
>>
>> I do not see man and docs, may I know how I can install the man
>> and docs  and what is the use of it?
>>
>>
>> How did you install, from source or via packages?
>>
>> If from source:
>>
>> https://www.postgresql.org/docs/10/static/install-procedure.html
>> 
>>
>> "If you want to build everything that can be built, including the
>> documentation (HTML and man pages), and the additional modules
>> (contrib), type instead:
>>
>> make world
>>
>>
>>
>>
>> --
>> Regards,
>> Azim
>>
>>
>>
>>
>> --
>> Regards,
>> Azim
>>
>>
>> > =link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon
>> > =link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon>>
>>  Virus-free. www.avast.com 
>> > =link&utm_campaign=sig-email&utm_content=webmail&utm_term=link
>> > =link&utm_campaign=sig-email&utm_content=webmail&utm_term=link>>
>>
>>
>> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>>
>>
>>
>> -- Adrian Klaver
>> adrian.kla...@aklaver.com 
>>
>>
>
> --
> Adrian Klaver
> adrian.kla...@aklaver.com
>
>


Re: Fwd: postgres instalation

2018-02-06 Thread Azimuddin Mohammed
May I know the use for doc and man here.
Additionally I see the doc directory is getting created in the build
directory and no the prefix directory I supplied


On Tue, Feb 6, 2018 at 11:16 PM, Shreeyansh Dba 
wrote:

> While you installing PostgreSQL via Source then by default it will contain
> only (Bin, lib, include, share) if you want to install the documentation
> (HTML and man pages)
>  use following command:-
>
> make install-docs.
>
> 
>
> On Wed, Feb 7, 2018 at 9:11 AM, Adrian Klaver 
> wrote:
>
>> On 02/06/2018 07:32 PM, Azimuddin Mohammed wrote:
>>
>>> I built it from source code.
>>> It says contib is installed too. But i dont see thrm under the prefix
>>> directory.
>>>
>>
>> When you did the original build did you do make world or just make?
>>
>> See also:
>>
>> https://www.postgresql.org/docs/10/static/install-procedure.html
>> "
>> Installing the Files
>> Note
>>
>> If you are upgrading an existing system be sure to read Section 18.6
>> which has instructions about upgrading a cluster.
>>
>> To install PostgreSQL enter:
>>
>> make install
>>
>> This will install files into the directories that were specified in Step
>> 1. Make sure that you have appropriate permissions to write into that area.
>> Normally you need to do this step as root. Alternatively, you can create
>> the target directories in advance and arrange for appropriate permissions
>> to be granted.
>>
>> To install the documentation (HTML and man pages), enter:
>>
>> make install-docs
>>
>> If you built the world above, type instead:
>>
>> make install-world
>>
>> This also installs the documentation.
>> "
>>
>>
>>
>>> On Feb 6, 2018 9:17 PM, "Adrian Klaver" >> > wrote:
>>>
>>> On 02/06/2018 06:05 PM, Azimuddin Mohammed wrote:
>>>
>>>
>>> Hello,
>>> I have installed postgres I saw the message postgres
>>> installation complete. But when I look in the install directory
>>> I only see
>>> bin
>>> lib
>>> include
>>> share
>>>
>>> I do not see man and docs, may I know how I can install the man
>>> and docs  and what is the use of it?
>>>
>>>
>>> How did you install, from source or via packages?
>>>
>>> If from source:
>>>
>>> https://www.postgresql.org/docs/10/static/install-procedure.html
>>> 
>>>
>>> "If you want to build everything that can be built, including the
>>> documentation (HTML and man pages), and the additional modules
>>> (contrib), type instead:
>>>
>>> make world
>>>
>>>
>>>
>>>
>>> --
>>> Regards,
>>> Azim
>>>
>>>
>>>
>>>
>>> --
>>> Regards,
>>> Azim
>>>
>>>
>>> >> =link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon
>>> >> =link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon>>
>>>  Virus-free. www.avast.com 
>>> >> =link&utm_campaign=sig-email&utm_content=webmail&utm_term=link
>>> >> =link&utm_campaign=sig-email&utm_content=webmail&utm_term=link>>
>>>
>>>
>>> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>>>
>>>
>>>
>>> -- Adrian Klaver
>>> adrian.kla...@aklaver.com 
>>>
>>>
>>
>> --
>> Adrian Klaver
>> adrian.kla...@aklaver.com
>>
>>
>


-- 

Regards,
Azim


Re: Fwd: postgres instalation

2018-02-06 Thread Azimuddin Mohammed
I think I fig out what the issue here
under the ./configure i need to mention man directory as well which I was
missing

let me ask this once the installation is I see a message "PostgreSQL
installation complete" how many directories I should be seeing under my
prefix directory

I am  seeing below files:

bin
extension
html
include
lib
man1
man3
man7
share

On Wed, Feb 7, 2018 at 12:35 AM, Azimuddin Mohammed 
wrote:

> May I know the use for doc and man here.
> Additionally I see the doc directory is getting created in the build
> directory and no the prefix directory I supplied
>
>
> On Tue, Feb 6, 2018 at 11:16 PM, Shreeyansh Dba 
> wrote:
>
>> While you installing PostgreSQL via Source then by default it will
>> contain only (Bin, lib, include, share) if you want to install the
>> documentation (HTML and man pages)
>>  use following command:-
>>
>> make install-docs.
>>
>> 
>>
>> On Wed, Feb 7, 2018 at 9:11 AM, Adrian Klaver 
>> wrote:
>>
>>> On 02/06/2018 07:32 PM, Azimuddin Mohammed wrote:
>>>
 I built it from source code.
 It says contib is installed too. But i dont see thrm under the prefix
 directory.

>>>
>>> When you did the original build did you do make world or just make?
>>>
>>> See also:
>>>
>>> https://www.postgresql.org/docs/10/static/install-procedure.html
>>> "
>>> Installing the Files
>>> Note
>>>
>>> If you are upgrading an existing system be sure to read Section 18.6
>>> which has instructions about upgrading a cluster.
>>>
>>> To install PostgreSQL enter:
>>>
>>> make install
>>>
>>> This will install files into the directories that were specified in Step
>>> 1. Make sure that you have appropriate permissions to write into that area.
>>> Normally you need to do this step as root. Alternatively, you can create
>>> the target directories in advance and arrange for appropriate permissions
>>> to be granted.
>>>
>>> To install the documentation (HTML and man pages), enter:
>>>
>>> make install-docs
>>>
>>> If you built the world above, type instead:
>>>
>>> make install-world
>>>
>>> This also installs the documentation.
>>> "
>>>
>>>
>>>
 On Feb 6, 2018 9:17 PM, "Adrian Klaver" >>> > wrote:

 On 02/06/2018 06:05 PM, Azimuddin Mohammed wrote:


 Hello,
 I have installed postgres I saw the message postgres
 installation complete. But when I look in the install directory
 I only see
 bin
 lib
 include
 share

 I do not see man and docs, may I know how I can install the man
 and docs  and what is the use of it?


 How did you install, from source or via packages?

 If from source:

 https://www.postgresql.org/docs/10/static/install-procedure.html
 

 "If you want to build everything that can be built, including the
 documentation (HTML and man pages), and the additional modules
 (contrib), type instead:

 make world




 --
 Regards,
 Azim




 --
 Regards,
 Azim


 >
Virus-free. www.avast.com 
 >


 <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>



 -- Adrian Klaver
 adrian.kla...@aklaver.com 


>>>
>>> --
>>> Adrian Klaver
>>> adrian.kla...@aklaver.com
>>>
>>>
>>
>
>
> --
>
> Regards,
> Azim
>
>


-- 

Regards,
Azim


Re: [solved] Pgcrypto (PostgreSQL 10) on Debain 9?

2018-02-06 Thread Thiemo Kellner

Zitat von Raymond O'Donnell :


Only a guess, but maybe you need to install the extension first? -

   create extension ;


Thanks, right guess as I figured out yesterday evening after reading  
not only the module portion but the introduction to the modules. I  
also was mislead by the fact that those went into core in version 10.


Greetings to Galway (where I spent preparations for my CAE) from  
Bannholz at the Hochrhein


--
Öffentlicher PGP-Schlüssel:  
http://pgp.mit.edu/pks/lookup?op=get&search=0x8F70EFD2D972CBEF



This message was sent using IMP, the Internet Messaging Program.



Documentation section F

2018-02-06 Thread Thiemo Kellner
I learnt yesterday that pgcrypto and uuid-ossp (possibly more) were  
included in the core. However, reading section F rose the impression  
that those are outside the core. Is this just me or can I help regroup  
the documentation at that point?


--
Öffentlicher PGP-Schlüssel:  
http://pgp.mit.edu/pks/lookup?op=get&search=0x8F70EFD2D972CBEF



This message was sent using IMP, the Internet Messaging Program.