column names and dollar sign

Started by armand pirvualmost 9 years ago9 messagesgeneral
Jump to latest
#1armand pirvu
armand.pirvu@gmail.com

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

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#2Steve Atkins
steve@blighty.com
In reply to: armand pirvu (#1)
Re: column names and dollar sign

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

#3armand pirvu
armand.pirvu@gmail.com
In reply to: Steve Atkins (#2)
Re: column names and dollar sign

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

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: armand pirvu (#1)
Re: column names and dollar sign

"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

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#5armand pirvu
armand.pirvu@gmail.com
In reply to: Tom Lane (#4)
Re: column names and dollar sign

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

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#6Neil Anderson
neil@postgrescompare.com
In reply to: armand pirvu (#5)
Re: column names and dollar sign

"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

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#7Gavin Flower
GavinFlower@archidevsys.co.nz
In reply to: Neil Anderson (#6)
Re: column names and dollar sign

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

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#8John R Pierce
pierce@hogranch.com
In reply to: Gavin Flower (#7)
Re: column names and dollar sign

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

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#9Gavin Flower
GavinFlower@archidevsys.co.nz
In reply to: John R Pierce (#8)
Re: column names and dollar sign

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

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general