Tom Lane wrote:
Marek Lewczuk <ne***@lewczuk. com> writes:
I'm curious if the default scheme for sequence name (which is created
with SERIAL data type) can be changed -- currently all sequences are
named like this: <table_name>_<f ield_name>_seq -- can it be changed for
e.g. <table_name>__< field_name>__se q ???
Sure ... just hack one or two places in the sources ...
That probably wasn't the answer you wanted, but I'm quite unsure what you did want.
I just asked is it can be done (somehow...).
Are you suggesting the above would be a better default
naming scheme? Are you saying you want user-configurability of implicit
sequence names? In either case, what's your argument why we should
invest effort and possibly create backwards-compatibility issues?
I'm not saying that proposed naming scheme is better - I think that it
is more readable, and I'm using it in my project.
Look at below examples:
Primary key:
1. <table_name>__p key
(e.g. my_clients__pke y)
Foreign key:
1. <table_name>__< field>__fkey
(e.g. my_clients__cli ent_id__fkey)
2. <table_name>__< field>_<field>_ _fkey
(e.g. my_clients__cli ent_id_company_ id__fkey)
Index:
1. <table_name>__< field>__index
(e.g. my_clients__cou ntry__index)
2. <table_name>__< field>_<field>_ <field>__inde x
(e.g. my_clients__cou ntry_city_stree t__index)
Sequence:
1. <table_name>__< field>__seq
(e.g. my_clients__cli ent_id__seq)
As you can see all naming schemes are very similar, and becouse of this
I just wanted to know if there is something like "user-configurability
implicit of sequence names". I didn't want to propose NEW naming scheme
- but maybe my naming schemes are worth looking at.
ML
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend