dbTalk Databases Forums  

index names

comp.databases.postgresql comp.databases.postgresql


Discuss index names in the comp.databases.postgresql forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Jasen Betts
 
Posts: n/a

Default Re: index names - 01-24-2010 , 04:07 AM






On 2010-01-19, Thomas Kellerer <OTPXDAJCSJVU (AT) spammotel (DOT) com> wrote:
Quote:
Andreas Kretschmer, 19.01.2010 15:57:
Anselmo Canfora<nobody (AT) nowhere (DOT) net> wrote:
Hi,
is there a way to have a default index name for columns?
for example, instead of writing:

create index foo on bar (foo);

write only:
create index on bar (foo);

or better:

create index on bar.foo;

Tom Lane commited such a feature, see:
http://www.postgresql.org/community/...ws/pwn20091227
- Allow the index name to be omitted in CREATE INDEX, causing the system
to choose an index name the same as it would do for an unnamed index
constraint


Nice one.

Does "Tom Lane commited" mean, that this will definitely appear in 8.5 (aka "next version)?
What Tom wants: Tom gets. He seems to be the lead developer.

Quote:
Or does it need some kind of review/approval process that might
cause it to not appear in the next version?
8.5 hasn't entered feature freeze yet, so stuff added in
december should be included, you can download and compile the 8.5 alpha
source and try it yourself

It is unlikely to be removed unless it has fundamental problems. Seeing
as this seems to just be a generalisation of some well-tested code
and superficial to the workings of the database I do not expect it to
be dropped. 98% confident



--- news://freenews.netfront.net/ - complaints: news (AT) netfront (DOT) net ---

Reply With Quote
  #12  
Old   
Jasen Betts
 
Posts: n/a

Default Re: index names - 01-24-2010 , 04:35 AM






On 2010-01-24, Jasen Betts <jasen (AT) xnet (DOT) co.nz> wrote:
Quote:
8.5 hasn't entered feature freeze yet, so stuff added in
december should be included, you can download and compile the 8.5 alpha
source and try it yourself
breaking news: next release will be "9.0" not "8.5"

--- news://freenews.netfront.net/ - complaints: news (AT) netfront (DOT) net ---

Reply With Quote
  #13  
Old   
Laurenz Albe
 
Posts: n/a

Default Re: index names - 01-25-2010 , 07:28 AM



Anselmo Canfora wrote:
Quote:
Fine is there a plan to do something similar on cases such, for example:

alter table foo add constraint constraint_name check (bar between 0 and 255);

that would be turn into:

alter table foo add constraint check (bar between 0 and 255);
Certainly not for this case, as that is already done:

test=> CREATE TABLE t(id integer CHECK (id=1), x integer);

Creates a check constraint without naming it.

test=> ALTER TABLE t ADD CHECK (x=1);

Adds a check constraint without naming it.

The constraints are even given nice names:

test=> SELECT c.conname
test-> FROM pg_constraint c JOIN
test-> pg_class t ON (c.conrelid = t.oid) JOIN
test-> pg_namespace s ON (t.relnamespace = s.oid)
test-> WHERE s.nspname = current_schema
test-> AND t.relname = 't';

conname
------------
t_id_check
t_x_check
(2 rows)

Yours,
Laurenz Albe

Reply With Quote
  #14  
Old   
Anselmo Canfora
 
Posts: n/a

Default Re: index names - 01-25-2010 , 07:56 AM



Il 25/01/2010 13.28, Laurenz Albe ha scritto:
Quote:
Anselmo Canfora wrote:
Fine is there a plan to do something similar on cases such, for example:

alter table foo add constraint constraint_name check (bar between 0 and 255);

that would be turn into:

alter table foo add constraint check (bar between 0 and 255);

Certainly not for this case, as that is already done:

test=> CREATE TABLE t(id integer CHECK (id=1), x integer);

Creates a check constraint without naming it.

test=> ALTER TABLE t ADD CHECK (x=1);

Adds a check constraint without naming it.

The constraints are even given nice names:

test=> SELECT c.conname
test-> FROM pg_constraint c JOIN
test-> pg_class t ON (c.conrelid = t.oid) JOIN
test-> pg_namespace s ON (t.relnamespace = s.oid)
test-> WHERE s.nspname = current_schema
test-> AND t.relname = 't';

conname
------------
t_id_check
t_x_check
(2 rows)
wow, I missed that, good to know

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.