Re: [SQL] Convert INT to INTERVAL?

2004-02-27 Thread Tom Lane
Brian Knox <[EMAIL PROTECTED]> writes: > Is it possible within pl/pgsql, to convert an integer to an interval in > months? IE, if num_months is an INT set to 48, can it be converted to an > interval? Sure, just multiply by the appropriate interval value: regression=# select 48 * '1 month'::inte

Re: [SQL] Convert INT to INTERVAL?

2004-02-27 Thread Bruno Wolff III
On Fri, Feb 27, 2004 at 11:54:04 -0500, Brian Knox <[EMAIL PROTECTED]> wrote: > Is it possible within pl/pgsql, to convert an integer to an interval in > months? IE, if num_months is an INT set to 48, can it be converted to an > interval? Can you use num_months * '1 month'::interval ? ---

Re: [SQL] searching polygons

2004-02-27 Thread David
Hi elin thanks for advice, i looked at your website but i didnt really understand the information given, sorry. However i looked at the postgres documentation and realised what i had to do select * from species where location[1] @ polygon '((0,0), (1000,0), (1000,1000), (0,1000))': This works fin

Re: [SQL] Convert INT to INTERVAL?

2004-02-27 Thread Stephan Szabo
On Fri, 27 Feb 2004, Brian Knox wrote: > Is it possible within pl/pgsql, to convert an integer to an interval in > months? IE, if num_months is an INT set to 48, can it be converted to an > interval? You should be able to say something like num_months * INTERVAL '1 month' I believe. ---

[SQL] Convert INT to INTERVAL?

2004-02-27 Thread Brian Knox
Is it possible within pl/pgsql, to convert an integer to an interval in months? IE, if num_months is an INT set to 48, can it be converted to an interval? Thanks, Brian ---(end of broadcast)--- TIP 7: don't forget to increase your free space map se

Re: [SQL] BUG #1083: Insert query reordering interacts badly with

2004-02-27 Thread Bruno Wolff III
I am going to try to move this over the sql list, since it doesn't belong on bugs. On Tue, Feb 24, 2004 at 23:47:48 +1300, Martin Langhoff <[EMAIL PROTECTED]> wrote: > Tom Lane wrote: > > >How about > > > >SELECT nextval('seq'); -- ignore result > > > >INSERT INTO ... VALUES (currval('seq