Is the keyword “ALIAS” actually used?












8















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?










share|improve this question





























    8















    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?










    share|improve this question



























      8












      8








      8








      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?










      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 14 at 20:37









      Evan Carroll

      31.7k966215




      31.7k966215










      asked Jan 14 at 15:29









      mickeyfmickeyf

      2881310




      2881310






















          3 Answers
          3






          active

          oldest

          votes


















          15














          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






          share|improve this answer

































            7














            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.






            share|improve this answer



















            • 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






            • 2





              @AndriyM It's the other way around: SYNONYM is a synonym for ALIAS, though not always.

              – mustaccio
              Jan 14 at 23:25





















            0














            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.







            share|improve this answer























              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
              });


              }
              });














              draft saved

              draft discarded


















              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









              15














              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






              share|improve this answer






























                15














                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






                share|improve this answer




























                  15












                  15








                  15







                  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






                  share|improve this answer















                  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







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Jan 15 at 14:53

























                  answered Jan 14 at 16:24









                  Evan CarrollEvan Carroll

                  31.7k966215




                  31.7k966215

























                      7














                      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.






                      share|improve this answer



















                      • 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






                      • 2





                        @AndriyM It's the other way around: SYNONYM is a synonym for ALIAS, though not always.

                        – mustaccio
                        Jan 14 at 23:25


















                      7














                      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.






                      share|improve this answer



















                      • 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






                      • 2





                        @AndriyM It's the other way around: SYNONYM is a synonym for ALIAS, though not always.

                        – mustaccio
                        Jan 14 at 23:25
















                      7












                      7








                      7







                      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.






                      share|improve this answer













                      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.







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Jan 14 at 16:15









                      mustacciomustaccio

                      9,19372136




                      9,19372136








                      • 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






                      • 2





                        @AndriyM It's the other way around: SYNONYM is a synonym for ALIAS, though not always.

                        – mustaccio
                        Jan 14 at 23:25
















                      • 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






                      • 2





                        @AndriyM It's the other way around: SYNONYM is a synonym for ALIAS, 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













                      0














                      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.







                      share|improve this answer




























                        0














                        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.







                        share|improve this answer


























                          0












                          0








                          0







                          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.







                          share|improve this answer













                          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.








                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 15 mins ago









                          Erwin BrandstetterErwin Brandstetter

                          91.1k9171284




                          91.1k9171284






























                              draft saved

                              draft discarded




















































                              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.




                              draft saved


                              draft discarded














                              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





















































                              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







                              Popular posts from this blog

                              الفوسفات في المغرب

                              Four equal circles intersect: What is the area of the small shaded portion and its height

                              جامعة ليفربول