Is the keyword “ALIAS” actually used?
According to PostgreSQL 7.1 through 9.1 (now unsupported), ALIAS
is listed as a reserved word, at least for SQL-99. Later versions do not show it - suggesting that it has been dropped as a reserved word. The old PostgreSQL docs do say "the presence of a key word does not indicate the existence of a feature." When aliasing a table or column I've seen AS
, but never ALIAS
.
Where is (or was) the SQL keyword ALIAS
used? Was it ever in-use or only ever reserved for future-use?
postgresql postgresql-9.1 sql-standard reserved-word
add a comment |
According to PostgreSQL 7.1 through 9.1 (now unsupported), ALIAS
is listed as a reserved word, at least for SQL-99. Later versions do not show it - suggesting that it has been dropped as a reserved word. The old PostgreSQL docs do say "the presence of a key word does not indicate the existence of a feature." When aliasing a table or column I've seen AS
, but never ALIAS
.
Where is (or was) the SQL keyword ALIAS
used? Was it ever in-use or only ever reserved for future-use?
postgresql postgresql-9.1 sql-standard reserved-word
add a comment |
According to PostgreSQL 7.1 through 9.1 (now unsupported), ALIAS
is listed as a reserved word, at least for SQL-99. Later versions do not show it - suggesting that it has been dropped as a reserved word. The old PostgreSQL docs do say "the presence of a key word does not indicate the existence of a feature." When aliasing a table or column I've seen AS
, but never ALIAS
.
Where is (or was) the SQL keyword ALIAS
used? Was it ever in-use or only ever reserved for future-use?
postgresql postgresql-9.1 sql-standard reserved-word
According to PostgreSQL 7.1 through 9.1 (now unsupported), ALIAS
is listed as a reserved word, at least for SQL-99. Later versions do not show it - suggesting that it has been dropped as a reserved word. The old PostgreSQL docs do say "the presence of a key word does not indicate the existence of a feature." When aliasing a table or column I've seen AS
, but never ALIAS
.
Where is (or was) the SQL keyword ALIAS
used? Was it ever in-use or only ever reserved for future-use?
postgresql postgresql-9.1 sql-standard reserved-word
postgresql postgresql-9.1 sql-standard reserved-word
edited Jan 14 at 20:37
Evan Carroll
31.7k966215
31.7k966215
asked Jan 14 at 15:29
mickeyfmickeyf
2881310
2881310
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
PostgreSQL maintains a list of reserved and non-reserved terms in the appendix. ALIAS
is absent from that list. You can verify PostgreSQL does not use ALIAS
by checking out the YACC grammar. Even as far back as Postgres95 ALIAS
was not a reserved word (the first version in the migration from QUEL to SQL)
- 👍 MySQL does NOT reserve
ALIAS
- 👍 MariaDB does NOT reserve
ALIAS
- 👍 Oracle does NOT reserve
ALIAS
- 👎 SQL Server does (in T-SQL) reserve
ALIAS
(as a potential future keyword on their "reserved keyword" list)
SQL Standard
In SQL-92,
ALIAS
was marked as a<reserved word>
; but, there was no use assigned for that<reserved word>
.In SQL-99
ALIAS
was marked as an "Additional Reserved Word", and added to the list of<reserved word>
; but, there was no use assigned for that<reserved word>
. Perhaps they reserved the term with the intent to define meaning later, and then withdrew it at a different point. Or, perhaps they reserved the term for vendor defined implementation. PostgreSQL reflected the spec's reservation in the docs, and then removed that reservation with the spec.In SQL-2011,
ALIAS
is no where to be found and the word "alias" only appears in reference to 'Feature T053, “Explicit aliases for all-fields reference”'
ℹ There is no digitized copy of SQL-86, or SQL-89
add a comment |
It is used at least in various flavours of Db2: ALIAS
is an object that allows you to specify a different name for another object, like table. It's frequently used to allow references in one schema to objects in another schema without explicitly specifying that schema.
create table SOMEOTHERSCHEMA.FOOBAR (...);
set schema MYSCHEMA;
create alias FOOBAR for SOMEOTHERSCHEMA.FOOBAR;
select * from FOOBAR;
ALIAS
is an alias for SYNONYM
; the latter concept also exists in Oracle and SQL Server.
4
ALIAS
is an alias forSYNONYM
– hmm, I guess you could also sayALIAS
is a synonym ofSYNONYM
...
– Andriy M
Jan 14 at 21:58
2
@AndriyM It's the other way around:SYNONYM
is a synonym forALIAS
, though not always.
– mustaccio
Jan 14 at 23:25
add a comment |
Actually, there is a place where the keyword ALIAS
is used in all versions of PostgreSQL.
Not in SQL, though, like Evan clearly documented. But in the procedural language PL/pgSQL to create an aliases for parameters or variables.
It was more commonly used before Postgres 8.0 while named parameters were not yet supported for PL/pgSQL functions. Since then, only few use cases are left. The manual concludes:
It's best to use it only for the purpose of overriding predetermined names.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "182"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f227095%2fis-the-keyword-alias-actually-used%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
PostgreSQL maintains a list of reserved and non-reserved terms in the appendix. ALIAS
is absent from that list. You can verify PostgreSQL does not use ALIAS
by checking out the YACC grammar. Even as far back as Postgres95 ALIAS
was not a reserved word (the first version in the migration from QUEL to SQL)
- 👍 MySQL does NOT reserve
ALIAS
- 👍 MariaDB does NOT reserve
ALIAS
- 👍 Oracle does NOT reserve
ALIAS
- 👎 SQL Server does (in T-SQL) reserve
ALIAS
(as a potential future keyword on their "reserved keyword" list)
SQL Standard
In SQL-92,
ALIAS
was marked as a<reserved word>
; but, there was no use assigned for that<reserved word>
.In SQL-99
ALIAS
was marked as an "Additional Reserved Word", and added to the list of<reserved word>
; but, there was no use assigned for that<reserved word>
. Perhaps they reserved the term with the intent to define meaning later, and then withdrew it at a different point. Or, perhaps they reserved the term for vendor defined implementation. PostgreSQL reflected the spec's reservation in the docs, and then removed that reservation with the spec.In SQL-2011,
ALIAS
is no where to be found and the word "alias" only appears in reference to 'Feature T053, “Explicit aliases for all-fields reference”'
ℹ There is no digitized copy of SQL-86, or SQL-89
add a comment |
PostgreSQL maintains a list of reserved and non-reserved terms in the appendix. ALIAS
is absent from that list. You can verify PostgreSQL does not use ALIAS
by checking out the YACC grammar. Even as far back as Postgres95 ALIAS
was not a reserved word (the first version in the migration from QUEL to SQL)
- 👍 MySQL does NOT reserve
ALIAS
- 👍 MariaDB does NOT reserve
ALIAS
- 👍 Oracle does NOT reserve
ALIAS
- 👎 SQL Server does (in T-SQL) reserve
ALIAS
(as a potential future keyword on their "reserved keyword" list)
SQL Standard
In SQL-92,
ALIAS
was marked as a<reserved word>
; but, there was no use assigned for that<reserved word>
.In SQL-99
ALIAS
was marked as an "Additional Reserved Word", and added to the list of<reserved word>
; but, there was no use assigned for that<reserved word>
. Perhaps they reserved the term with the intent to define meaning later, and then withdrew it at a different point. Or, perhaps they reserved the term for vendor defined implementation. PostgreSQL reflected the spec's reservation in the docs, and then removed that reservation with the spec.In SQL-2011,
ALIAS
is no where to be found and the word "alias" only appears in reference to 'Feature T053, “Explicit aliases for all-fields reference”'
ℹ There is no digitized copy of SQL-86, or SQL-89
add a comment |
PostgreSQL maintains a list of reserved and non-reserved terms in the appendix. ALIAS
is absent from that list. You can verify PostgreSQL does not use ALIAS
by checking out the YACC grammar. Even as far back as Postgres95 ALIAS
was not a reserved word (the first version in the migration from QUEL to SQL)
- 👍 MySQL does NOT reserve
ALIAS
- 👍 MariaDB does NOT reserve
ALIAS
- 👍 Oracle does NOT reserve
ALIAS
- 👎 SQL Server does (in T-SQL) reserve
ALIAS
(as a potential future keyword on their "reserved keyword" list)
SQL Standard
In SQL-92,
ALIAS
was marked as a<reserved word>
; but, there was no use assigned for that<reserved word>
.In SQL-99
ALIAS
was marked as an "Additional Reserved Word", and added to the list of<reserved word>
; but, there was no use assigned for that<reserved word>
. Perhaps they reserved the term with the intent to define meaning later, and then withdrew it at a different point. Or, perhaps they reserved the term for vendor defined implementation. PostgreSQL reflected the spec's reservation in the docs, and then removed that reservation with the spec.In SQL-2011,
ALIAS
is no where to be found and the word "alias" only appears in reference to 'Feature T053, “Explicit aliases for all-fields reference”'
ℹ There is no digitized copy of SQL-86, or SQL-89
PostgreSQL maintains a list of reserved and non-reserved terms in the appendix. ALIAS
is absent from that list. You can verify PostgreSQL does not use ALIAS
by checking out the YACC grammar. Even as far back as Postgres95 ALIAS
was not a reserved word (the first version in the migration from QUEL to SQL)
- 👍 MySQL does NOT reserve
ALIAS
- 👍 MariaDB does NOT reserve
ALIAS
- 👍 Oracle does NOT reserve
ALIAS
- 👎 SQL Server does (in T-SQL) reserve
ALIAS
(as a potential future keyword on their "reserved keyword" list)
SQL Standard
In SQL-92,
ALIAS
was marked as a<reserved word>
; but, there was no use assigned for that<reserved word>
.In SQL-99
ALIAS
was marked as an "Additional Reserved Word", and added to the list of<reserved word>
; but, there was no use assigned for that<reserved word>
. Perhaps they reserved the term with the intent to define meaning later, and then withdrew it at a different point. Or, perhaps they reserved the term for vendor defined implementation. PostgreSQL reflected the spec's reservation in the docs, and then removed that reservation with the spec.In SQL-2011,
ALIAS
is no where to be found and the word "alias" only appears in reference to 'Feature T053, “Explicit aliases for all-fields reference”'
ℹ There is no digitized copy of SQL-86, or SQL-89
edited Jan 15 at 14:53
answered Jan 14 at 16:24
Evan CarrollEvan Carroll
31.7k966215
31.7k966215
add a comment |
add a comment |
It is used at least in various flavours of Db2: ALIAS
is an object that allows you to specify a different name for another object, like table. It's frequently used to allow references in one schema to objects in another schema without explicitly specifying that schema.
create table SOMEOTHERSCHEMA.FOOBAR (...);
set schema MYSCHEMA;
create alias FOOBAR for SOMEOTHERSCHEMA.FOOBAR;
select * from FOOBAR;
ALIAS
is an alias for SYNONYM
; the latter concept also exists in Oracle and SQL Server.
4
ALIAS
is an alias forSYNONYM
– hmm, I guess you could also sayALIAS
is a synonym ofSYNONYM
...
– Andriy M
Jan 14 at 21:58
2
@AndriyM It's the other way around:SYNONYM
is a synonym forALIAS
, though not always.
– mustaccio
Jan 14 at 23:25
add a comment |
It is used at least in various flavours of Db2: ALIAS
is an object that allows you to specify a different name for another object, like table. It's frequently used to allow references in one schema to objects in another schema without explicitly specifying that schema.
create table SOMEOTHERSCHEMA.FOOBAR (...);
set schema MYSCHEMA;
create alias FOOBAR for SOMEOTHERSCHEMA.FOOBAR;
select * from FOOBAR;
ALIAS
is an alias for SYNONYM
; the latter concept also exists in Oracle and SQL Server.
4
ALIAS
is an alias forSYNONYM
– hmm, I guess you could also sayALIAS
is a synonym ofSYNONYM
...
– Andriy M
Jan 14 at 21:58
2
@AndriyM It's the other way around:SYNONYM
is a synonym forALIAS
, though not always.
– mustaccio
Jan 14 at 23:25
add a comment |
It is used at least in various flavours of Db2: ALIAS
is an object that allows you to specify a different name for another object, like table. It's frequently used to allow references in one schema to objects in another schema without explicitly specifying that schema.
create table SOMEOTHERSCHEMA.FOOBAR (...);
set schema MYSCHEMA;
create alias FOOBAR for SOMEOTHERSCHEMA.FOOBAR;
select * from FOOBAR;
ALIAS
is an alias for SYNONYM
; the latter concept also exists in Oracle and SQL Server.
It is used at least in various flavours of Db2: ALIAS
is an object that allows you to specify a different name for another object, like table. It's frequently used to allow references in one schema to objects in another schema without explicitly specifying that schema.
create table SOMEOTHERSCHEMA.FOOBAR (...);
set schema MYSCHEMA;
create alias FOOBAR for SOMEOTHERSCHEMA.FOOBAR;
select * from FOOBAR;
ALIAS
is an alias for SYNONYM
; the latter concept also exists in Oracle and SQL Server.
answered Jan 14 at 16:15
mustacciomustaccio
9,19372136
9,19372136
4
ALIAS
is an alias forSYNONYM
– hmm, I guess you could also sayALIAS
is a synonym ofSYNONYM
...
– Andriy M
Jan 14 at 21:58
2
@AndriyM It's the other way around:SYNONYM
is a synonym forALIAS
, though not always.
– mustaccio
Jan 14 at 23:25
add a comment |
4
ALIAS
is an alias forSYNONYM
– hmm, I guess you could also sayALIAS
is a synonym ofSYNONYM
...
– Andriy M
Jan 14 at 21:58
2
@AndriyM It's the other way around:SYNONYM
is a synonym forALIAS
, though not always.
– mustaccio
Jan 14 at 23:25
4
4
ALIAS
is an alias for SYNONYM
– hmm, I guess you could also say ALIAS
is a synonym of SYNONYM
...– Andriy M
Jan 14 at 21:58
ALIAS
is an alias for SYNONYM
– hmm, I guess you could also say ALIAS
is a synonym of SYNONYM
...– Andriy M
Jan 14 at 21:58
2
2
@AndriyM It's the other way around:
SYNONYM
is a synonym for ALIAS
, though not always.– mustaccio
Jan 14 at 23:25
@AndriyM It's the other way around:
SYNONYM
is a synonym for ALIAS
, though not always.– mustaccio
Jan 14 at 23:25
add a comment |
Actually, there is a place where the keyword ALIAS
is used in all versions of PostgreSQL.
Not in SQL, though, like Evan clearly documented. But in the procedural language PL/pgSQL to create an aliases for parameters or variables.
It was more commonly used before Postgres 8.0 while named parameters were not yet supported for PL/pgSQL functions. Since then, only few use cases are left. The manual concludes:
It's best to use it only for the purpose of overriding predetermined names.
add a comment |
Actually, there is a place where the keyword ALIAS
is used in all versions of PostgreSQL.
Not in SQL, though, like Evan clearly documented. But in the procedural language PL/pgSQL to create an aliases for parameters or variables.
It was more commonly used before Postgres 8.0 while named parameters were not yet supported for PL/pgSQL functions. Since then, only few use cases are left. The manual concludes:
It's best to use it only for the purpose of overriding predetermined names.
add a comment |
Actually, there is a place where the keyword ALIAS
is used in all versions of PostgreSQL.
Not in SQL, though, like Evan clearly documented. But in the procedural language PL/pgSQL to create an aliases for parameters or variables.
It was more commonly used before Postgres 8.0 while named parameters were not yet supported for PL/pgSQL functions. Since then, only few use cases are left. The manual concludes:
It's best to use it only for the purpose of overriding predetermined names.
Actually, there is a place where the keyword ALIAS
is used in all versions of PostgreSQL.
Not in SQL, though, like Evan clearly documented. But in the procedural language PL/pgSQL to create an aliases for parameters or variables.
It was more commonly used before Postgres 8.0 while named parameters were not yet supported for PL/pgSQL functions. Since then, only few use cases are left. The manual concludes:
It's best to use it only for the purpose of overriding predetermined names.
answered 15 mins ago
Erwin BrandstetterErwin Brandstetter
91.1k9171284
91.1k9171284
add a comment |
add a comment |
Thanks for contributing an answer to Database Administrators Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f227095%2fis-the-keyword-alias-actually-used%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown