Bug #711: Automatic created indexes can in some cases not be referenced to

Started by PostgreSQL Bugs Listalmost 24 years ago3 messagesbugs
Jump to latest
#1PostgreSQL Bugs List
pgsql-bugs@postgresql.org

Lasse L. Johnsen (lassejohnsen@bulldogcommunications.com) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
Automatic created indexes can in some cases not be referenced to

Long Description
It looks as if automatic created indexes can in some cases not be referenced to because long names are truncated. See example SQL statement below.

Sample Code
# CREATE TABLE WHOIS_BLOCK_TABLE_DATE (
# BLOCK SERIAL UNIQUE,
# CREATE INT, -- Timestamp
# UPDATE INT -- Timestamp
# );
NOTICE: CREATE TABLE will create implicit sequence 'whois_block_table_dat_block_seq' for SERIAL column 'whois_block_table_date.block'
NOTICE: CREATE TABLE / UNIQUE will create implicit index 'whois_block_table_dat_block_key' for table 'whois_block_table_date'
CREATE
# GRANT ALL ON WHOIS_BLOCK_TABLE_DATE_BLOCK_SEQ TO freeipdb;
NOTICE: identifier "whois_block_table_date_block_seq" will be truncated to "whois_block_table_date_block_se"
ERROR: relation "whois_block_table_date_block_se" not found
#

No file was uploaded with this report

#2Hugo Jonker
hugo@gewis.win.tue.nl
In reply to: PostgreSQL Bugs List (#1)
Re: Bug #711: Automatic created indexes can in some cases not be referenced to

On Fri, Jul 12, 2002 at 07:19:58AM -0400, pgsql-bugs@postgresql.org wrote:

Long Description
It looks as if automatic created indexes can in some cases not be referenced to because long names are truncated. See example SQL statement below.

There's a typo in your statement.

The sequence name gets truncated to 'whois_block_table_dat_block_seq'
instead of 'whois_block_table_date_block_seq',
which is the name you're using in the GRANT statement.

See the two notices:

NOTICE: CREATE TABLE will create implicit sequence

'whois_block_table_dat_block_seq'
for SERIAL column 'whois_block_table_date.block'

NOTICE: identifier

"whois_block_table_date_block_seq"
will be truncated to "whois_block_table_date_block_se"

Hugo.

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: PostgreSQL Bugs List (#1)
Re: Bug #711: Automatic created indexes can in some cases not be referenced to

pgsql-bugs@postgresql.org writes:

# CREATE TABLE WHOIS_BLOCK_TABLE_DATE (
# BLOCK SERIAL UNIQUE,
# CREATE INT, -- Timestamp
# UPDATE INT -- Timestamp
# );
NOTICE: CREATE TABLE will create implicit sequence 'whois_block_table_dat_block_seq' for SERIAL column 'whois_block_table_date.block'

^^^

NOTICE: CREATE TABLE / UNIQUE will create implicit index 'whois_block_table_dat_block_key' for table 'whois_block_table_date'
CREATE
# GRANT ALL ON WHOIS_BLOCK_TABLE_DATE_BLOCK_SEQ TO freeipdb;

^^^^

NOTICE: identifier "whois_block_table_date_block_seq" will be truncated to "whois_block_table_date_block_se"
ERROR: relation "whois_block_table_date_block_se" not found

I don't see a bug here. The system told you how it would truncate the name...

regards, tom lane