Re: Using a different column name in a foreign table

2022-01-21 Thread David G. Johnston
On Fri, Jan 21, 2022 at 11:32 AM Alanoly Andrews wrote: > Thanks Adrian. I was aware of that. > > But...in the case of FT definition, the quotes are mandatory after > column_name in options. And it is a single quote. > Using an unqualified "quote" is this kind of discussion should be avoided. T

Re: Using a different column name in a foreign table

2022-01-21 Thread Adrian Klaver
On 1/21/22 10:32 AM, Alanoly Andrews wrote: Thanks Adrian. I was aware of that. But...in the case of FT definition, the quotes are mandatory after column_name in options. And it is a single quote. The problem here may be is that the "create foreign table" statement accepts only lower case aft

Re: Using a different column name in a foreign table

2022-01-21 Thread Tom Lane
Alanoly Andrews writes: > But...in the case of FT definition, the quotes are mandatory after > column_name in options. And it is a single quote. Right. That string literal is not case-folded, so it has to accurately match the actual spelling of the remote column name. Anything else we might do

RE: Using a different column name in a foreign table

2022-01-21 Thread Alanoly Andrews
: Friday, January 21, 2022 1:14 PM To: Alanoly Andrews ; Tom Lane ; Guillaume Lelarge Cc: pgsql-general@lists.postgresql.org Subject: Re: Using a different column name in a foreign table [Email External/Externe] Caution opening links or attachments/attention lors de l'ouverture de liens ou de

Re: Using a different column name in a foreign table

2022-01-21 Thread Adrian Klaver
On 1/21/22 10:04 AM, Alanoly Andrews wrote: Following up on my previous message, there was a related problem with FT definitions for which I have a workaround. It seems that the new column_name after "options" in an FT definition cannot be in upper case. See below: When I define a foreign table

RE: Using a different column name in a foreign table

2022-01-21 Thread Alanoly Andrews
ndrews Sent: Friday, January 21, 2022 12:03 PM To: Tom Lane ; Guillaume Lelarge ; Adrian Klaver Cc: pgsql-general@lists.postgresql.org Subject: RE: Using a different column name in a foreign table Thanks Tom, Guillaume and Adrian. My mistake in reversing the order of name and newname in the definition. A

RE: Using a different column name in a foreign table

2022-01-21 Thread Alanoly Andrews
ain later, if needed. Thanks. A.A. -Original Message- From: Tom Lane [mailto:t...@sss.pgh.pa.us] Sent: Friday, January 21, 2022 11:52 AM To: Alanoly Andrews Cc: pgsql-general@lists.postgresql.org Subject: Re: Using a different column name in a foreign table [Email External/Extern

Re: Using a different column name in a foreign table

2022-01-21 Thread Tom Lane
Alanoly Andrews writes: > I see that the syntax for the creation of a foreign table allows you to use a > column name in the FT that is different from the one in the base table. Such > a "create foreign table" statement executes successfully and creates the FT. > But when I query the FT, I get

Re: Using a different column name in a foreign table

2022-01-21 Thread Guillaume Lelarge
Hi, Le ven. 21 janv. 2022 à 17:24, Alanoly Andrews a écrit : > Hello, > > I see that the syntax for the creation of a foreign table allows you to > use a column name in the FT that is different from the one in the base > table. Such a "create foreign table" statement executes successfully and >

Re: Using a different column name in a foreign table

2022-01-21 Thread Adrian Klaver
On 1/21/22 08:24, Alanoly Andrews wrote: Hello, I see that the syntax for the creation of a foreign table allows you to use a column name in the FT that is different from the one in the base table. Such a "create foreign table" statement executes successfully and creates the FT. But when I que

Using a different column name in a foreign table

2022-01-21 Thread Alanoly Andrews
Hello, I see that the syntax for the creation of a foreign table allows you to use a column name in the FT that is different from the one in the base table. Such a "create foreign table" statement executes successfully and creates the FT. But when I query the FT, I get an error wrt to the colum