Re: Question About PostgreSQL Extensibility

2023-10-13 Thread felix . quintgz
For the same reason that you can use python or perl in postgresql. It's just 
another language.
I have .net code running on several sql servers and to change the database to 
postgresql I have to reprogram them.

 On Thursday, October 12, 2023 at 09:44:08 AM GMT-4, Laurenz Albe 
 wrote:

 On Thu, 2023-10-12 at 06:09 +, Sepideh Eidi wrote:
> We have some .net assemblies and in your documents, I didn’t find any support 
> for this
> type of files that is executable in DB or not. Would you please tell me that 
> .net
> assemblies files are executable in PostgreSQL or not? Or is there any way for 
> calling
> assembly methods inside DB?

There is no support for that.  I guess somebody could write an extension PL/net,
and it looks like somebody already has: https://github.com/witblitz/pldotnet.
That code ptobably won't work with recent PostgreSQL releases, but it could be
a basis for you to work upon.

My big question for me is: Why on earth would you want to run .NET code inside a
database?  Why not run it on the client?

Yours,
Laurenz Albe




Re: Excel Source [24]] Error: System.Exception: SqlTruncateException: Numeric arithmetic causes

2024-03-01 Thread felix . quintgz


The numeric(19, 18) field type can only store numbers less than 10 with 18 
decimal places.
To save the number 36655.63 you need a numeric(12, 2) field type.


 On Thursday, February 29, 2024 at 10:00:10 AM GMT-5, Erik Wienhold 
 wrote:

 cc'ing list.

On 2024-02-29 07:16 +0100, Anthony Apollis wrote:
> I cant change data type using the advance editor in destination:
> [image: image.png]
> [image: image.png]

The column type must be changed in the database itself.

On second thought, are you sure "Metric Value" is the right destination
column for your import?  Maybe type numeric(19,18) is intentional.

> On Thu, 29 Feb 2024 at 08:11, Anthony Apollis 
> wrote:
>
> > I tried multiple data types, including: "Metric Value" text COLLATE
> > pg_catalog."default", "Metric Value" character varying(510) COLLATE
> > pg_catalog."default", and Decimal/Numeric.

Did you get the same error with the text columns?  In plain SQL you can
certainly insert numeric into text columns.  Postgres does an implicit
cast in that case.  Not sure what your middleware does in that case
though.

> > On Thu, 29 Feb 2024 at 02:12, Erik Wienhold  wrote:
> >
> >> On 2024-02-28 21:22 +0100, Anthony Apollis wrote:
> >> > Please assist. I am using SSIS to read data from an Excel sheet into
> >> > Postgres. I have increased the column size a few times, just cant seem
> >> to
> >> > get the data in. Getting errors relating to destination column size.
> >>
> >> What is the data type of that column?
> >>
> >> > [Excel Source [24]] Error: System.Exception: SqlTruncateException:
> >> > Numeric arithmetic causes truncation.. RowNumber=1, ColumnName=Metric
> >> > Value [DataType=DT_NUMERIC,Length=0], Data=[Length=12,
> >> > Value=36655.63]
> >> >    at
> >> ZappySys.PowerPack.Adapter.SqlDataComponentBase.HandleException(Exception
> >> > ex)
> >> >    at ZappySys.PowerPack.Adapter.SqlDataComponentBase.PrimeOutput(Int32
> >> > outputs, Int32[] outputIDs, PipelineBuffer[] buffers)
> >> >    at
> >> Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostPrimeOutput(IDTSManagedComponentWrapper100
> >> > wrapper, Int32 outputs, Int32[] outputIDs, IDTSBuffer100[] buffers,
> >> > IntPtr ppBufferWirePacket)
> >>
> >> Not sure what I'm looking at, but screenshots 1 and 2 say precision=19
> >> and scale=18 which would be numeric(19,18).  But value 36655.63
> >> shown in the error message requires a precision that is at least 9
> >> digits larger than the scale:
> >>
> >>        regress=# select '36655.63'::numeric(19,18);
> >>        ERROR:  numeric field overflow
> >>        DETAIL:  A field with precision 19, scale 18 must round to an
> >> absolute value less than 10^1.
> >>        regress=# select '36655.63'::numeric(27,18);
> >>                    numeric
> >>        --
> >>          36655.63
> >>        (1 row)

--
Erik




Re: Running psql in a docker container

2024-07-12 Thread felix . quintgz
In the docker-compose.yml file it can be passed in the environment variables.

POSTGRES_INITDB_ARGS: "--encoding=UTF-8"


 On Thursday, July 11, 2024 at 10:58:14 AM GMT-4, H  
wrote:

 I used to successfully run psql server 13 in a CentOS 7 docker container with 
CentOS 7 as the host operating system. I have now upgraded that system to Rocky 
Linux 9 as the host operating system and modifying my container to also use 
Rocky Linux 9 and psql server 16.

I can successfully get the container up and running and can connect to it. 
However, I have not managed to modify the initdb statement to use en_US.UTF-8 
for all databases.

In the old container I used:

su - postgres -c "/usr/pgsql-13/bin/initdb -D /var/lib/pgsql/13/data/ -E 
'UTF-8' --lc-collate='en_US.UTF-8' --lc-ctype='en_US.UTF-8'"

but this does not work with psql 16. I tried:

su - postgres -c "/usr/pgsql-16/bin/initdb -D /var/lib/pgsql/16/data/ -E 
'UTF-8' --lc-lang='en_US'"

and variations thereof with no success.

Any suggestions on what I have missed?

Thank you.




The Amazon CloudFront distribution is configured to block access from your country.

2021-04-10 Thread felix . quintgz
I am trying to download the installer and I get this error. The same happens 
with binary files. 

---
403 ERROR
The request could not be satisfied.
The Amazon CloudFront distribution is configured to block access from your 
country. We can't connect to the server for this app or website at this time. 
There might be too much traffic or a configuration error. Try again later, or 
contact the app or website owner.
If you provide content to customers through CloudFront, you can find steps to 
troubleshoot and help prevent this error by reviewing the CloudFront 
documentation.

Generated by cloudfront (CloudFront)
Request ID: asdbQyjKvpRkboABJVWMOVtNnqMx8XVv74Ho_GBQF-lx6qWcRIhLaw==
---
Greetings
Thank you very much in advance 





Re: The Amazon CloudFront distribution is configured to block access from your country.

2021-04-10 Thread felix . quintgz
Because it is the Postgresql installer. 
https://www.enterprisedb.com/downloads/postgres-postgresql-downloads

 On Saturday, April 10, 2021, 07:30:29 PM GMT-4, Ron  
wrote:

 On 4/10/21 2:00 PM, felix.quin...@yahoo.com wrote:
> I am trying to download the installer and I get this error. The same happens 
> with binary files.
>
> ---
> 403 ERROR
> The request could not be satisfied.
> The Amazon CloudFront distribution is configured to block access from your 
> country. We can't connect to the server for this app or website at this time. 
> There might be too much traffic or a configuration error. Try again later, or 
> contact the app or website owner.
> If you provide content to customers through CloudFront, you can find steps to 
> troubleshoot and help prevent this error by reviewing the CloudFront 
> documentation.
>
> Generated by cloudfront (CloudFront)
> Request ID: asdbQyjKvpRkboABJVWMOVtNnqMx8XVv74Ho_GBQF-lx6qWcRIhLaw==

Why is this directly relevant to Postgresql?

--
Angular momentum makes the world go 'round.




Re: The Amazon CloudFront distribution is configured to block access from your country.

2021-04-10 Thread felix . quintgz


I see no reason why ask elsewhere first, the link for the installer download is 
on the Postgresql website, not elsewhere. The most logical thing to do is ask 
here first. 


 On Saturday, April 10, 2021, 08:07:15 PM GMT-4, Ron  
wrote:

Then you should ask EDB, or Amazon, or use a VPN.

On 4/10/21 7:03 PM, felix.quin...@yahoo.com wrote:
> Because it is the Postgresql installer. 
> https://www.enterprisedb.com/downloads/postgres-postgresql-downloads
>
>  On Saturday, April 10, 2021, 07:30:29 PM GMT-4, Ron 
> wrote:
>
>  On 4/10/21 2:00 PM, felix.quin...@yahoo.com wrote:
>> I am trying to download the installer and I get this error. The same happens 
>> with binary files.
>>
>> ---
>> 403 ERROR
>> The request could not be satisfied.
>> The Amazon CloudFront distribution is configured to block access from your 
>> country. We can't connect to the server for this app or website at this 
>> time. There might be too much traffic or a configuration error. Try again 
>> later, or contact the app or website owner.
>> If you provide content to customers through CloudFront, you can find steps 
>> to troubleshoot and help prevent this error by reviewing the CloudFront 
>> documentation.
>>
>> Generated by cloudfront (CloudFront)
>> Request ID: asdbQyjKvpRkboABJVWMOVtNnqMx8XVv74Ho_GBQF-lx6qWcRIhLaw==
> Why is this directly relevant to Postgresql?

--
Angular momentum makes the world go 'round.




Re: The Amazon CloudFront distribution is configured to block access from your country.

2021-04-11 Thread felix . quintgz
The link https://www.postgresql.org/download/ in the PostgreSQL Downloads 
section, Windows, redirects to the page 
https://www.postgresql.org/download/windows/. There are only two links in it 
and both redirect to the EnterpriseDB site. At no time is it clarified that it 
is a third party, even the link is outside the third party section.
On the page https://www.postgresql.org/download/ there are only two more 
sections, the source code and third parties. Therefore the official source for 
downloading the installer is the link I put, I checked all the links on the 
site and nowhere is it offered to download the installer from the PostgreSQL 
site itself.
The use of vpn is not legal in some countries, it is an option that can get me 
in trouble. The only option I have left is to search for a link in google and 
download it from some dubious source. 

 On Sunday, April 11, 2021, 05:54:00 AM GMT-4, Stephan Knauss 
 wrote:

 Hello Felix,

On 11.04.2021 02:31, felix.quin...@yahoo.com wrote:
> I see no reason why ask elsewhere first, the link for the installer download 
> is on the Postgresql website, not elsewhere. The most logical thing to do is 
> ask here first.

> Because it is the Postgresql installer. 
> https://www.enterprisedb.com/downloads/postgres-postgresql-downloads
>
It's unfortunate that your download is blocked. As indicated by others I
am also wondering why you ask here for community support.

You pointed to a download link which is controlled by a private company
selling Postgresql services:

Read about this company on an independent website:
https://en.wikipedia.org/wiki/EnterpriseDB

If you are looking for the download links of the PostgreSQL project, you
can find it here:

https://www.postgresql.org/download/


Based on your feedback, it is NOT the link listed on the PostgreSQL
website, but on a 3rd party website. This is why you got the
recommendation to check with them. You also got hints on how you could
potentially work around the download restriction by using a VPN.


Stephan




Re: The Amazon CloudFront distribution is configured to block access from your country.

2021-04-12 Thread felix . quintgz
The entire enterprisedb site is blocked for me. It's an American company, so I 
imagine it's happening.
In the end I ended up downloading it from www.download3k.es. I checked the 
installer certificate and it seems to be correct.

Thank you very much to all


 On Sunday, April 11, 2021, 11:38:43 AM GMT-4, Adrian Klaver 
 wrote:


 On 4/11/21 8:11 AM, felix.quin...@yahoo.com wrote:
> The link https://www.postgresql.org/download/ in the PostgreSQL Downloads 
> section, Windows, redirects to the page 
> https://www.postgresql.org/download/windows/. There are only two links in it 
> and both redirect to the EnterpriseDB site. At no time is it clarified that 
> it is a third party, even the link is outside the third party section.
> On the page https://www.postgresql.org/download/ there are only two more 
> sections, the source code and third parties. Therefore the official source 
> for downloading the installer is the link I put, I checked all the links on 
> the site and nowhere is it offered to download the installer from the 
> PostgreSQL site itself.
> The use of vpn is not legal in some countries, it is an option that can get 
> me in trouble. The only option I have left is to search for a link in google 
> and download it from some dubious source.

Another option, now that you know the situation, is to contact
EDB(https://www.enterprisedb.com/contact) and see if there are other
ways to get the software.

There is also the option of downloading the source:

https://www.postgresql.org/ftp/source/

from the community site and building Postgres.


>
>  On Sunday, April 11, 2021, 05:54:00 AM GMT-4, Stephan Knauss 
> wrote:
>
>  Hello Felix,
>
> On 11.04.2021 02:31, felix.quin...@yahoo.com wrote:
>> I see no reason why ask elsewhere first, the link for the installer download 
>> is on the Postgresql website, not elsewhere. The most logical thing to do is 
>> ask here first.
>
>> Because it is the Postgresql installer. 
>> https://www.enterprisedb.com/downloads/postgres-postgresql-downloads
>>
> It's unfortunate that your download is blocked. As indicated by others I
> am also wondering why you ask here for community support.
>
> You pointed to a download link which is controlled by a private company
> selling Postgresql services:
>
> Read about this company on an independent website:
> https://en.wikipedia.org/wiki/EnterpriseDB
>
> If you are looking for the download links of the PostgreSQL project, you
> can find it here:
>
> https://www.postgresql.org/download/
>
>
> Based on your feedback, it is NOT the link listed on the PostgreSQL
> website, but on a 3rd party website. This is why you got the
> recommendation to check with them. You also got hints on how you could
> potentially work around the download restriction by using a VPN.
>
>
> Stephan
>
>


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




Re: The Amazon CloudFront distribution is configured to block access from your country.

2021-04-12 Thread felix . quintgz
Unfortunately the official site for downloading the installer is blocked for me.
I only had that option and trust what I am downloading. 


 On Monday, April 12, 2021, 03:55:37 PM GMT-4, Condor  wrote:


 On 12-04-2021 17:53, felix.quin...@yahoo.com wrote:
> The entire enterprisedb site is blocked for me. It's an American
> company, so I imagine it's happening.
> In the end I ended up downloading it from www.download3k.es. I checked
> the installer certificate and it seems to be correct.
>
> Thank you very much to all
>

The antivirus scan of the site looks amazing. Only a fool would believe
it...
Download DB only from official site.




Re: What are best practices wrt passwords?

2024-10-16 Thread felix . quintgz
Use the PGPASSWORD environment variable.
Example:

SET PGPASSWORD=P0stgres
psql -h localhost -p 5432 -U postgres -d postgres -c "SELECT 1;'"

https://www.postgresql.org/docs/current/libpq-envars.html


 On Wednesday, October 16, 2024 at 08:26:05 AM GMT-4,  wrote:

 Hello all,

I'd like to be able to use psql without typing passwords again and
again.  I know about `.pgpass` and PGPASSFILE, but I specifically do not
want to use it - I have the password in the `.env` file, and having it
in _two_ places comes with its own set of problems, like how to make
sure they don't get out of sync.

I understand why giving the password on the command line or in an
environment variable is a security risk (because of `ps`), but I do not
understand why `psql` doesn't have an option like `--password-command`
accepting a command which then prints the password on stdout.  For
example, I could then use `pass` (https://www.passwordstore.org/) with
gpg-agent.

Is there any risk associated with this usage pattern?  What is the
recommended practice in my case other than using `.pgpass`?

Thanks in advance,

P.S. Please CC me in replies, since I'm not subscribed to the list.
Thanks.

--
Marcin Borkowski
https://mbork.pl
https://crimsonelevendelightpetrichor.net/




Re: Running docker in postgres, SHM size of the docker container in postgres 16

2024-11-20 Thread felix . quintgz
Docker databases do not perform well under heavy load.
Everything can be configured to improve performance but going through the 
Docker disk access layer will significantly decrease performance.

 On Wednesday, November 20, 2024 at 06:06:36 AM GMT-5, Koen De Groote 
 wrote:

 That explains a lot.
I have the default of 2 max_parallel_maintenance_workers set, should I set this 
to 0?
I realize this is of course an improvement, but working with docker containers, 
I'd like to avoid taking /dev/shm away from regular queries.
I assume setting max_parallel_maintenance_workers to 0 is the fix here, is 
there perhaps something else I should know about, if I want to have control 
over this?
Regards,Koen De Groote


On Wed, Nov 20, 2024 at 12:38 AM Thomas Munro  wrote:
On Wed, Nov 20, 2024 at 11:22 AM Koen De Groote  wrote:

> Why would that be? It's the exact same data. The install is about 50GB in 
> size. Is there something wrong with postgres 16, or did some settings 
> significantly change, that I need to know about? I went over all the 
> changelogs, nothing stood out as relevant to this, but that might be a lack 
> of experience on my end.



Parallel vacuum arrived in PostgreSQL 13, and that uses "dynamic

shared memory" to share state between workers, and assuming

dynamic_shared_memory_type=posix, that means shm_open(), which opens

files under /dev/shm on Linux.