[GENERAL] plpgsql function with offset - Postgres 9.1

2017-05-28 Thread Patrick B
Hi guys, I am running a background task on my DB, which will copy data from tableA to tableB. For that, I'm writing a PL/PGSQL function which basically needs to do the following: 1. Select the data from tableA 2. The limit will be put when calling the function 3. insert the selected

[GENERAL] pgAdmin4 - no Query tools available

2017-05-28 Thread elliot_rock
Mac OSX, No query tools on right click on database or via the tool menu. Possible issues: I installed postgresql-9.6.3-1-osx.dmg after I installed pgAdmin in order to setup a localhosted db. Previous to this I was using pgAdmin4 on a remote server to an acceptable standard. Thanks -- View

Re: [GENERAL] SELECT statement with sub-queries

2017-05-28 Thread Adrian Klaver
On 05/28/2017 11:54 AM, Michelle Konzack wrote: On 2017-05-28 11:23:47 Adrian Klaver hacked into the keyboard: On 05/28/2017 10:53 AM, Michelle Konzack wrote: SELECT * FROM products WHERE category IN (SELECT categories.cat FROM categories WHERE categories.serial =

Re: [GENERAL] SELECT statement with sub-queries

2017-05-28 Thread David G. Johnston
On Sun, May 28, 2017 at 11:54 AM, Michelle Konzack wrote: > > I want to replace in the output the numerical ID from "products.category" > with the value of "categories.cat", where the "products.category" match > the "categories.serial" > ​Then go and read the first

Re: [GENERAL] Help with terminology to describe what my software does please?

2017-05-28 Thread Neil Anderson
>> Cluster comparison would only occur if you have two or more clusters on >> the same server, although it's possible to compare across servers, > > > Explain, because as I understand it a server = one cluster: > I think he was using server in the server=one machine sense, ie a single

Re: [GENERAL] Help with terminology to describe what my software does please?

2017-05-28 Thread Neil Anderson
> > > Cluster comparison would only occur if you have two or more clusters on > the same server, although it's possible to compare across servers, > but that would involve a lot more work. AFAIK, the only differences for a > cluster would be: > 1. PostgreSQL version > 2. path to database > 3.

Re: [GENERAL] SELECT statement with sub-queries

2017-05-28 Thread Michelle Konzack
On 2017-05-28 20:19:59 m...@ft-c.de hacked into the keyboard: > Hallo, > > SELECT * > FROM products > WHERE exists > (SELECT categories.cat FROM categories WHERE > categories.serial==products.category); This does not give an error but does nothing > or > SELECT * FROM products > WHERE

Re: [GENERAL] SELECT statement with sub-queries

2017-05-28 Thread Michelle Konzack
On 2017-05-28 11:23:47 Adrian Klaver hacked into the keyboard: > On 05/28/2017 10:53 AM, Michelle Konzack wrote: > >> > >>SELECT * FROM products WHERE category IN > >> (SELECT categories.cat FROM categories WHERE > >> categories.serial = products.category); > Because you are comparing

Re: [GENERAL] SELECT statement with sub-queries

2017-05-28 Thread ml
On 28.05.2017 20:19, m...@ft-c.de wrote: Hallo, SELECT * FROM products WHERE exists (SELECT categories.cat FROM categories WHERE categories.serial==products.category); categories.serial = products.category); -- one equal sign or SELECT * FROM products WHERE category IN

Re: [GENERAL] SELECT statement with sub-queries

2017-05-28 Thread Adrian Klaver
On 05/28/2017 10:53 AM, Michelle Konzack wrote: On 2017-05-29 03:24:54 rob stone hacked into the keyboard: You only need a single equals sign in SQL. SELECT * FROM products WHERE category IN (SELECT categories.cat FROM categories WHERE categories.serial = products.category); I have

Re: [GENERAL] SELECT statement with sub-queries

2017-05-28 Thread ml
Hallo, SELECT * FROM products WHERE exists (SELECT categories.cat FROM categories WHERE categories.serial==products.category); or SELECT * FROM products WHERE category IN (SELECT categories.cat FROM categories); On 28.05.2017 19:03, Michelle Konzack wrote: Hello *, I try to

Re: [GENERAL] SELECT statement with sub-queries

2017-05-28 Thread Michelle Konzack
On 2017-05-29 03:24:54 rob stone hacked into the keyboard: > You only need a single equals sign in SQL. > > SELECT * FROM products WHERE category IN  >     (SELECT categories.cat FROM categories WHERE  >     categories.serial = products.category); I have tried this too, but then I get: ERROR:  

Re: [GENERAL] SELECT statement with sub-queries

2017-05-28 Thread rob stone
Hello, On Sun, 2017-05-28 at 20:03 +0300, Michelle Konzack wrote: > Hello *, > > I try to get columns from my database with a singel SELECT, but I > stuck. > > I have 3 tables like: > > > 1)  categories (serial,cat) > > 2)  manufacturers (serial,m_name) > > 3)  products

Re: [GENERAL] SELECT statement with sub-queries

2017-05-28 Thread Amitabh Kant
On Sun, May 28, 2017 at 10:33 PM, Michelle Konzack wrote: > Hello *, > > I try to get columns from my database with a singel SELECT, but I stuck. > > I have 3 tables like: > > > 1) categories (serial,cat) > > 2) manufacturers (serial,m_name) > > 3) products

Re: [GENERAL] Postgres 10 Beta1 - pg_upgrade fails on Windows 10

2017-05-28 Thread Thomas Kellerer
Adrian Klaver schrieb am 28.05.2017 um 17:51: After I finally found the EnterpriseDB Beta binaries (they are pretty well hidden) I tested with those, and everything works fine there. For those following along, where would that be? Here they are:

[GENERAL] SELECT statement with sub-queries

2017-05-28 Thread Michelle Konzack
Hello *, I try to get columns from my database with a singel SELECT, but I stuck. I have 3 tables like: 1) categories (serial,cat) 2) manufacturers (serial,m_name) 3) products (serial,category,manufacturer,p_name) where the "category" and "manufacturer" are numerical IDs from the two

Re: [GENERAL] Question regarding the output of postgresql *explain* command

2017-05-28 Thread Arup Rakshit
Hi Tom, Thanks, I’ll read this page. > On May 28, 2017, at 8:36 PM, Tom Lane wrote: > > Arup Rakshit writes: >> I was reading to day how indexing works. And I was trying some query, for >> example below one. What the range basically means

Re: [GENERAL] Postgres 10 Beta1 - pg_upgrade fails on Windows 10

2017-05-28 Thread Tom Lane
Thomas Kellerer writes: > Tom Lane schrieb am 26.05.2017 um 20:18: >>> The error message reported in the logfile is: >>> pg_dump: unrecognized collation provider: p >> Ugh :-( ... seems like a rather obvious typo in dumpCollation(). >> Thanks for finding it! > When I drop

Re: [GENERAL] Postgres 10 Beta1 - pg_upgrade fails on Windows 10

2017-05-28 Thread Adrian Klaver
On 05/28/2017 08:41 AM, Thomas Kellerer wrote: Tom Lane schrieb am 26.05.2017 um 20:18: Apparently BigSQL forgot to include contrib/xml2 in their distribution; you should ping them about that one. I can confirm that it's a BigSQL problem. After I finally found the EnterpriseDB Beta

Re: [GENERAL] Postgres 10 Beta1 - pg_upgrade fails on Windows 10

2017-05-28 Thread Thomas Kellerer
Tom Lane schrieb am 26.05.2017 um 20:18: I just tried pg_upgrade from the Postgres 10 Beta1 (from the BigSQL distribution) to upgrade a 9.6 cluster. pg_upgrade --check fails with the following messages: could not load library "$libdir/pgxml": ERROR: could not load library

Re: [GENERAL] Help with terminology to describe what my software does please?

2017-05-28 Thread Adrian Klaver
On 05/28/2017 07:53 AM, Melvin Davidson wrote: Cluster comparison would only occur if you have two or more clusters on the same server, although it's possible to compare across servers, Explain, because as I understand it a server = one cluster:

Re: [GENERAL] Help with terminology to describe what my software does please?

2017-05-28 Thread Tom Lane
Neil Anderson writes: > I guess I don't know what is the most common way to say that it > compares everything but the data. Any suggestions from your > experience? FWIW, I think it's pretty common to use "schema" in an abstract way to mean "the structure of your

Re: [GENERAL] Question regarding the output of postgresql *explain* command

2017-05-28 Thread Tom Lane
Arup Rakshit writes: > I was reading to day how indexing works. And I was trying some query, for > example below one. What the range basically means (cost=0.28..8.30 ? I don’t > understand this. https://www.postgresql.org/docs/current/static/using-explain.html

Re: [GENERAL] Help with terminology to describe what my software does please?

2017-05-28 Thread Melvin Davidson
On Sun, May 28, 2017 at 9:51 AM, Adrian Klaver wrote: > On 05/28/2017 05:49 AM, Neil Anderson wrote: > >> Hi, >> >> I'm working on a tool that can compare the properties of Postgres >> objects from different instances, finding the differences and >> outputting the

[GENERAL] Question regarding the output of postgresql *explain* command

2017-05-28 Thread Arup Rakshit
Hi, I was reading to day how indexing works. And I was trying some query, for example below one. What the range basically means (cost=0.28..8.30 ? I don’t understand this. ——— arup@ror ~/part-time-projects/entrylvl (add_index_to_job_sources)$ rails db psql (9.5.0) Type "help" for

Re: [GENERAL] Help with terminology to describe what my software does please?

2017-05-28 Thread Adrian Klaver
On 05/28/2017 05:49 AM, Neil Anderson wrote: Hi, I'm working on a tool that can compare the properties of Postgres objects from different instances, finding the differences and outputting the update SQL. It can compare objects that are defined at the cluster, database or schema level. As such

Re: [GENERAL] wal_retrieve_retry_interval

2017-05-28 Thread Ludovic Vaugeois-Pepin
On Sun, May 28, 2017 at 9:49 AM, Ludovic Vaugeois-Pepin wrote: > > > On Sun, May 28, 2017 at 6:54 AM, Michael Paquier > wrote: >> >> On Sat, May 27, 2017 at 2:40 PM, Ludovic Vaugeois-Pepin >> wrote: >> > Say, with 9.6.2, a

[GENERAL] Help with terminology to describe what my software does please?

2017-05-28 Thread Neil Anderson
Hi, I'm working on a tool that can compare the properties of Postgres objects from different instances, finding the differences and outputting the update SQL. It can compare objects that are defined at the cluster, database or schema level. As such I'm finding it difficult to describe what the

Fwd: [GENERAL] wal_retrieve_retry_interval

2017-05-28 Thread Ludovic Vaugeois-Pepin
On Sun, May 28, 2017 at 6:54 AM, Michael Paquier wrote: > On Sat, May 27, 2017 at 2:40 PM, Ludovic Vaugeois-Pepin > wrote: > > Say, with 9.6.2, a hot_standby fails to connect to a replication slot: > > FATAL: could not start WAL streaming: