[SQL] date_trunc for 5 minutes intervals

2003-10-19 Thread email lists
Hi All,

I am wanting to perform the equivalent of date_trunc to 5/10/15 minute
intervals. As this does mnot seem to be natively supported by
date_trunc, can anyone point me in the right direction to possible write
the SQL ro acheive the desired outcome?

Tia,

Darren

---(end of broadcast)---
TIP 8: explain analyze is your friend


[SQL] Which is faster SQL or PL/PGSQL

2003-10-19 Thread George A.J
hi,
i am converting an MSSQL database to Postgres. there is a lot of procedures to convert.
which language is best for functions, SQL or plpgsql. 
which is faster . i am using postgres 7.3.2
jinujose
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search

Re: [SQL] Which is faster SQL or PL/PGSQL

2003-10-19 Thread Christopher Browne
The world rejoiced as [EMAIL PROTECTED] ("George A.J") wrote:
> i am converting an MSSQL database to Postgres. there is a lot of procedures to 
> convert.
>
> which language is best for functions, SQL or plpgsql.
>
> which is faster . i am using postgres 7.3.2

Hmm?  This doesn't seem to make much more sense than the question of
what colour a database should be ("Mauve has more RAM...").

SQL and pl/pgsql are quite distinct.  If you have procedures that
require programmed logic, with things like variables and loops, SQL
generally cannot do that, and you will HAVE to use one of the embedded
languages.

If raw speed is at issue, it is quite likely that rewriting the
procedures in C would lead to code that is faster still.

But the real question is of what language you *need* to implement in.
For certain sorts of simple procedures, SQL may suffice; as complexity
grows, you will need to use one of the other languages, whether
plpgsql, plperl, plpython, C, C++, and such, and the question won't be
of speed; it will be of necessity.
-- 
output = ("cbbrowne" "@" "cbbrowne.com")
http://www.ntlug.org/~cbbrowne/linuxdistributions.html
Never hit someone head on, always sideswipe.  Never say, "Foo's last
patch was brain-damaged", but rather, "While fixing the miscellaneous
bugs in 243.xyz [foo's patch], I found"
-- from the Symbolics Guidelines for Sending Mail

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [SQL] Which is faster SQL or PL/PGSQL

2003-10-19 Thread Josh Berkus
George,

> i am converting an MSSQL database to Postgres. there is a lot of procedures
> to convert.
>
> which language is best for functions, SQL or plpgsql.

If you're porting from T-SQL, you should use PL/pgSQL.  However, you will have 
to re-code many of your procedures by hand, as T-SQL and PL/pgSQL have 
substantially different syntax for control structures and cursors.

See the porting articles on techdocs.postgresql.org

> which is faster . i am using postgres 7.3.2

You should upgrade to the 7.3.4 if possible as it has some bug fixes missing 
in 7.3.2.

-- 
Josh Berkus
Aglio Database Solutions
San Francisco

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


[SQL] Max input parameter for a function

2003-10-19 Thread Kumar



Dear friends,
 
While trying to allocate about 36 input parameters, I got an 
error saying that the max input parameter for a function is only 
32.
 
Is it right? How to overcome this? Because I wanna insert 
records into a table of 55 columns with a lot of NULL able columns.
 
I am using Postgres 7.3.4 on RH Linux 7.2.
 
Note: I can't use 2 functions , one to insert 32 rows into the 
table first and the update the remaining columns with other function. Because 
there are only 27 columns that are not null.
 
Please shed some light.
 
Regards
Kumar