Re: [HACKERS] weird error message in sepgsql

2012-05-22 Thread Robert Haas
On Sun, May 20, 2012 at 11:28 AM, Tom Lane  wrote:
> Peter Eisentraut  writes:
>> I found this in contrib/sepgsql/expected/label.out:
>> SECURITY LABEL ON COLUMN t2
>>     IS 'system_u:object_r:sepgsql_ro_table_t:s0';   -- be failed
>> ERROR:  improper relation name (too many dotted names): 
>
>> Contrast with:
>
>> SECURITY LABEL ON COLUMN t2.b
>>     IS 'system_u:object_r:sepgsql_ro_table_t:s0';   -- ok
>
>> I guess what's happening is that it's calling makeRangeVarFromNameList()
>> with a list of length zero.
>
>> We should either fix the SECURITY LABEL command to catch that case
>> beforehand, or fix makeRangeVarFromNameList() to give a proper error
>> message, or both.
>
> I think the appropriate error message is probably along the lines of
> "column name must be qualified", and it's hard to justify having
> makeRangeVarFromNameList emit such a thing.  So this is the fault
> of the calling code.

Fixed and back-patched to 9.1.  Thanks for the report.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] weird error message in sepgsql

2012-05-20 Thread Tom Lane
Peter Eisentraut  writes:
> I found this in contrib/sepgsql/expected/label.out:
> SECURITY LABEL ON COLUMN t2
> IS 'system_u:object_r:sepgsql_ro_table_t:s0';   -- be failed
> ERROR:  improper relation name (too many dotted names): 

> Contrast with:

> SECURITY LABEL ON COLUMN t2.b
> IS 'system_u:object_r:sepgsql_ro_table_t:s0';   -- ok

> I guess what's happening is that it's calling makeRangeVarFromNameList()
> with a list of length zero.

> We should either fix the SECURITY LABEL command to catch that case
> beforehand, or fix makeRangeVarFromNameList() to give a proper error
> message, or both.

I think the appropriate error message is probably along the lines of
"column name must be qualified", and it's hard to justify having
makeRangeVarFromNameList emit such a thing.  So this is the fault
of the calling code.

regards, tom lane

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


[HACKERS] weird error message in sepgsql

2012-05-19 Thread Peter Eisentraut
I found this in contrib/sepgsql/expected/label.out:

SECURITY LABEL ON COLUMN t2
IS 'system_u:object_r:sepgsql_ro_table_t:s0';   -- be failed
ERROR:  improper relation name (too many dotted names): 

Contrast with:

SECURITY LABEL ON COLUMN t2.b
IS 'system_u:object_r:sepgsql_ro_table_t:s0';   -- ok

I guess what's happening is that it's calling makeRangeVarFromNameList()
with a list of length zero.

We should either fix the SECURITY LABEL command to catch that case
beforehand, or fix makeRangeVarFromNameList() to give a proper error
message, or both.


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers