Postgres and alias

2020-08-27 Thread Fontana Daniel C (Desartec S.R.L.)
Perfect. now let's imagine that '1234567890' is a function f_art_get_price(id_code), which returns in a string like the following 'XXXZMMM1234567890123/mm/dd' where 1234567890123 is the price and /mm/dd the date it was last changed price. How would you do in this case to obtain these val

Re: Database cluster binary compatibility accross CPU platforms

2020-08-27 Thread Aleš Zelený
Thanks for the explanation! We are still not using ICU, so the reindex (endians - based on what I've found about Graviton ARM64 cpu are same, but no information about datatype alignment) will be a pain, so if we really opt for the platform we can give it a try, but generally I'll expect restoring d

Re: Most effective and fast way to load few Tbyte of data from flat files into postgresql

2020-08-27 Thread Shaozhong SHI
On Tue, 25 Aug 2020 at 12:24, Peter J. Holzer wrote: > On 2020-08-24 21:17:36 +, Dirk Krautschick wrote: > > what would be the fastest or most effective way to load few (5-10) TB > > of data from flat files into a postgresql database, including some 1TB > > tables and blobs? > > > > There is

Re: could not send data to client: Permission denied

2020-08-27 Thread Daniel Jakots
On Thu, 27 Aug 2020 12:44:11 -0400, Tom Lane wrote: > It looks like send() itself is returning EACCES, which seems just > weird. The send(2) man page does cite some possible causes of > EACCES, but none of them seem relevant here. Oh, send(2) on OpenBSD [1] says that the firewall may cause suc

Re: could not send data to client: Permission denied

2020-08-27 Thread Tom Lane
Daniel Jakots writes: > On Thu, 27 Aug 2020 09:04:25 -0700, Adrian Klaver > wrote: >> Are you using some sort of authentication for the API? > Sorry I'm not sure what you mean? > Between the clients and the python code I use some "basic auth" (and IP > restrictions on the reverse proxy). But I

Re: could not send data to client: Permission denied

2020-08-27 Thread Daniel Jakots
On Thu, 27 Aug 2020 09:04:25 -0700, Adrian Klaver wrote: > > In postgresql log, it says: > > Aug 27 02:10:02 db1 postgres[62464]: [7-1] > > 10.10.10.43(41816):[unknown]@[unknown]: LOG: connection received: > > host=10.10.10.43 port=4181 Aug 27 02:10:02 db1 postgres[62464]: > > [8-1] 10.10.10.43(

Re: could not send data to client: Permission denied

2020-08-27 Thread Adrian Klaver
On 8/27/20 8:28 AM, Daniel Jakots wrote: Hi, I run a flask rest api which use postgres to store data. I've been using it for a few months and it worked flawlessly. I recently got an error twice (58h10m apart). I added a lot more data a few days ago which could be the reason I get this now, but t

Re: Postgres and alias

2020-08-27 Thread Paul Förster
Hi Daniel, > On 27. Aug, 2020, at 17:55, Fontana Daniel C (Desartec S.R.L.) > wrote: > > Hi, I am migrating a database from Sybase to PostgreSql 12. > > This select in sybase works for me, but with postgresql it accuses me > "THERE IS NO COLUMN ls_numero" > > select '1234567890' as ls_number,

Re: Postgres and alias

2020-08-27 Thread Stelios Sfakianakis
Hmm, how about: SELECT substr (ls_number, 3, 3) FROM (VALUES('1234567890')) as t(ls_number); St. > On 27 Aug 2020, at 18:55, Fontana Daniel C (Desartec S.R.L.) > wrote: > > Hi, I am migrating a database from Sybase to PostgreSql 12. > > This select in sybase works for me, but with postgresql

Postgres and alias

2020-08-27 Thread Fontana Daniel C (Desartec S.R.L.)
Hi, I am migrating a database from Sybase to PostgreSql 12. This select in sybase works for me, but with postgresql it accuses me "THERE IS NO COLUMN ls_numero" select '1234567890' as ls_number, substr (ls_number, 3, 3); Is it possible to get information from an alias in postg

could not send data to client: Permission denied

2020-08-27 Thread Daniel Jakots
Hi, I run a flask rest api which use postgres to store data. I've been using it for a few months and it worked flawlessly. I recently got an error twice (58h10m apart). I added a lot more data a few days ago which could be the reason I get this now, but the table is still quite small with 69807 li

Re: Are advisory locks guaranteed to be First Come First Serve? And can the behavior be relied upon?

2020-08-27 Thread Tom Lane
Laurenz Albe writes: > On Thu, 2020-08-27 at 10:10 +0530, Hemil Ruparel wrote: >> I was playing with Advisory locks. I opened three connections to the >> database And obtained >> a lock with the same key. I noticed that the locks were obtained in the >> order of requests. >> I was wondering whet

Re: SSL between Primary and Seconday PostgreSQL DBs

2020-08-27 Thread Susan Joseph
So has no one done this before? -Original Message- From: Susan Joseph To: pgsql-gene...@postgresql.org Sent: Mon, Aug 24, 2020 10:10 am Subject: SSL between Primary and Seconday PostgreSQL DBs I have setup a Primary and Secondary PostgreSQL DBs.  They were setup up with basic repl

Re: Calling a SQL function inside a C function

2020-08-27 Thread Eric Zhu
Much thanks! This is exactly what I was looking for: funcname = stringToQualifiedNameList("times_two"); > funcoid = LookupFuncName(func_name, 1, funcargs, false); > > Datum ret = OidFunctionCall1(funcoid, Int32GetDatum(13)); > Eric On Wed, Aug 26, 2020 at 8:53 PM Pavel Stehule wrote: > Hi > >

Re: Are advisory locks guaranteed to be First Come First Serve? And can the behavior be relied upon?

2020-08-27 Thread Hemil Ruparel
Thanks a lot On Thu 27 Aug, 2020, 12:23 PM Laurenz Albe, wrote: > On Thu, 2020-08-27 at 10:10 +0530, Hemil Ruparel wrote: > > I was playing with Advisory locks. I opened three connections to the > database And obtained > > a lock with the same key. I noticed that the locks were obtained in the