Re: PG SQL and LIKE clause

2019-09-12 Thread Pavel Stehule
pá 13. 9. 2019 v 8:49 odesílatel Matthias Apitz napsal: > El día Friday, September 13, 2019 a las 07:33:10AM +0200, Pavel Stehule > escribió: > > > > We got to know that in CHAR columns with trailing blanks a > > > > > > SELECT ... FROM ... WHERE name LIKE 'Ali' > > > > > > does not match in 'nam

Re: PG SQL and LIKE clause

2019-09-12 Thread Matthias Apitz
El día Friday, September 13, 2019 a las 07:33:10AM +0200, Pavel Stehule escribió: > > We got to know that in CHAR columns with trailing blanks a > > > > SELECT ... FROM ... WHERE name LIKE 'Ali' > > > > does not match in 'name' having 'Ali '. > > > > I glanced through our code with grep pipelines

Re: PG SQL and LIKE clause

2019-09-12 Thread Pavel Stehule
Hi pá 13. 9. 2019 v 7:29 odesílatel Matthias Apitz napsal: > > Hello, > > We're porting a huge Library Management System, written using all kind > of languages one can think of (C, C++, ESQL/C, Perl, Java, ...) on Linux > from the DBS Sybase to PG, millions of lines of code, which works also > w

PG SQL and LIKE clause

2019-09-12 Thread Matthias Apitz
Hello, We're porting a huge Library Management System, written using all kind of languages one can think of (C, C++, ESQL/C, Perl, Java, ...) on Linux from the DBS Sybase to PG, millions of lines of code, which works also with DBS Oracle and in the past with INFORMIX-SE and -ONLINE. We got to k

Re: Referncing a calculated column in a select?

2019-09-12 Thread Kyotaro Horiguchi
Hello. At Thu, 12 Sep 2019 23:16:01 +0200, "Peter J. Holzer" wrote in <20190912211601.ga3...@hjp.at> > On 2019-09-12 15:35:56 -0500, Ron wrote: > > On 9/12/19 2:23 PM, stan wrote: > > > I am creating some views, that have columns with fairly complex > > > calculations > > > in them. The I want

Re: Referncing a calculated column in a select?

2019-09-12 Thread Peter J. Holzer
On 2019-09-12 15:35:56 -0500, Ron wrote: > On 9/12/19 2:23 PM, stan wrote: > > I am creating some views, that have columns with fairly complex calculations > > in them. The I want to do further calculations using the result of this > > calculation. Right now, I am just duplicating the first calcula

Re: Referncing a calculated column in a select?

2019-09-12 Thread Ron
On 9/12/19 2:23 PM, stan wrote: I am creating some views, that have columns with fairly complex calculations in them. The I want to do further calculations using the result of this calculation. Right now, I am just duplicating the first calculation in the select fro the 2nd calculated column. The

Re: Recover data from aborted transactions

2019-09-12 Thread Aaron Spike
I don't remember exactly what I read to get this idea. Perhaps it was this particular presentation slide: https://www.slideshare.net/pgdayasia/postgresql-wal-for-dbas/15 The great news is that it must. Some of the helpful folks on IRC introduced me to two different methods of retrieving the inform

Re: Strange Behaviour with multicolumn indexes

2019-09-12 Thread Peter J. Holzer
On 2019-09-12 21:04:25 +0200, Peter J. Holzer wrote: > On 2019-09-12 12:54:55 -0400, Tom Lane wrote: > > It's not taking the partial-index filter into account in that, I > > suspect, which skews the results in this case --- but that would be > > hard to account for accurately. > > Hmm. Wouldn't th

Referncing a calculated column in a select?

2019-09-12 Thread stan
I am creating some views, that have columns with fairly complex calculations in them. The I want to do further calculations using the result of this calculation. Right now, I am just duplicating the first calculation in the select fro the 2nd calculated column. There must be a batter way to do th

Re: Strange Behaviour with multicolumn indexes

2019-09-12 Thread Peter J. Holzer
On 2019-09-12 12:54:55 -0400, Tom Lane wrote: > "Peter J. Holzer" writes: > > we'll consider just three columns, which we unimaginatively call a, b, > > and c. There are also three indexes: > > > t_a_idx btree (a) WHERE a IS NOT NULL > > t_b_idx btree (b) WHERE b IS NOT NULL > > t

Re: Web GUI for PG table ?

2019-09-12 Thread Adrian Klaver
On 9/12/19 7:56 AM, David Gauthier wrote: Many good visualization options but I need one that runs on the web AND allows insert/update/delete records. I do that using Django as the framework behind it. See callbacks: http://tabulator.info/docs/4.4/callbacks In particular cell and data callbac

Re: Strange Behaviour with multicolumn indexes

2019-09-12 Thread Tom Lane
"Peter J. Holzer" writes: > we'll consider just three columns, which we unimaginatively call a, b, > and c. There are also three indexes: > t_a_idx btree (a) WHERE a IS NOT NULL > t_b_idx btree (b) WHERE b IS NOT NULL > t_a_b_idx btree (a, b) WHERE a IS NOT NULL AND b IS NOT NULL

Strange Behaviour with multicolumn indexes

2019-09-12 Thread Peter J. Holzer
[PostgreSQL 11.5 (Ubuntu 11.5-1.pgdg18.04+1) on x86_64-pc-linux-gnu] I have a table with many columns and many indexes (actually many tables with many columns and many indexes), but for the sake of this posting, we'll consider just three columns, which we unimaginatively call a, b, and c. There ar

Re: Web GUI for PG table ?

2019-09-12 Thread Ron
On 9/12/19 9:08 AM, David Gauthier wrote: Hi: We're considering replacing a windows AccessDB based system with PG.  Access was chosen because of it's GUI to its tables (looks and behaves like a SS). But performance can be volatile given the fact that the AccessDB front-ends and back-end are a

Re: How to reformat output of "age()" function

2019-09-12 Thread Francisco Olarte
Adrian: On Thu, Sep 12, 2019 at 4:23 PM Adrian Klaver wrote: > > pure_seconds_interval > > --- > > 3923:00:00 > > (1 row) > > > > A third representation! which gives the same result for epoch, but I'm > > not sure it does for arithmetic( tested it, it does not ) > > > >

Re: Web GUI for PG table ?

2019-09-12 Thread David Gauthier
Many good visualization options but I need one that runs on the web AND allows insert/update/delete records. On Thu, Sep 12, 2019 at 10:42 AM Adrian Klaver wrote: > On 9/12/19 7:08 AM, David Gauthier wrote: > > Hi: > > > > We're considering replacing a windows AccessDB based system with PG. > >

Re: Web GUI for PG table ?

2019-09-12 Thread Adrian Klaver
On 9/12/19 7:08 AM, David Gauthier wrote: Hi: We're considering replacing a windows AccessDB based system with PG. Access was chosen because of it's GUI to its tables (looks and behaves like a SS). But performance can be volatile given the fact that the AccessDB front-ends and back-end are a

Re: update returning order by syntax error question

2019-09-12 Thread Tom Lane
Adrian Klaver writes: > On 9/12/19 6:44 AM, Tom Lane wrote: >> No, it's *exactly* as if that. UPDATE is an unreserved >> keyword so it's fully legitimate as a table name. > I am not following. Sure, the WITH thing works too. The point is that given "SELECT ... FROM (UPDATE ...)", there is a wo

Re: update returning order by syntax error question

2019-09-12 Thread Adrian Klaver
On 9/12/19 6:44 AM, Tom Lane wrote: raf writes: It's almost as if the parser sees "update" as a possible table name (rather than a reserved word) and "tblname" as the alias for that table and it's expecting a comma or left/right/full etc. when it seess the "t". No, it's *exactly* as if that.

Re: Web GUI for PG table ?

2019-09-12 Thread Basques, Bob (CI-StPaul)
David, You should find a fit in here somewhere: https://pgdash.io/blog/postgres-gui-tools.html https://wiki.postgresql.org/wiki/Community_Guide_to_PostgreSQL_GUI_Tools Also, we’ve done some interesting things with building an interface inside of LibreOffice as well. It’s still a separated appr

Re: How to reformat output of "age()" function

2019-09-12 Thread Adrian Klaver
On 9/12/19 4:50 AM, Francisco Olarte wrote: Adrian: On Wed, Sep 11, 2019 at 11:19 PM Adrian Klaver wrote: On 9/11/19 9:34 AM, Francisco Olarte wrote: ... If you want to know the elapsed minutes between two timestamps, it might be better to do it directly, extract the epoch from both ( second

Web GUI for PG table ?

2019-09-12 Thread David Gauthier
Hi: We're considering replacing a windows AccessDB based system with PG. Access was chosen because of it's GUI to its tables (looks and behaves like a SS). But performance can be volatile given the fact that the AccessDB front-ends and back-end are at different sites 1000+ miles apart. The belief

Re: update returning order by syntax error question

2019-09-12 Thread Tom Lane
raf writes: > It's almost as if the parser sees "update" as a possible > table name (rather than a reserved word) and "tblname" > as the alias for that table and it's expecting a comma > or left/right/full etc. when it seess the "t". No, it's *exactly* as if that. UPDATE is an unreserved keyword

Re: How to reformat output of "age()" function

2019-09-12 Thread Francisco Olarte
Adrian: On Wed, Sep 11, 2019 at 11:19 PM Adrian Klaver wrote: > On 9/11/19 9:34 AM, Francisco Olarte wrote: ... > > If you want to know the elapsed minutes between two timestamps, it > > might be better to do it directly, extract the epoch from both ( > > seconds ), substract, divide by 60 trunca

Re: How to reformat output of "age()" function

2019-09-12 Thread Francisco Olarte
OOps, I got it bad: On Thu, Sep 12, 2019 at 1:50 PM Francisco Olarte wrote: > timestamp / interval arithmetic is really a hairy thing. ( As shown > below, start point carefully taken to avoid crossing dsts ) It was chosen to FORCE, not AVOID, crossing dst. > cdrs=# select x, '2019.11.20 20:00:

Re: pgbouncer with ldap

2019-09-12 Thread Ayub M
Okay, thanks for the response. Unfortunately Aurora does not expose these files or I should say there is no concept of these files in AWS managed Aurora DB service. Anyway I will give a try and let you know. On Thu, Sep 12, 2019 at 1:52 AM Achilleas Mantzios < ach...@matrix.gatewaynet.com> wrote: