Re: RE in WHERE SOLVED

Started by Patrick Nelsonover 23 years ago2 messagesgeneral
Jump to latest
#1Patrick Nelson
pnelson@neatech.com

Joe Maldonado wrote:
----------------->>>>
try this...
select * from secure where ~'^12[.]';
----------------->>>>
That did it! Thanks

#2Patrick Nelson
pnelson@neatech.com
In reply to: Patrick Nelson (#1)

Patrick Nelson wrote:
----------------->>>>
Jean-Luc Lachance wrote:
----------------->>>>
Double up on the back slashes.

SELECT * FROM secure WHERE ~ '^12\\.'
----------------->>>>
That didn't work either...
----------------->>>>
Actually that does work within psql. I was trying from the command line
like:

psql <database> -c "SELECT * FROM <table> WHERE host~'^12\\.'"

which doesn't work. However, if I went into psql and entered the query then
it did work. Guess the bash shell does something to the block...