Re: RfD: more powerful "any" types

Поиск
Список
Период
Сортировка
От decibel
Тема Re: RfD: more powerful "any" types
Дата
Msg-id A0269005-9C00-4087-8AFF-202972B105EB@decibel.org
обсуждение исходный текст
Ответ на Re: RfD: more powerful "any" types  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: RfD: more powerful "any" types  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
On Sep 14, 2009, at 12:13 AM, Pavel Stehule wrote:
> 2009/9/13 decibel <decibel@decibel.org>:
>> On Sep 12, 2009, at 5:54 PM, Andrew Dunstan wrote:
>>>
>>> decibel wrote:
>>>>
>>>> Speaking of concatenation...
>>>>
>>>> Something I find sorely missing in plpgsql is the ability to put
>>>> variables inside of a string, ie:
>>>>
>>>> DECLARE
>>>> v_table text := ...
>>>> v_sql text;
>>>> BEGIN
>>>> v_sql := "SELECT * FROM $v_table";
>>>>
>>>> Of course, I'm assuming that if it was easy to do that it would  
>>>> be done
>>>> already... but I thought I'd just throw it out there.
>>>>
>>>
>>> Then use a language that supports variable interpolation in  
>>> strings, like
>>> plperl, plpythonu, plruby .... instead of plpgsql.
>>
>>
>> Which makes executing SQL much, much harder.
>>
>> At least if we get sprintf dealing with strings might become a bit  
>> easier...
>
> This feature is nice - but very dangerous - it the most easy way how
> do vulnerable (on SQL injection) application!


How is it any worse than what people can already do? Anyone who isn't  
aware of the dangers of SQL injection has already screwed themselves.  
You're basically arguing that they would put a variable inside of  
quotes, but they would never use ||.
-- 
Decibel!, aka Jim C. Nasby, Database Architect  decibel@decibel.org
Give your computer some brain candy! www.distributed.net Team #1828




В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: Timestamp to time_t
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Streaming Replication patch for CommitFest 2009-09