aliases for sequences and other DB objects?

Started by Agoston Postgresalmost 17 years ago3 messagesgeneral
Jump to latest
#1Agoston Postgres
agostonpostgres@yahoo.com

Hi!

Is it possible in Postgres to specify aliases for various DB objects, such as tables, views, sequences, etc.? (For now I would like to create them for sequences.)

What I mean is something like in Oracle, such as

create alias my_sequence_alias for my_sequence;
select nextval('my_sequence_alias');

Thanks!

Agoston

#2Frank Heikens
frankygoestorio@mac.com
In reply to: Agoston Postgres (#1)
Re: aliases for sequences and other DB objects?

No, it's not possible, pgSQL does't have a CREATE ALIAS -syntax

You could put this function into another function to create sort of an
alias, but that wouldn't make to much sense.

Frank

Op 9 jun 2009, om 22:03 heeft Agoston Postgres het volgende geschreven:

Show quoted text

Hi!

Is it possible in Postgres to specify aliases for various DB
objects, such as tables, views, sequences, etc.? (For now I would
like to create them for sequences.)

What I mean is something like in Oracle, such as

create alias my_sequence_alias for my_sequence;
select nextval('my_sequence_alias');

Thanks!

Agoston

#3Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Agoston Postgres (#1)
Re: aliases for sequences and other DB objects?

Agoston Postgres wrote:

Hi!

Is it possible in Postgres to specify aliases for various DB objects, such as tables, views, sequences, etc.? (For now I would like to create them for sequences.)

What I mean is something like in Oracle, such as

create alias my_sequence_alias for my_sequence;
select nextval('my_sequence_alias');

No. What would this be used for?

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.