Re: Views->Create Script + Regular Expressions
От | Richard Broersma |
---|---|
Тема | Re: Views->Create Script + Regular Expressions |
Дата | |
Msg-id | CABvLTWE92CA6iC_0tpgtc2nxBkvOw025SC1RS+1T477MoM4vQQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Views->Create Script + Regular Expressions (Guillaume Lelarge <guillaume@lelarge.info>) |
Ответы |
Re: Views->Create Script + Regular Expressions
|
Список | pgadmin-support |
On Tue, Aug 23, 2011 at 11:18 PM, Guillaume Lelarge <guillaume@lelarge.info> wrote: > It would be great if you could provide us a complete example. Here is a sample view. --************* CREATE VIEW TestView AS select cmpnt_name, regexp_matches(cmpnt_name, E'(^\\d{1,2})-([A-Z]+) *- ?(\\d{3,4})-?([A-Z]*)?') from component; --************* Here what Views->Create Script returns: --************* -- View: testview -- DROP VIEW testview; CREATE OR REPLACE VIEW testview ASSELECT component.cmpnt_name, regexp_matches(component.cmpnt_name::text, '(^\\d{1,2})-([A-Z]+) *- ?(\\d{3,4})-?([A-Z]*)?'::text) AS regexp_matches FROM component; ALTER TABLE testview OWNER TO rbroersma; --************* Notice what happens if I try to execute this script. WARNING: nonstandard use of \\ in a string literal LINE 6: ..._name, regexp_matches(component.cmpnt_name::text, '(^\\d{1,2... ^ HINT: Use the escape string syntax for backslashes, e.g., E'\\'. Query returned successfully with no result in 157 ms. -- Regards, Richard Broersma Jr.
В списке pgadmin-support по дате отправления: