Re: Help with my MacOS PostgreSQL 12 installation

2021-08-18 Thread Philip Semanchuk



> On Aug 17, 2021, at 12:21 PM, Michael White  wrote:
> 
> This is my first post so if I’m in the wrong place please help me get to the 
> correct list.
> 
> Issue:
> 
> I installed PostgreSQL on my Mac over a year ago and since upgraded my disk 
> drive and OS to Big Sur.  I am a retired Software Engineer and still like to 
> program and am learning PostgreSQL and have it working on Linux and FreeBSD.  
> In any case I had put it on my Mac laptop and want to use it again but it 
> seems that the upgrades I did might have rearranged file locations or they 
> may have been lost.  I have been trying to understand what is where and come 
> to a point where I need help getting PostgreSQL running again.  I have a file 
> with notes on the installation and here it is:

…

> 3. Don’t remember how I installed PostgreSQL but looks like with EnterpriseDB 
> because of the installation directory.  (I got this from postgresapp.com)


Hi Michael,
I use PostgresApp on my Mac, and it has worked very nicely for me. It’s a very 
no-fuss installation. You should have an app in our Applications folder called 
Postgres. Start that, and the Postgres server will be running. There’s a little 
elephant in my menu bar that I can click on that shows me what databases are 
available. I can set it to start the server automatically when I log in. If you 
don’t have an app called Postgres or it doesn’t run when you click it, I’d say 
your installation is damaged. If you can nuke it and start over, that’d be what 
I’d try. Start by dragging the app to the trash and reinstalling. That might 
fix things.

FYI I modified my .zshrc to include this line to add Postgres’ client apps to 
my path:
export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/11/bin

That way I have easy access to psql, pg_config, etc.


Hope this helps,
Philip



Postgres Migration error - Need help

2021-08-18 Thread Pansara, Jiten
Hello Team,

I am executing below command to copy data but it is throwing error. Can anyone 
help please?

[cid:image001.jpg@01D79444.912866B0]

Jiten Pansara
Senior Database Analyst
T:  +91 9158149600
E: jiten.pans...@fisglobal.com
FIS | Advancing the way the world Pays, Banks, and Invests 
[cid:image002.png@01D79444.912866B0]  
[cid:image003.png@01D79444.912866B0]  
[cid:image004.png@01D79444.912866B0] 
[A picture containing text, outdoor, sign  Description automatically generated]


The information contained in this message is proprietary and/or confidential. 
If you are not the intended recipient, please: (i) delete the message and all 
copies; (ii) do not disclose, distribute or use the message in any manner; and 
(iii) notify the sender immediately. In addition, please be aware that any 
message addressed to our domain is subject to archiving and review by persons 
other than the intended recipient. Thank you.


Re: Postgres Migration error - Need help

2021-08-18 Thread Bruce Momjian
On Wed, Aug 18, 2021 at 09:50:32AM +, Pansara, Jiten wrote:
> Hello Team,
> 
>  
> 
> I am executing below command to copy data but it is throwing error. Can anyone
> help please?

I think you want to contact the ora2pg project, not us.

-- 
  Bruce Momjian  https://momjian.us
  EDB  https://enterprisedb.com

  If only the physical world exists, free will is an illusion.





log_statement setting

2021-08-18 Thread Jayadevan M
Hello all,

A doubt on the setting  'log_statement'. Is it possible to set this at
database/user level?
I get 'all' when I try
select * from pg_settings where name = 'log_statement'
Does this mean all statements by any user on any database in that server
are getting logged? This is for auditing purposes.

Regards,
Jayadevan


Re: log_statement setting

2021-08-18 Thread Bruce Momjian
On Wed, Aug 18, 2021 at 09:34:08PM +0530, Jayadevan M wrote:
> Hello all,
> 
> A doubt on the setting  'log_statement'. Is it possible to set this at 
> database
> /user level?

Sure, ALTER USER/DATABASE ... SET.

> I get 'all' when I try
> select * from pg_settings where name = 'log_statement'
> Does this mean all statements by any user on any database in that server are
> getting logged? This is for auditing purposes.

Yes.

-- 
  Bruce Momjian  https://momjian.us
  EDB  https://enterprisedb.com

  If only the physical world exists, free will is an illusion.





PostgreSQL Automatic Failover Windows Server

2021-08-18 Thread Heljeeve C Unni
HI,

I am Heljeeve from India working as a DB Administratror. We are a company
doing projects on solutions for lottery system worldwide, and been in the
industry for the past 20 years. Currently we are doing projects in Windows
environments ( MS SQL SERVER DATABASE ),  as we required high
availability system we are mirroring the DATABASES using in built
technology of MS SQL SERVER MIRRORING and it's running smoothly.

Now we are wth a plan to migrate the databases to PostgresSQL.
Database development has been started.

I want to know in detail about PostgreSQL Automatic Failover solutions
without third party tools.

I believe it will work fine as mirroring in MS SQL SERVER

Can someone help me how to configure PostgreSQL Automatic Failover Windows
Server.

Installation procedures step by step on WINDOWS SERVER.

Help very much appreciated.

Thanks & Regareds

Heljeeve


Re: PostgreSQL Automatic Failover Windows Server

2021-08-18 Thread Vijaykumar Jain
>
>
> I want to know in detail about PostgreSQL Automatic Failover solutions
> without third party tools.
>
>

There is no automatic failover solution provided with core postgresql.
(maybe EDB provides in windows but ...)
there are third party OSS solutions,
dhamaniasad/awesome-postgres: A curated list of awesome PostgreSQL
software, libraries, tools and resources, inspired by awesome-mysql
(github.com)

These are a few solutions for HA.
There are detailed docs for each and/or blogs, you will have to read them
to figure out which one suits you best.


-- 
Thanks,
Vijay
Mumbai, India


Licensing

2021-08-18 Thread Bryan Boone
Hello Everyone.  I have a question about licensing with PostgeSQL.

I work for a small company and we design websites for customers of ours.  I 
read the license that is listed here.

https://www.postgresql.org/about/licence/ 


However, I am still confused.

The small company I work for develops websites and applications on AWS EC2 
instances for our customers and we charge the customers a fee for hosting and 
for maintaining their websites.

I am trying to figure out which dbase software I can use and if I need to buy 
licenses or not.

We do not modify the PostgreSQL code and we do not redistribute the binaries.  
So far we are just running on a single instance for each of our customers, but 
we are not utilizing anything like a cluster or high availability CDN, other 
than what AWS EC2 provides.  We always utilize Wordpress and Drupal for site 
front-end.

Can someone tell me if I am able to use PostgreSQL for the small company I work 
for?  Is there a way to by a commercial license of PostgreSQL if we are 
required too?

Thanks

Re: Licensing

2021-08-18 Thread Ben Chobot

Bryan Boone wrote on 8/18/21 11:39 AM:
Can someone tell me if I am able to use PostgreSQL for the small 
company I work for?


Yes, you are.


Re: Licensing

2021-08-18 Thread Adrian Klaver

On 8/18/21 11:39 AM, Bryan Boone wrote:

Hello Everyone.  I have a question about licensing with PostgeSQL.

I work for a small company and we design websites for customers of ours. 
  I read the license that is listed here.


https://www.postgresql.org/about/licence/ 


However, I am still confused.


I would think:

"Permission to use, copy, modify, and distribute this software and its 
documentation for any purpose, without fee, and without a written 
agreement is hereby granted, provided that the above copyright notice 
and this paragraph and the following two paragraphs appear in all copies. "


pretty much covers it, no fee, no written agreement is needed.


Thanks



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




Re: Licensing

2021-08-18 Thread Mladen Gogala
For a six-pack of Sam Adams Boston Lager or Molson Canadian Lager per 
website, I hereby grant thee the right to use PostgreSQL with any 
customer, to your heart's content. Please note that I don't accept 
Budweiser or Miller products.



On 8/18/21 2:39 PM, Bryan Boone wrote:

Hello Everyone.  I have a question about licensing with PostgeSQL.

I work for a small company and we design websites for customers of 
ours.  I read the license that is listed here.


https://www.postgresql.org/about/licence/ 



However, I am still confused.

The small company I work for develops websites and applications on AWS 
EC2 instances for our customers and we charge the customers a fee for 
hosting and for maintaining their websites.


I am trying to figure out which dbase software I can use and if I need 
to buy licenses or not.


We do not modify the PostgreSQL code and we do not redistribute the 
binaries.  So far we are just running on a single instance for each of 
our customers, but we are not utilizing anything like a cluster or 
high availability CDN, other than what AWS EC2 provides.  We always 
utilize Wordpress and Drupal for site front-end.


Can someone tell me if I am able to use PostgreSQL for the small 
company I work for?  Is there a way to by a commercial license of 
PostgreSQL if we are required too?


Thanks


--
Mladen Gogala
Database Consultant
Tel: (347) 321-1217
https://dbwhisperer.wordpress.com





Re: PostgreSQL Automatic Failover Windows Server

2021-08-18 Thread Bruce Momjian
On Wed, Aug 18, 2021 at 11:57:24PM +0530, Vijaykumar Jain wrote:
> 
> I want to know in detail about PostgreSQL Automatic Failover solutions
> without third party tools.
>  
> There is no automatic failover solution provided with core postgresql. (maybe
> EDB provides in windows but ...)
> there are third party OSS solutions, 
> dhamaniasad/awesome-postgres: A curated list of awesome PostgreSQL software,
> libraries, tools and resources, inspired by awesome-mysql (github.com)
> These are a few solutions for HA.
> There are detailed docs for each and/or blogs, you will have to read them to
> figure out which one suits you best. 

Yes, I think the reason there are only third-party failover tools is
that failover is very tied to the operating system/network details, and
the database usually doesn't focus on those.

-- 
  Bruce Momjian  https://momjian.us
  EDB  https://enterprisedb.com

  If only the physical world exists, free will is an illusion.





Re: Licensing

2021-08-18 Thread Bruce Momjian
On Wed, Aug 18, 2021 at 03:13:51PM -0400, Mladen Gogala wrote:
> For a six-pack of Sam Adams Boston Lager or Molson Canadian Lager per
> website, I hereby grant thee the right to use PostgreSQL with any customer,
> to your heart's content. Please note that I don't accept Budweiser or Miller
> products.

I am a root beer guy!  And of course, the beer/root beer angle is just a
joke,  Many companies use Postgres for many purposes, resell, modify,
etc, with no payment or requirements.

-- 
  Bruce Momjian  https://momjian.us
  EDB  https://enterprisedb.com

  If only the physical world exists, free will is an illusion.





Re: Licensing

2021-08-18 Thread Bryan Boone
Ah okay thank you.  I think what was confusing me was the “without fee”.

I wasn’t sure if that meant we could distribute it, but only if we did not 
charge a fee for it.  But I guess that means that PostgreSQL will not charge a 
fee to us to distribute it.

Thanks



> On Aug 18, 2021, at 12:13 PM, Adrian Klaver  wrote:
> 
> On 8/18/21 11:39 AM, Bryan Boone wrote:
>> Hello Everyone.  I have a question about licensing with PostgeSQL.
>> I work for a small company and we design websites for customers of ours.   I 
>> read the license that is listed here.
>> https://www.postgresql.org/about/licence/ However, I am still confused.
> 
> I would think:
> 
> "Permission to use, copy, modify, and distribute this software and its 
> documentation for any purpose, without fee, and without a written agreement 
> is hereby granted, provided that the above copyright notice and this 
> paragraph and the following two paragraphs appear in all copies. "
> 
> pretty much covers it, no fee, no written agreement is needed.
> 
>> Thanks
> 
> 
> -- 
> Adrian Klaver
> adrian.kla...@aklaver.com





Re: Postgres Migration error - Need help

2021-08-18 Thread Mladen Gogala
Why are you connecting to Postgres in the first place? Ora2Pg should 
connect to Oracle and produce a SQL script to re-create PostgreSQL 
version of the Oracle schema. As for the error below, you're probably 
using an old version of DBD::Pg. Check it using CPAN and upgrade if 
necessary.


Regards

On 8/18/21 5:50 AM, Pansara, Jiten wrote:


Hello Team,

I am executing below command to copy data but it is throwing error. 
Can anyone help please?


*Jiten Pansara*

Senior Database Analyst

*T*:  +91 9158149600
*E*: jiten.pans...@fisglobal.com 
*FIS | Advancing the way the world Pays, Banks, and 
Invests***


A picture containing text, outdoor, sign Description automatically 
generated


**

The information contained in this message is proprietary and/or 
confidential. If you are not the intended recipient, please: (i) 
delete the message and all copies; (ii) do not disclose, distribute or 
use the message in any manner; and (iii) notify the sender 
immediately. In addition, please be aware that any message addressed 
to our domain is subject to archiving and review by persons other than 
the intended recipient. Thank you. 


--
Mladen Gogala
Database Consultant
Tel: (347) 321-1217
https://dbwhisperer.wordpress.com



Re: Licensing

2021-08-18 Thread Bruce Momjian
On Wed, Aug 18, 2021 at 12:47:26PM -0700, Bryan Boone wrote:
> Ah okay thank you.  I think what was confusing me was the “without fee”.
> 
> I wasn’t sure if that meant we could distribute it, but only if we did not 
> charge a fee for it.  But I guess that means that PostgreSQL will not charge 
> a fee to us to distribute it.

You are not the first person to be confused by this;  see this email
thread from 2003:


https://www.postgresql.org/message-id/a3c9d941f0a3761cc68adad1b4334...@biglumber.com

-- 
  Bruce Momjian  https://momjian.us
  EDB  https://enterprisedb.com

  If only the physical world exists, free will is an illusion.





Re: Serious Assistance with PostgreSQL True Infinite Arbitrary Precision Maths.

2021-08-18 Thread A Z
'What I am trying to find is PostgreSQL support for High Precision numbers,
running inside the database engine itself.  PostgreSQL, presently at default,
has only got limited function support, on the range of a double.'

My needs for High Precision Arithmetic require new types and logic
inside PostgreSQL.  What I am after is an extension that comes with
an automatic installer file, standalone, that supports all classic
operators and classic mathematical functions upon and by
means of two types, a High Precision Integer type and a
High Precision Rational type.

I am trying also to get on to someone to help from the pgmp
project, who might be able to help by improving pgmp
to meet these needs.

I need arithmetic and comparison support on Integer and Rational (Decimal type)
numbers.  +, -, *,/,%, ==, !=, <>,>,<, >=, <=. Other important candidates 
required
include +=, -=, *=, /=, %=.

The trick is, that I also need full classical function support as well.  What I 
need
is:

ii infinite decimal;
ir infinite real;

cast(ir) returns double precision;
cast(double precision) returns ir;
cast(ir) returns real;
cast(real) return ir;
cast(ir) returns numeric;
cast(numeric) returns ir;
cast(ir) returns decimal;
cast(decimal) returns ir;
cast(ii) returns bigserial;
cast(bigserial) returns ii;
cast(ii) returns serial;
cast(serial) returns ii;
cast(ii) returns smallserial;
cast(smallserial) returns ii;
cast(ii) returns bigint;
cast(bigint) returns ii;
cast(ii) returns integer;
cast(integer) returns ii;
cast(ii) returns smallint;
cast(smallint) returns ii;

cast(text as ii) returns ii;
cast(text as ir) returns ir;
cast(ir as text) returns text;
cast(ii as text) returns text;
cast(ii as ir) returns ir;
cast(ir as ii) returns ii;

sign(ir input) returns ir;
abs(ir input) returns ir;
pi(ii places) returns ir;
e(ii places) returns ir;
power(ir base, ir exponent) returns ir;
sqrt(ir input) returns ir
nroot(ii theroot, ir input) returns ir;
log10(ir input) returns ir;
loge(ir input) returns ir;
log2(ir input) returns ir;
factorial(ii input) returns ii;
degrees(ir input) returns ir;
radians(ir input) returns it;

sind(ir input) returns ir;
cosd(ir input) returns ir;
tand(ir input) returns ir;
asind(ir input) returns ir;
acosd(ir input) returns ir;
atand(ir input) returns ir;

sinr(ir input) returns ir;
cosr(ir input) returns ir;
tanr(ir input) returns ir;
asinr(ir input) returns ir;
acosr(ir input) returns ir;
atanr(ir input) returns ir;

The last two sets of functions are forward and inverse trigonometry functions,
both in degrees and radians.

I also need the update module to install easily.  A windows *.exe and *.msi,
a Linux *.deb, *.rpm or *.bin.

Is there someone or something out there that can get there?

Is there anyone who can help?

From: A Z 
Sent: Wednesday, 18 August 2021 1:13 PM
To: Mladen Gogala 
Subject: Re: Serious Assistance with PostgreSQL True Infinite Arbitrary 
Precision Maths.

The library that I have been using so far is ttmath, in GNU C++.  That library
is High Precision, in the end, and does seem to be high precision enough,
accurate enough and fast enough for my programs.

What I am trying to find is PostgreSQL support for High Precision numbers,
running inside the database engine itself.  It has only got limited
function support, on the range of a double.

While Full Arbitrary Precision support gets to be a storage and speed
problem, for a database, which does and in real terms legitimately
have a 1 Gigabyte cell limit, what I am still after is improved number
support that includes integers, decimals, operators and function support
to address my needs.

I am also in the process of trying to communicate with someone
on the pgmp project, to get them to enhance and improve what they have
on offer.

Is there anyone on the PostgreSQL general email list who knows any more
on this issue?

From: Mladen Gogala 
Sent: Wednesday, 18 August 2021 1:05 PM
To: pgsql-general@lists.postgresql.org 
Subject: Re: Serious Assistance with PostgreSQL True Infinite Arbitrary 
Precision Maths.


The answer for you is Pl/Python3u. It can use numpy, which supports infinite 
precision arithmetic and converting results to double and back. It can also do 
linked lists. Depending on your age and your preferences, you might try 
Pl/Perl. I learned Perl in 1993 and have never stopped loving it. It has 
several modules for the infinite precision arithmetic. My favorite is 
Math::BigFloat. As for the linked lists, there is List::DoubleLinked module on 
CPAN. In other words, all procedural extensions can be used to fulfill your 
requirements. BTW, one of my employers told me that Perl is verboten and that 
the company has standardized on Python. So I had to learn it. It's not too bad 
if you're in that sort of things.

Regards


On 8/17/21 10:49 PM, A Z wrote:
Dear pgsql-general,

I'm after Infinite Precision Integer (ii) or Infinite Precision Rational (ir)
type and functio

Re: Serious Assistance with PostgreSQL True Infinite Arbitrary Precision Maths.

2021-08-18 Thread David G. Johnston
On Wed, Aug 18, 2021 at 7:34 PM A Z  wrote:

> The library that I have been using so far is ttmath, in GNU C++.  That
> library
> is High Precision, in the end, and does seem to be high precision enough,
> accurate enough and fast enough for my programs.
>

I'm guessing from the silence, and my subjective opinion that this kind of
need in a relational database - an innovation of the business world - is
especially rare, that the probability that your particular combination of
requirements exists is basically zero.  Especially as the one project you
found, pgmp, no longer seems to be developed and in its current state
doesn't meet your requirements.  In short, I'm doubting that you will find
something that is both free of money and your effort.  On the positive
side, it seems the harder part of all this, the math library, already
exists.  And its is most likely possible to get a working API to that in
PostgreSQL in a manner similar to the pgmp project.  So the needed effort
is hopefully just in gluing the two worlds together.

As you are already using a C++ library the following section of the
documentation [1] may help.  Figuring out how to write a wrapper-oriented
extension over top of the C++ ttmath library seems doable.  Especially
since you have the pgmp project to use as a jumping off point (I'm guessing
there are some C++ wrapped extensions out there too - even if not for this
specific library).  Licensing is something to consider though - and outside
my willingness to advise upon.

1. https://www.postgresql.org/docs/current/xfunc-c.html#EXTEND-CPP

David J.


Re: log_statement setting

2021-08-18 Thread Jayadevan M
On Wed, Aug 18, 2021 at 9:36 PM Bruce Momjian  wrote:

> On Wed, Aug 18, 2021 at 09:34:08PM +0530, Jayadevan M wrote:
> > Hello all,
> >
> > A doubt on the setting  'log_statement'. Is it possible to set this at
> database
> > /user level?
>
> Sure, ALTER USER/DATABASE ... SET.
>
Thank you. Follow up question- If it is set to different values for
different users/databases, how can I get those values?  For example,
I have a server with 4 databases. If I just query pg_settings, I get only
one value.

>
> > I get 'all' when I try
> > select * from pg_settings where name = 'log_statement'
> > Does this mean all statements by any user on any database in that server
> are
> > getting logged? This is for auditing purposes.
>
> Yes.
>
Thanks.


Re: log_statement setting

2021-08-18 Thread Julien Rouhaud
On Thu, Aug 19, 2021 at 1:55 PM Jayadevan M  wrote:
>
> Thank you. Follow up question- If it is set to different values for different 
> users/databases, how can I get those values?  For example,
> I have a server with 4 databases. If I just query pg_settings, I get only one 
> value.

The value you see on pg_settings is the one that's selected for your
current connection, based on the database/role you used.

You can use \drds in psql to see the various configurations, or query
the pg_db_role_setting table.