Re: Size of pg_rewrite

Поиск
Список
Период
Сортировка
От Dagfinn Ilmari Mannsåker
Тема Re: Size of pg_rewrite
Дата
Msg-id 878rsfppob.fsf@wibble.ilmari.org
обсуждение исходный текст
Ответы Re: Size of pg_rewrite  (Matthias van de Meent <boekewurm+postgres@gmail.com>)
Список pgsql-hackers
Matthias van de Meent <boekewurm+postgres@gmail.com> writes:

> But, as text literal concatenations don't seem to get constant folded
> before storing them in the rules table, this rewrite of the views
> would result in long lines in the system_views.sql file, or we'd have
> to deal with the additional overhead of the append operator and cast
> nodes.

There is no need to use the concatenation operator to split array
constants across multiple lines. Newlines are fine either inside the
string (between array elements), or between two string string literals
(which become one string constant at parse time).

https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-STRINGS

ilmari@[local]:5432 ~=# select
ilmari@[local]:5432 ~-# '{foo,
ilmari@[local]:5432 ~'# bar}'::text[],
ilmari@[local]:5432 ~-# '{bar,'
ilmari@[local]:5432 ~-# 'baz}'::text[];
┌───────────┬───────────┐
│   text    │   text    │
├───────────┼───────────┤
│ {foo,bar} │ {bar,baz} │
└───────────┴───────────┘
(1 row)


- ilmari



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

Предыдущее
От: Melih Mutlu
Дата:
Сообщение: Re: Mingw task for Cirrus CI
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: Kerberos delegation support in libpq and postgres_fdw