Re: How to extract a value from a record using attnum or attname?

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: How to extract a value from a record using attnum or attname?
Дата
Msg-id 1298490226-sup-4369@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: How to extract a value from a record using attnum or attname?  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Ответы Re: How to extract a value from a record using attnum or attname?  (Robert Haas <robertmhaas@gmail.com>)
Re: How to extract a value from a record using attnum or attname?  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Список pgsql-hackers
Excerpts from Kevin Grittner's message of mié feb 23 16:20:16 -0300 2011:
> Alvaro Herrera <alvherre@commandprompt.com> wrote:
>  
> > Why not use quote_identifier and quote_literal_cstr instead of
> > this new strcpy thing?
>  
> We've got various types of software that will be parsing these
> payloads, and it's a little easier to parse if the quoting is
> unconditional.  If that's a barrier to acceptance we could use
> the functions which quote conditionally and adjust our regular
> expressions.

No strong opinion on this, really, but your strcpy should use a
StringInfo buffer instead of the char[200].  That's going to bite
someone.

> Probably one reason we had a bias toward quoting is that every
> single application table name we use has at least on uppercase
> letter and about 95% of our column names do.

Makes sense.

> > Also, you don't really need spi.h do you?
>  
> It's using these functions:
>  
> SPI_getrelname
> SPI_fname
> SPI_getvalue
>  
> If there's a better way to get the info, I'm game. 

I think you could get away without the first two (in particular get rid
of the memleak with SPI_getrelname), but the last one would require
something more involved.  No strong opinion, I just failed to see those
calls in there.

Is this intended for 9.1?

-- 
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


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

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: How to extract a value from a record using attnum or attname?
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Binary in/out for aclitem