Re: [GENERAL] ERROR: missing FROM-clause entry for table

2016-02-09 Thread Charles Clavadetscher
Hello > -Original Message- > From: pgsql-general-ow...@postgresql.org > [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of bigkev > Sent: Mittwoch, 10. Februar 2016 08:11 > To: pgsql-general@postgresql.org > Subject: [GENERAL] ERROR: missing FROM-clause entry for table > > I am rec

Re: [GENERAL] ERROR: missing FROM-clause entry for table

2016-02-09 Thread Michael Paquier
On Wed, Feb 10, 2016 at 4:11 PM, bigkev wrote: > I am receiving this error for the query pasted below. > Is the LEFT JOIN on the table not enough? > What needs to happen here? > I am guess something to do with derived tables > > http://pastie.org/10715876 Please be sure to copy the content of you

Re: [GENERAL] PostgreSQL vs Firebird SQL

2016-02-09 Thread Chris Travers
Hi; On Wed, Feb 10, 2016 at 5:10 AM, ioan ghip wrote: > I have a Firebird SQL database running on one of my servers which has > about 50k inserts, about 100k updates and about 30k deletes every day. > There are about 4 million records in 24 tables. I have a bunch of stored > procedures, triggers

Re: [GENERAL] PostgreSQL vs Firebird SQL

2016-02-09 Thread David Grelaud
I confirm what Josh berkus said. The performance will not be a problem as soon as you manage your database very well (good configuration, good hardware, good queries, good data organisation...), like a lot of other competitors I think? We have never used Firebird but we use intensively PostgreSQL

[GENERAL] ERROR: missing FROM-clause entry for table

2016-02-09 Thread bigkev
I am receiving this error for the query pasted below. Is the LEFT JOIN on the table not enough? What needs to happen here? I am guess something to do with derived tables http://pastie.org/10715876 -- View this message in context: http://postgresql.nabble.com/ERROR-missing-FROM-clause-entry-for

Re: [GENERAL] PostgreSQL vs Firebird SQL

2016-02-09 Thread Josh berkus
On 02/10/2016 05:10 AM, ioan ghip wrote: I have a Firebird SQL database running on one of my servers which has about 50k inserts, about 100k updates and about 30k deletes every day. There are about 4 million records in 24 tables. I have a bunch of stored procedures, triggers, events and views tha

[GENERAL] PostgreSQL vs Firebird SQL

2016-02-09 Thread ioan ghip
I have a Firebird SQL database running on one of my servers which has about 50k inserts, about 100k updates and about 30k deletes every day. There are about 4 million records in 24 tables. I have a bunch of stored procedures, triggers, events and views that I'm using. Firebird works fairly well, bu

Re: [GENERAL] execute same query only one time?

2016-02-09 Thread Vitaly Burovoy
On 2/9/16, Johannes wrote: > Am 09.02.2016 um 00:56 schrieb Vitaly Burovoy: >> On 2/8/16, Johannes wrote: >>> Am 08.02.2016 um 21:50 schrieb Vitaly Burovoy: On 2/8/16, Johannes wrote: > increase speed, Speed will be at least the same. In your case either you have to use m

Re: [GENERAL] execute same query only one time?

2016-02-09 Thread Johannes
Am 09.02.2016 um 00:56 schrieb Vitaly Burovoy: > On 2/8/16, Johannes wrote: >> Am 08.02.2016 um 21:50 schrieb Vitaly Burovoy: >>> On 2/8/16, Johannes wrote: Am 08.02.2016 um 21:17 schrieb Vitaly Burovoy: > Hmm. Could you clarify why you don't want to pass id from the first > query

Re: [GENERAL] execute same query only one time?

2016-02-09 Thread Vitaly Burovoy
On 2/9/16, Marc Mamin wrote: > > Hi, > > is there a best practice to share data between two select statements? > > Hi, > I didn't check the whole thread Try it[1]. The thread is not so long (21 letters before yours) and it worth it. > so forgive me if this was already proposed, > but

Re: [GENERAL] execute same query only one time?

2016-02-09 Thread David G. Johnston
On Tue, Feb 9, 2016 at 12:16 PM, Marc Mamin wrote: > > Hi, > > is there a best practice to share data between two select statements? > > Hi, > I didn't check the whole thread so forgive me if this was already proposed, > but maybe you could do something like: > > create temp table

Re: [GENERAL] execute same query only one time?

2016-02-09 Thread Marc Mamin
Hi, is there a best practice to share data between two select statements? Hi, I didn't check the whole thread so forgive me if this was already proposed, but maybe you could do something like: create temp table result2 (...) query_1: WITH cte as (select ..), tmp as ( INSERT INTO

Re: [GENERAL] COALESCE requires NULL from scalar subquery has a type

2016-02-09 Thread Rowan Collins
David G. Johnston wrote on 08/02/2016 16:05: On Mon, Feb 8, 2016 at 8:25 AM, Geoff Winkless >wrote: On 8 February 2016 at 14:49, Tom Lane mailto:t...@sss.pgh.pa.us>> wrote: > Yup. The output column type of the sub-SELECT is determined without > reference

Re: [GENERAL] COALESCE requires NULL from scalar subquery has a type

2016-02-09 Thread Geoff Winkless
On 9 February 2016 at 15:16, David G. Johnston wrote: > Same error...I tested using the table as well...also the same error for > values of id between 1 and 3. Oh my. In my memory, this was working. I try it now, and it doesn't. Apologies: I've obviously managed to lose track of what worked and

Re: [GENERAL] COALESCE requires NULL from scalar subquery has a type

2016-02-09 Thread David G. Johnston
On Tue, Feb 9, 2016 at 7:56 AM, Geoff Winkless wrote: > On 9 February 2016 at 14:53, Tom Lane wrote: > > SELECT COALESCE((SELECT 'Yes' FROM gwtest WHERE id=4), 'No') AS valid; > > > > There's no null visible anywhere in that. I suppose that if there's > > no row with id=4, there would be a null

Re: [GENERAL] COALESCE requires NULL from scalar subquery has a type

2016-02-09 Thread Geoff Winkless
On 9 February 2016 at 14:53, Tom Lane wrote: > SELECT COALESCE((SELECT 'Yes' FROM gwtest WHERE id=4), 'No') AS valid; > > There's no null visible anywhere in that. I suppose that if there's > no row with id=4, there would be a null at runtime, Well yes, that was the whole point. > but that's no

Re: [GENERAL] COALESCE requires NULL from scalar subquery has a type

2016-02-09 Thread Tom Lane
Geoff Winkless writes: > I'm not asking that it coerce an actual value with a genuinely unknown > type to a text value: I'm simply suggesting that it's unnecessary for > COALESCE to coerce an unknown-typed NULL into anything (even if you > ignore that NULL is, as far as I know, equivalent, no matt

Re: [GENERAL] execute same query only one time?

2016-02-09 Thread David G. Johnston
On Tuesday, February 9, 2016, Vitaly Burovoy wrote: > On 2/9/16, Harald Fuchs > wrote: > > Johannes > writes: > > > >>> What the reason to execute all statements which return different > >>> columns at once? > >>> > Saving roundtrips, > >>> > >>> In most cases they are not so big. Getting a

Re: [GENERAL] COALESCE requires NULL from scalar subquery has a type

2016-02-09 Thread Merlin Moncure
On Tue, Feb 9, 2016 at 5:42 AM, Geoff Winkless wrote: > On 8 February 2016 at 16:05, David G. Johnston > wrote: >> While explicit casting of literals can at times be annoying and seemingly >> unncessary I wouldn't call it unintuitive. > > Well that very much depends on your definition of intu

Re: [GENERAL] fast refresh materialized view

2016-02-09 Thread Michael Paquier
On Tue, Feb 9, 2016 at 12:32 AM, Nguyễn Trần Quốc Vinh wrote: > > Thank you very much. We did n't think about that. We would like to choose > APACHE LICENSE. We apologize for late reply. And that would be incompatible with the PostgreSQL license I guess, per concerns with patents and similar stuf

Re: [GENERAL] execute same query only one time?

2016-02-09 Thread Vitaly Burovoy
On 2/9/16, Harald Fuchs wrote: > Johannes writes: > >>> What the reason to execute all statements which return different >>> columns at once? >>> Saving roundtrips, >>> >>> In most cases they are not so big. Getting a bunch of duplicated data >>> is wasting you network bandwidth and don't in

Re: [GENERAL] COALESCE requires NULL from scalar subquery has a type

2016-02-09 Thread Geoff Winkless
On 8 February 2016 at 16:05, David G. Johnston wrote: > While explicit casting of literals can at times be annoying and seemingly > unncessary I wouldn't call it unintuitive. Well that very much depends on your definition of intuitive. If something is "seemingly unnecessary" I would say that'

Re: [GENERAL] no pg_hba.conf entry for replication connection

2016-02-09 Thread Josh berkus
On 02/09/2016 11:44 AM, Алексей Митропольский wrote: Hello, I have tried to set up streaming replication (Postgres 9.4.5.3 Linux). pg_hba.conf on the master server have entry: host replication postgres 192.168.50.36 trust I don't recommend using "trust" for this. Use a .pgpass file instead

[GENERAL] no pg_hba.conf entry for replication connection

2016-02-09 Thread Алексей Митропольский
Hello, I have tried to set up streaming replication (Postgres 9.4.5.3 Linux). pg_hba.conf on the master server have entry: host replication postgres 192.168.50.36 trust When I start the standby server (192.168.50.36) I get errors in the logs: LOG: entering standby mode LOG: restored log file "000

Re: [GENERAL] execute same query only one time?

2016-02-09 Thread Harald Fuchs
Johannes writes: >> What the reason to execute all statements which return different >> columns at once? >> >>> Saving roundtrips, >> >> In most cases they are not so big. Getting a bunch of duplicated data >> is wasting you network bandwidth and don't increase speed. > > In my and your example