Re: [SQL] field separator problem

2007-10-03 Thread Tena Sakai
many thanks, Michael! I appreciate it. Regards, Tena -Original Message- From: Michael Fuhr [mailto:[EMAIL PROTECTED] Sent: Wed 10/3/2007 5:54 PM To: Tena Sakai Cc: pgsql-sql@postgresql.org Subject: Re: [SQL] field separator problem On Wed, Oct 03, 2007 at 05:13:48PM -0700, Tena Sakai

Re: [SQL] Why does the sequence skip a number with generate_series?

2007-10-03 Thread Stephan Szabo
On Tue, 2 Oct 2007, Jeff Frost wrote: > I expected these numbers to be in sync, but was suprised to see that the > sequence skips a values after every generate series. > > CREATE TABLE jefftest ( id serial, num int ); > INSERT INTO jefftest (num) values (generate_series(1,10)); > INSERT INTO jefft

Re: [SQL] field separator problem

2007-10-03 Thread Michael Fuhr
On Wed, Oct 03, 2007 at 05:13:48PM -0700, Tena Sakai wrote: > I issue from psql \f (or "\pset fieldsep ','") and > psql appears to accept what I want: > > canon=# \f ',' > Field separator is ",". > > canon is the name of database, but when I issue a select > command, it still uses '|' as sepa

[SQL] Why does the sequence skip a number with generate_series?

2007-10-03 Thread Jeff Frost
I expected these numbers to be in sync, but was suprised to see that the sequence skips a values after every generate series. CREATE TABLE jefftest ( id serial, num int ); INSERT INTO jefftest (num) values (generate_series(1,10)); INSERT INTO jefftest (num) values (generate_series(11,20)); INSER

[SQL] field separator problem

2007-10-03 Thread Tena Sakai
Hi Everybody, I am having a problem with field separator. Maybe someone can assist me. But first thing firtst: I am running postgresql 8.2.4 on redhat, dell 64 bit machine: I issue from psql \f (or "\pset fieldsep ','") and psql appears to accept what I want: canon=# \f ',' Field separator

Re: [SQL] Need help with CASE statement in Function

2007-10-03 Thread Richard Broersma Jr
--- Hengky Lie <[EMAIL PROTECTED]> wrote: > My Question is : How to make argument 4 optional ? When IS NULL the function > will show all transaction between date $1 and $2 and product ID=$3 Could you simply overload your function by having two functions? One with arguement 4 and one without? R

Re: [SQL] Need help with CASE statement in Function

2007-10-03 Thread Dawid Kuroczko
On 10/3/07, Hengky Lie <[EMAIL PROTECTED]> wrote: > Dear friends, > I am a new user to postgreSQL and really need help to solve my "stupid ?" > problem. > > I have created function with 4 arguments like this : > > CREATE OR REPLACE FUNCTION "public"."fHistoryCard" (begdate date, enddate > date, Pr

[SQL] Need help with CASE statement in Function

2007-10-03 Thread Hengky Lie
Dear friends, I am a new user to postgreSQL and really need help to solve my "stupid ?" problem. I have created function with 4 arguments like this : CREATE OR REPLACE FUNCTION "public"."fHistoryCard" (begdate date, enddate date, ProductID varchar, storeID varchar) RETURNS SETOF "publi

Re: [SQL] Finding broken regex'es

2007-10-03 Thread Dawid Kuroczko
On 10/3/07, Filip RembiaƂkowski <[EMAIL PROTECTED]> wrote: > 2007/10/3, Dawid Kuroczko <[EMAIL PROTECTED]>: > > > CREATE TABLE rx_check ( > > rx text CHECK ('' ~ rx IN ('t','f')) > > ); > > wow. This is beautiful :) Personally I would wrap it around DOMAIN, i.e.: CREATE DOMAIN regex AS te

Re: [SQL] Finding broken regex'es

2007-10-03 Thread Filip RembiaƂkowski
2007/10/3, Dawid Kuroczko <[EMAIL PROTECTED]>: > CREATE TABLE rx_check ( > rx text CHECK ('' ~ rx IN ('t','f')) > ); wow. This is beautiful :) ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [SQL] Finding broken regex'es

2007-10-03 Thread Dawid Kuroczko
On 10/2/07, Enrico Weigelt <[EMAIL PROTECTED]> wrote: > > Hi folks, > > > I'm looking for some way to find broken regex'es in some column > to kick them off. For now I'm regularily fetching all regexes > from an PHP script, try an preg_match() and so find the broken > ones to later remove them. > >