From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Tue, 4 Feb 2003 10:53:18 +0300 From: Grigory Batalov To: community@altlinux.ru Message-ID: <20030204075318.GA7825@lrn.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.4i Subject: [Comm] PostgreSQL string functions Sender: community-admin@altlinux.ru Errors-To: community-admin@altlinux.ru X-BeenThere: community@altlinux.ru X-Mailman-Version: 2.0.9 Precedence: bulk Reply-To: community@altlinux.ru List-Unsubscribe: , List-Id: List-Post: List-Help: List-Subscribe: , List-Archive: Archived-At: List-Archive: List-Post: Не знаю, куда вопрос задать, задам сюда. Нужно делать выборку из логов в postgres-е по логинам, пока сделал так: select sum(bytes) as bytes from squid_raw_log where time >= $time1 and time < $time2 and login ~ '$login$' где $login задаётся в php. Хочется выбирать сразу "login, sum(bytes) ... group by login", но мешает существование логинов "user" и "domain\user", которые суть одно и то же. Собственно, вопрос: Есть ли в postgres такая функция strstr, substr или им подобные, чтобы сделать сразу select substr(strstr(login,'\'),1) as login ? Или можно решить эту задачу другим способом? P.S. Если кто знает специализированные конференции по postgres, ткните, плиз. -- Grigory Batalov