Re: [SQL] Scaler forms as function arguments

2003-11-27 Thread Joe Conway
Richard Huxton wrote: On Wednesday 26 November 2003 15:40, Andreas Tille wrote: I want to write a function of the following type CREATE FUNCTION test ( ) RETURNS setof MyTable AS 'SELECT * FROM MyTable WHERE id IN $1' LANGUAGE 'SQL' ; Not as you've done it. You c

Re: [SQL] Scaler forms as function arguments

2003-11-27 Thread Richard Huxton
On Thursday 27 November 2003 16:40, Andreas Tille wrote: > On Thu, 27 Nov 2003, Joe Conway wrote: > > Andreas Tille wrote: > > > test=# select PLpgSQLDepartmentSalaries() ; > > > > This should be: > > regression=# select * from PLpgSQLDepartmentSalaries(); > > departmentid | totalsalary > > -

[SQL] explicit joins wrong planning

2003-11-27 Thread Tomasz Myrta
Hi SELECT version(); PostgreSQL 7.3.4 on i386-pc-linux-gnu, compiled by GCC i386-linux-gcc (GCC) 3.3.2 20031005 (Debian prerelease) Let's say I have 3 tables: groups ( groupid integer primary key, namevarchar, begindate date ); offsets ( offset_id integer, groupid

Re: [SQL] Scaler forms as function arguments

2003-11-27 Thread Andreas Tille
On Thu, 27 Nov 2003, Joe Conway wrote: > Andreas Tille wrote: > > test=# select PLpgSQLDepartmentSalaries() ; > > This should be: > regression=# select * from PLpgSQLDepartmentSalaries(); > departmentid | totalsalary > --+- > 1 | 8 > 2

Re: [SQL] Scaler forms as function arguments

2003-11-27 Thread Joe Conway
Andreas Tille wrote: test=# select PLpgSQLDepartmentSalaries() ; This should be: regression=# select * from PLpgSQLDepartmentSalaries(); departmentid | totalsalary --+- 1 | 8 2 | 6 (2 rows) HTH, Joe ---

[SQL] Validity check in to_date?

2003-11-27 Thread Alexander M. Pravking
I just discovered that to_date() function does not check if supplied date is correct, giving surprising (at least for me) results: fduch=# SELECT to_date('31.11.2003', 'DD.MM.'); to_date 2003-12-01 or even fduch=# SELECT to_date('123.45.2003', 'DD.MM.'); to_date ---

Re: [SQL] Problem: Postgresql not starting

2003-11-27 Thread Christoph Haller
> > Hi All > I am using postgresql 7.2 on Linux. It does not start when i am trying th= > is > /etc/rc.d/init.d/postgresql restart. > It give an error saying "postmaster already running". > I have done > rm -f /var/lib/pgsql/data/postmaster.pid > and > rm -f /var/run/postmaster.pid > > But it sti

Re: [SQL] Scaler forms as function arguments

2003-11-27 Thread Andreas Tille
On Wed, 26 Nov 2003, Richard Huxton wrote: > Not as you've done it. You could pass in text "(1,2,3)", build your query and > use EXECUTE to execute it. This boils down the question to the problem which occured with your promissing link below, because I need to use PL/pgSQL, right? > Alternatively

[SQL] Unsigned numbers

2003-11-27 Thread Kaloyan Iliev Iliev
10x you all ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [SQL] Equivalent of Reverse() functions

2003-11-27 Thread Joe Conway
Kumar wrote: I am migrating an SQL Server 2000 database to Postgres 7.3.4 running on RH Linux 7.2. While migrating I encounter SQL Server REVERSE( ) function, seems no such functions at Postgres. Is there a equivalent function available at Postgres? Please shed some light How about: create or repl

[SQL] Equivalent of Reverse() functions

2003-11-27 Thread Kumar
Dear Friends,   I am migrating an SQL Server 2000 database to Postgres 7.3.4 running on RH Linux 7.2. While migrating I encounter SQL Server REVERSE( ) function, seems no such functions at Postgres.   Is there a equivalent function available at Postgres? Please shed some light   Regards Kumar