Re: plpgsql - Insert from a record variable?
| От | basic |
|---|---|
| Тема | Re: plpgsql - Insert from a record variable? |
| Дата | |
| Msg-id | 40D783EF.7020706@mozdev.org обсуждение исходный текст |
| Ответ на | Re: plpgsql - Insert from a record variable? ("Phil Endecott" <spam_from_postgresql_sql@chezphil.org>) |
| Ответы |
Re: plpgsql - Insert from a record variable?
|
| Список | pgsql-sql |
Phil Endecott wrote:> !! execute ''column_values :=> !! column_values || quote_literal(r.'' || cr.column_name || '')''; I'm guessing you want something like FOR rec IN EXECUTE ''select column_values || quote_literal(r.'' || cr.column_name || '') alias column_values''; LOOP column_values:= rec.column_values; END LOOP; another suggestion, rather than do> if not first then> column_names := column_names || '', '';> column_values:= column_values || '', '';> first := false;> end if; why not use two arrays and append the name/values using array_append() and use array_to_string() to join them after that? -- basic
В списке pgsql-sql по дате отправления: