Обсуждение: [GENERAL] column names and dollar sign
Hi
Ran into the following statement
CREATE TABLE test(
Date$ date,
Month_Number$ int,
Month$ varchar(10),
Year$ int
);
While it does execute, I wonder if the $ has any special meaning ?
Can anyone shed some light please ?
Thanks
Armand
> On May 17, 2017, at 2:02 PM, Armand Pirvu (home) <armand.pirvu@gmail.com> wrote: > > Hi > > Ran into the following statement > > CREATE TABLE test( > Date$ date, > Month_Number$ int, > Month$ varchar(10), > Year$ int > ); > > > While it does execute, I wonder if the $ has any special meaning ? > > Can anyone shed some light please ? No special meaning to postgresql - in postgresql a dollar sign is a valid character in an identifier. It might have some special meaning to the app that was using it, perhaps. Cheers, Steve
Thank you Steve — Armand On May 17, 2017, at 4:10 PM, Steve Atkins <steve@blighty.com> wrote: > >> On May 17, 2017, at 2:02 PM, Armand Pirvu (home) <armand.pirvu@gmail.com> wrote: >> >> Hi >> >> Ran into the following statement >> >> CREATE TABLE test( >> Date$ date, >> Month_Number$ int, >> Month$ varchar(10), >> Year$ int >> ); >> >> >> While it does execute, I wonder if the $ has any special meaning ? >> >> Can anyone shed some light please ? > > No special meaning to postgresql - in postgresql a dollar sign is a valid character in an identifier. > > It might have some special meaning to the app that was using it, perhaps. > > Cheers, > Steve > > > > -- > Sent via pgsql-general mailing list (pgsql-general@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-general
"Armand Pirvu (home)" <armand.pirvu@gmail.com> writes:
> Ran into the following statement
> CREATE TABLE test(
> Date$ date,
> Month_Number$ int,
> Month$ varchar(10),
> Year$ int
> );
> While it does execute, I wonder if the $ has any special meaning ?
Postgres thinks it's a valid identifier character, as long as it's
not the first character. I don't believe it's standard SQL, but
we hacked it in a long time ago for compatibility with Oracle or
somebody like that.
regards, tom lane
Thanks Tom Armand On May 17, 2017, at 4:14 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote: > "Armand Pirvu (home)" <armand.pirvu@gmail.com> writes: >> Ran into the following statement > >> CREATE TABLE test( >> Date$ date, >> Month_Number$ int, >> Month$ varchar(10), >> Year$ int >> ); > >> While it does execute, I wonder if the $ has any special meaning ? > > Postgres thinks it's a valid identifier character, as long as it's > not the first character. I don't believe it's standard SQL, but > we hacked it in a long time ago for compatibility with Oracle or > somebody like that. > > regards, tom lane
>> "Armand Pirvu (home)" <armand.pirvu@gmail.com> writes: >>> Ran into the following statement >> >>> CREATE TABLE test( >>> Date$ date, >>> Month_Number$ int, >>> Month$ varchar(10), >>> Year$ int >>> ); A strange naming convention. It has a whiff of Visual Basic Type Characters about it, https://docs.microsoft.com/en-us/dotnet/articles/visual-basic/programming-guide/language-features/data-types/type-characters. Any chance there is a connection there? -- Neil Anderson neil@postgrescompare.com https://www.postgrescompare.com
On 18/05/17 11:32, Neil Anderson wrote: >>> "Armand Pirvu (home)" <armand.pirvu@gmail.com> writes: >>>> Ran into the following statement >>>> CREATE TABLE test( >>>> Date$ date, >>>> Month_Number$ int, >>>> Month$ varchar(10), >>>> Year$ int >>>> ); > A strange naming convention. It has a whiff of Visual Basic Type > Characters about it, > https://docs.microsoft.com/en-us/dotnet/articles/visual-basic/programming-guide/language-features/data-types/type-characters. > > Any chance there is a connection there? > Variables ending in '$' date back to at least the early days of BASIC - long before the spectre of Microsoft loomed large, let alone 'Visual Basic'! Cheers, Gavin
On 5/17/2017 4:51 PM, Gavin Flower wrote: > Variables ending in '$' date back to at least the early days of BASIC > - long before the spectre of Microsoft loomed large, let alone 'Visual > Basic'! I note even INT fields have $ names there... IBM used to like to use $ in names for system stuff, SYS$BLAHBLAH or whatever. -- john r pierce, recycling bits in santa cruz
On 18/05/17 11:59, John R Pierce wrote: > On 5/17/2017 4:51 PM, Gavin Flower wrote: >> Variables ending in '$' date back to at least the early days of BASIC >> - long before the spectre of Microsoft loomed large, let alone >> 'Visual Basic'! > > > I note even INT fields have $ names there... IBM used to like to use > $ in names for system stuff, SYS$BLAHBLAH or whatever. > > Names ending in % were integers. The BASIC I'm most familiar with was BBC BASIC as on the BBC MIcro and the Acorn Archimedes. Visual Basic is the only language I've ever written a program in that I could not get to run - it should NEVER have had BASIC as part of its names. Cheers, Gavin