Re: Intersection or zero-column queries

2017-12-21 Thread Ken Tanzer
I noticed I get this behavior in 9.6, but in 9.2 an empty select results in a syntax error. Which just got me curious what caused the change, if it was deliberate, and if one or the other is more proper behavior. Cheers, Ken -- AGENCY Software A Free Software data system By and for non-profits

Re: [v10] CREATE TEMP FUNCTION/CREATE FUNCTION PG_TEMP.X

2017-12-21 Thread Vincenzo Romano
2017-12-22 0:50 GMT+01:00 Melvin Davidson : > > > > On Thu, Dec 21, 2017 at 12:07 PM, Vincenzo Romano > wrote: >> >> 2017-12-21 17:56 GMT+01:00 Tom Lane : >> > Vincenzo Romano writes: >> >> 2017-12-21 17:52 GMT+01:00 Tom Lane : >> >>> You have to schema-qualify the temp function name when callin

Re: Intersection or zero-column queries

2017-12-21 Thread Tom Lane
"David G. Johnston" writes: > On Thursday, December 21, 2017, Tom Lane wrote: >> So yeah, it's wrong ... but personally I'm not terribly excited >> about fixing it. Maybe somebody else wants to; but what's the >> practical use? > How about just erroring out? Hm, yeah, inserting a FEATURE_NOT_S

Re: Intersection or zero-column queries

2017-12-21 Thread David G. Johnston
On Thursday, December 21, 2017, Tom Lane wrote: > which would only be the right plan for UNION ALL. > > So yeah, it's wrong ... but personally I'm not terribly excited > about fixing it. Maybe somebody else wants to; but what's the > practical use? > How about just erroring out? David J.

Re: Intersection or zero-column queries

2017-12-21 Thread Tom Lane
Victor Yegorov writes: > However, if I'll do `EXCPET` or `INTERSECT` of such queries, I'll get 2 > rows: > postgres=# select except select; > -- > (2 rows) > postgres=# select intersect all select; > -- > (2 rows) > Why is it so? The UNION case seems wrong as well: regr

Re: Foreign Data Wrapper

2017-12-21 Thread Michael Paquier
On Thu, Dec 21, 2017 at 12:24:25PM +, Virendra Shaktawat - Quipment India wrote: > [Quipment Logo] > I have stuck at foreign data wrapper. I am accessing the form MS Sql Server. > Foreign table has been created with data. unfortunately I am unable to > perform DML operation like insert, upda

Re: Intersection or zero-column queries

2017-12-21 Thread David G. Johnston
On Thu, Dec 21, 2017 at 5:08 PM, Victor Yegorov wrote: > > Also, intersection should not return more rows, than there're in the > sub-relations. > > Doh!, I think I got UNION into my mind somewhere in that... David J.

Re: Intersection or zero-column queries

2017-12-21 Thread Victor Yegorov
2017-12-22 2:03 GMT+02:00 David G. Johnston : > On Thu, Dec 21, 2017 at 4:53 PM, Victor Yegorov > wrote: > >> postgres=# select except select; >> -- >> (2 rows) >> postgres=# select intersect all select; >> -- >> (2 rows) >> >> Why is it so? >> Should this be reported as a

Re: Intersection or zero-column queries

2017-12-21 Thread David G. Johnston
On Thu, Dec 21, 2017 at 4:53 PM, Victor Yegorov wrote: > postgres=# select except select; > -- > (2 rows) > postgres=# select intersect all select; > -- > (2 rows) > > Why is it so? > Should this be reported as a bug?.. ;) > ​The intersection case seems correct - one row

Intersection or zero-column queries

2017-12-21 Thread Victor Yegorov
Greetings. One can issue an empty `SELECT` statement and 1 row without columns will be returned: postgres=# select; -- (1 row) However, if I'll do `EXCPET` or `INTERSECT` of such queries, I'll get 2 rows: postgres=# select except select; -- (2 rows) postgres=# select

Re: [v10] CREATE TEMP FUNCTION/CREATE FUNCTION PG_TEMP.X

2017-12-21 Thread Melvin Davidson
On Thu, Dec 21, 2017 at 12:07 PM, Vincenzo Romano < vincenzo.rom...@notorand.it> wrote: > 2017-12-21 17:56 GMT+01:00 Tom Lane : > > Vincenzo Romano writes: > >> 2017-12-21 17:52 GMT+01:00 Tom Lane : > >>> You have to schema-qualify the temp function name when calling it, too. > > > >> So search_p

Re: Foreign Data Wrapper

2017-12-21 Thread Nicolas Paris
Le 21 déc. 2017 à 13:24, Virendra Shaktawat - Quipment India écrivait : > Quipment Logo > > Hello , > > > > I have stuck at foreign data wrapper. I am accessing the form MS Sql Server. > Foreign table has been created with data. unfortunately I am unable to perform > DML operation like insert,

Re: Foreign Data Wrapper

2017-12-21 Thread John R Pierce
On 12/21/2017 5:14 AM, Virendra Shaktawat - Quipment India wrote: odbc_fdw please don't top post, and please don't use graphics and HTML in your email, this is a text based mailling list adhering to bottom/interleaved posting standards. While I'm not directly familiar with odbc_fdw, I sus

Re: Deadlock with one table - PostgreSQL is doing it right

2017-12-21 Thread Rakesh Kumar
> The tool Im using is "sqlplus". By default you are always in a transaction > and > auto-commit only occur on exit.  Its been a while since I worked with oracle. I remember I use to add the following two lines at the top: SET AUTOCOMMIT OFF whenever SQLERROR EXIT ROLLBACK IIRC, adding the abo

Re: Deadlock with one table - PostgreSQL is doing it right

2017-12-21 Thread Hans Schou
2017-12-21 12:41 GMT+01:00 Rakesh Kumar : > Could it be that the tool you are using in Oracle is doing commit while > exiting out due to Deadlock, because there is no explicit rollback. > The tool Im using is "sqlplus". By default you are always in a transaction and auto-commit only occur on exit

Re: Deadlock with one table - PostgreSQL is doing it right

2017-12-21 Thread Hans Schou
2017-12-21 17:46 GMT+01:00 Jeremy Finzel : > It's hard to follow how the 2 videos relate, because you don't run the > same SQL both places. You first update where i = 2 in Postgres and i = 1 > in Oracle. > Well OK. I made a new one for PostgreSQL: https://youtu.be/En8EFv90yCc Now with same backg

Re: [v10] CREATE TEMP FUNCTION/CREATE FUNCTION PG_TEMP.X

2017-12-21 Thread Vincenzo Romano
2017-12-21 17:56 GMT+01:00 Tom Lane : > Vincenzo Romano writes: >> 2017-12-21 17:52 GMT+01:00 Tom Lane : >>> You have to schema-qualify the temp function name when calling it, too. > >> So search_path is not used with functions? > > pg_temp is explicitly ignored when searching for functions/operat

Re: [v10] CREATE TEMP FUNCTION/CREATE FUNCTION PG_TEMP.X

2017-12-21 Thread Tom Lane
Vincenzo Romano writes: > 2017-12-21 17:52 GMT+01:00 Tom Lane : >> You have to schema-qualify the temp function name when calling it, too. > So search_path is not used with functions? pg_temp is explicitly ignored when searching for functions/operators. Otherwise, installing a trojan horse is ju

Re: [v10] CREATE TEMP FUNCTION/CREATE FUNCTION PG_TEMP.X

2017-12-21 Thread Vincenzo Romano
2017-12-21 17:52 GMT+01:00 Tom Lane : > Vincenzo Romano writes: >> It seems I cannot use a temporary function. > > You have to schema-qualify the temp function name when calling it, too. > > regards, tom lane Hi. So search_path is not used with functions? -- Vincenzo Rom

Re: [v10] CREATE TEMP FUNCTION/CREATE FUNCTION PG_TEMP.X

2017-12-21 Thread Tom Lane
Vincenzo Romano writes: > It seems I cannot use a temporary function. You have to schema-qualify the temp function name when calling it, too. regards, tom lane

Re: Deadlock with one table - PostgreSQL is doing it right

2017-12-21 Thread Jeremy Finzel
It's hard to follow how the 2 videos relate, because you don't run the same SQL both places. You first update where i = 2 in Postgres and i = 1 in Oracle. On Thu, Dec 21, 2017 at 4:37 AM, Hans Schou wrote: > Hi > > FYI - if it has any interest > > During my preparation for describing what happe

[v10] CREATE TEMP FUNCTION/CREATE FUNCTION PG_TEMP.X

2017-12-21 Thread Vincenzo Romano
Hi all. It seems I cannot use a temporary function. I know there's no "CREATE TEMP FUNCTION". But while I can do tmp2=# CREATE FUNCTION pg_temp.x( OUT b BOOL ) language PLPGSQL AS $L0$ BEGIN b := TRUE; END; $L0$; SET search_path TO pg_temp,"$user", public; the following fails: tmp2=# SELECT *

Re: problems with postgresql 10.1 hba_conf on fedora 27

2017-12-21 Thread Matt Zagrabelny
On Wed, Dec 20, 2017 at 9:30 PM, support-tiger wrote: > > No, the docs for understanding hba_conf are not good (yes we can read and > are fairly smart) - we made suggestions the last time for several case > examples and were ignored - okay, simplicity of pouchdb/couchdb is > getting our atten

Re:

2017-12-21 Thread Andreas Kretschmer
Am 21.12.2017 um 07:31 schrieb Ramar Duraisamy: Hi friends, This is Ramar and i have accidentally deleted database in postgresql through pg admin. My backup restore not working. Can you explain that in more detail? How did you take the backup, how did you tried the restore, which error-mes

Re: Dynamic Enum?

2017-12-21 Thread Olivier Macchioni
> On 21 Dec 2017, at 15:17, Melvin Davidson wrote: > > On Thu, Dec 21, 2017 at 5:34 AM, Olivier Macchioni > mailto:olivier.macchi...@wingo.ch>> wrote: > Hello, > > First post on the list, please be indulgent :) > > [...] > > > >- use ENUMs to reduce the storage space > > First, please incl

Re: Dynamic Enum?

2017-12-21 Thread Melvin Davidson
On Thu, Dec 21, 2017 at 5:34 AM, Olivier Macchioni < olivier.macchi...@wingo.ch> wrote: > Hello, > > First post on the list, please be indulgent :) > > I'm working on a fairly large DB (for me) - 23 GB data, 42 GB indexes, 100 > M rows for my biggest table - and trying to find possible optimisatio

Re: Migration to PGLister - After

2017-12-21 Thread Magnus Hagander
On Mon, Nov 20, 2017 at 10:09 PM, Magnus Hagander wrote: > On Mon, Nov 20, 2017 at 9:31 PM, Michael Nolan wrote: > >> >> >> On Mon, Nov 20, 2017 at 9:45 AM, Stephen Frost >> wrote: >> >>> >>> This list has now been migrated to new mailing list software known as >>> 'PGLister'. This migration w

RE: Foreign Data Wrapper

2017-12-21 Thread Virendra Shaktawat - Quipment India
Hi Atri, odbc_fdw Regards, Virendra Shaktawat Database Developer R&D .Net Department T / +91 (0) 90999 07116 virendra.shaktawat@ / www.quipment.in From: Atri Sharma [mailto:atri.j...@gmail.com] Sent: 21 December 2017 06:21 PM To: Virendra Shaktawat - Quipment India Cc

Re: Foreign Data Wrapper

2017-12-21 Thread Atri Sharma
Which FDW? On Thu, Dec 21, 2017 at 5:54 PM, Virendra Shaktawat - Quipment India < virendra.shakta...@quipment.nl> wrote: > [image: Quipment Logo] > > Hello , > > > > I have stuck at foreign data wrapper. I am accessing the form MS Sql > Server. Foreign table has been created with data. unfortun

Foreign Data Wrapper

2017-12-21 Thread Virendra Shaktawat - Quipment India
[Quipment Logo] Hello , I have stuck at foreign data wrapper. I am accessing the form MS Sql Server. Foreign table has been created with data. unfortunately I am unable to perform DML operation like insert, update and delete on foreign table. Whenever I tried to perform DML operation on foreig

Re: What does tcop stand for?

2017-12-21 Thread Alvaro Herrera
Tatsuo Ishii wrote: > >>> currently browsing the source code in src/include/tcop. What does tcop > >>> stand for? Can not find any hints in the files. > > > >>Traffic cop. > > > > Thanks > > cop mean? > > A cop means a policeman. Probably the name came from that it is > responsible for the

Re: Deadlock with one table - PostgreSQL is doing it right

2017-12-21 Thread Rakesh Kumar
Could it be that the tool you are using in Oracle is doing commit while exiting out due to Deadlock, because there is no explicit rollback.

Re: psycopg2 and java gssapi questions

2017-12-21 Thread Stephen Frost
Magnus, Mike, * Magnus Hagander (mag...@hagander.net) wrote: > On Wed, Dec 20, 2017 at 8:42 PM, Mike Feld wrote: > > > Is it possible to authenticate with Postgres from a standalone application > > using gssapi? In other words, I am able to authenticate with Postgres when > > a human has logged

Re: psycopg2 and java gssapi questions

2017-12-21 Thread Dave Cramer
On 21 December 2017 at 05:27, Magnus Hagander wrote: > > > On Wed, Dec 20, 2017 at 8:42 PM, Mike Feld wrote: > >> Is it possible to authenticate with Postgres from a standalone >> application using gssapi? In other words, I am able to authenticate with >> Postgres when a human has logged in to e

[no subject]

2017-12-21 Thread Ramar Duraisamy
Hi friends, This is Ramar and i have accidentally deleted database in postgresql through pg admin. My backup restore not working. Can i recover my deleted database in postgresql. Anyone having solution kindly reply me. Thanks & Regards, Ramar D

Deadlock with one table - PostgreSQL is doing it right

2017-12-21 Thread Hans Schou
Hi FYI - if it has any interest During my preparation for describing what happens when two processes update the same row in a table, I came across that PostgreSQL is doing right and Oracle is doing it wrong. The situation is a process which get a deadlock, but because it is a script, it sends a

Dynamic Enum?

2017-12-21 Thread Olivier Macchioni
Hello, First post on the list, please be indulgent :) I'm working on a fairly large DB (for me) - 23 GB data, 42 GB indexes, 100 M rows for my biggest table - and trying to find possible optimisations on the storage requirements... and hopefully trying to keep more indexes in RAM. This DB is a

Re: psycopg2 and java gssapi questions

2017-12-21 Thread Magnus Hagander
On Wed, Dec 20, 2017 at 8:42 PM, Mike Feld wrote: > Is it possible to authenticate with Postgres from a standalone application > using gssapi? In other words, I am able to authenticate with Postgres when > a human has logged in to either Windows or Linux and generated a ticket, > but is it possib