Re: [SQL] problems with postmaster

2000-11-24 Thread Mike Castle

ipcclean
pg_ctl stop

Though finding out about ipcclean was not easy considering the output
given.  There is no mention of it in any of the FAQs.

mrc
-- 
   Mike Castle   Life is like a clock:  You can work constantly
  [EMAIL PROTECTED]  and be right all the time, or not work at all
www.netcom.com/~dalgoda/ and be right at least twice a day.  -- mrc
We are all of us living in the shadow of Manhattan.  -- Watchmen



Re: [SQL] reinitialize a sequence?

2000-12-04 Thread Mike Castle


setval();

Sometimes it's good to read files in the source tree (such as HISTORY).

mrc
-- 
   Mike Castle   Life is like a clock:  You can work constantly
  [EMAIL PROTECTED]  and be right all the time, or not work at all
www.netcom.com/~dalgoda/ and be right at least twice a day.  -- mrc
We are all of us living in the shadow of Manhattan.  -- Watchmen



Re: [SQL] plpgsql

2000-12-12 Thread Mike Castle

On Sat, Dec 09, 2000 at 08:16:06AM +, feblec wrote:
> FUNCTION: 'plpgsql'.  Recognized languages are sql, C, internal and the
> created procedural languages.

Look at: postgresql-7.0.3/src/pl/plpgsql/enable_plpgsql

mrc
-- 
   Mike Castle   Life is like a clock:  You can work constantly
  [EMAIL PROTECTED]  and be right all the time, or not work at all
www.netcom.com/~dalgoda/ and be right at least twice a day.  -- mrc
We are all of us living in the shadow of Manhattan.  -- Watchmen



Re: [SQL] Invoice number

2000-12-21 Thread Mike Castle

On Thu, Dec 21, 2000 at 11:10:00AM +0100, Kaare Rasmussen wrote:
> - Sequences are not rollback'able.

Did you mean SERIAL instead of sequence here?

If so, why is no rollbackable an issue?  All you should need is unique
numbers.  Not necessarily exactly sequential numbers.

mrc
-- 
       Mike Castle   Life is like a clock:  You can work constantly
  [EMAIL PROTECTED]  and be right all the time, or not work at all
www.netcom.com/~dalgoda/ and be right at least twice a day.  -- mrc
We are all of us living in the shadow of Manhattan.  -- Watchmen



Re: [SQL] Create table doesn't work in plpgsql

2000-12-21 Thread Mike Castle

On Thu, Dec 21, 2000 at 11:51:38AM +0100, Volker Paul wrote:
> select famname || ', ' || givname from person where id=1234;
> I know it's possible by building the select e.g. in bash
> and calling psql with it as an argument, but do you see a possibility
> that is closer to Postgres, e.g. in plpgsql?

Can this be done using tcl or perl?

mrc
-- 
   Mike Castle   Life is like a clock:  You can work constantly
  [EMAIL PROTECTED]  and be right all the time, or not work at all
www.netcom.com/~dalgoda/ and be right at least twice a day.  -- mrc
We are all of us living in the shadow of Manhattan.  -- Watchmen



Re: [SQL] Invoice number

2000-12-21 Thread Mike Castle

On Thu, Dec 21, 2000 at 05:50:43PM +, Oliver Elphick wrote:
> Mike Castle wrote:
>   >On Thu, Dec 21, 2000 at 11:10:00AM +0100, Kaare Rasmussen wrote:
>   >> - Sequences are not rollback'able.
>   >
>   >Did you mean SERIAL instead of sequence here?
>   >
>   >If so, why is no rollbackable an issue?  All you should need is unique
>   >numbers.  Not necessarily exactly sequential numbers.
> 
> For invoice numbers, it matters.
> 
> Numbers missing from such a sequence are likely to provoke questions from
> auditors and taxmen; why borrow trouble?

What do you do on the following scenario:

Client 1 is placing an order, gets invoice #1.
Client 2 is simultaneously placing an order, and gets invoice #2.

Client 1 changes mind and cancels order.  Invoice #1 is not used.  Invoice
#2 is.

Client 3 comes along.  Do they use invoice #1, out of order, or invoice #3?

I suppose of the assignment of the invoice number is set up in such a way
as it is the very last action performed just before the commit, you should
be able to ensure that indeed the situation of having to deal with a
rollback would never occur (outside of a system crash between assignment of
invoice and commit, and that could be explained to auditors).

[What happens in a paper world if a cup of coffee is spilt on some
invoices, and these precious items are thrown in the trash?]

mrc
-- 
   Mike Castle   Life is like a clock:  You can work constantly
  [EMAIL PROTECTED]  and be right all the time, or not work at all
www.netcom.com/~dalgoda/ and be right at least twice a day.  -- mrc
We are all of us living in the shadow of Manhattan.  -- Watchmen



Re: [SQL] Using INDEX on date/time values // Re: how to select a time frame on timestamp rows.

2001-01-14 Thread Mike Castle

On Sun, Jan 14, 2001 at 04:46:08AM +0100, Alvar Freude wrote:
> Peter Eisentraut schrieb:
> > 
> > >   today i was trying to perform a query on a database using a time stamp
> > > field, i need to get all records which belong to year 2000, month 11,
> [...]
> > select user_name from tbacct where extract(month from acct_timestamp) = 11 ...
> 
> is there any way of using an index for selecting some rows, e.g.
> selecting all data from one month?


What about select blah from foo where month >= 2000-11-01 and month < 2000-12-01

Fix up as appropriate.

mrc
-- 
   Mike Castle   Life is like a clock:  You can work constantly
  [EMAIL PROTECTED]  and be right all the time, or not work at all
www.netcom.com/~dalgoda/ and be right at least twice a day.  -- mrc
We are all of us living in the shadow of Manhattan.  -- Watchmen



Re: [SQL] Problem with Dates

2001-01-24 Thread Mike Castle

On Thu, Jan 25, 2001 at 08:49:27AM +1300, Glen and Rosanne Eustace wrote:
> I am using 7.0.3,
> I have a column tstamp defined to be 'date';
> 
> With a current value of '31-12-2000',
> if I update tstamp=tstamp+'1 year'::timespan
> I get '1-1-2002'

This almost sounds like it takes the year 2000, figures out it needs 366
days, and uses that for "1 year".

However, I don't see that error myself:

template1=> select '2000-12-31'::timestamp+'1 year';
?column?

 2001-12-31 00:00:00-08
(1 row)

template1=> select '2000-12-31'::timestamp+'1 year'::timespan;
?column?

 2001-12-31 00:00:00-08
(1 row)

mrc
-- 
   Mike Castle   Life is like a clock:  You can work constantly
  [EMAIL PROTECTED]  and be right all the time, or not work at all
www.netcom.com/~dalgoda/ and be right at least twice a day.  -- mrc
We are all of us living in the shadow of Manhattan.  -- Watchmen



[SQL] Re: Problem with Dates

2001-01-24 Thread Mike Castle

On Thu, Jan 25, 2001 at 03:06:38PM +1300, Glen and Rosanne Eustace wrote:
> pressie# select '31/12/2000'::date + '1 year'::timespan;
>   ?column?
> -
>  01/01/2002 00:00:00.00 NZDT
> (1 row)

What are the outputs of 
select '31/12/2000'::date;
select '31/12/2000'::date + '365 days'::timespan;

and 364, 363, etc.  

Not sure if gets you anywhere.  But data points.

There is an email archive on the postgresql.org website you could search if
you think it's been answered before.

mrc
-- 
   Mike Castle   Life is like a clock:  You can work constantly
  [EMAIL PROTECTED]  and be right all the time, or not work at all
www.netcom.com/~dalgoda/ and be right at least twice a day.  -- mrc
We are all of us living in the shadow of Manhattan.  -- Watchmen



Re: [SQL] Where are the 7.1 RPM's?

2001-04-17 Thread Mike Castle

On Tue, Apr 17, 2001 at 06:12:40PM -0700, clayton wrote:
> if a spec file was made avail we could all make rpms!

You too can ./configure ; make ; make install !!
-- 
   Mike Castle   Life is like a clock:  You can work constantly
  [EMAIL PROTECTED]  and be right all the time, or not work at all
www.netcom.com/~dalgoda/ and be right at least twice a day.  -- mrc
We are all of us living in the shadow of Manhattan.  -- Watchmen

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



Re: [SQL] has anyone tried running in MAC OS X

2001-05-17 Thread Mike Castle

On Thu, May 17, 2001 at 08:48:39PM -0400, postgresql wrote:
> I guess the subject line says ithas anyone tried running 
> PostgreSQL in MAC OS X. 

Isn't OS X fairly close to NEXTSTEP (or whatever the casing is these days)?

How well does PostgreSQL work on NS?

Did you try building it yet?  :->

mrc
-- 
   Mike Castle   Life is like a clock:  You can work constantly
  [EMAIL PROTECTED]  and be right all the time, or not work at all
www.netcom.com/~dalgoda/ and be right at least twice a day.  -- mrc
We are all of us living in the shadow of Manhattan.  -- Watchmen

---(end of broadcast)---
TIP 6: Have you searched our list archives?

http://www.postgresql.org/search.mpl