Re: [SQL] How to Port Oracle's user defined Package into Postgres 8.0.1.

2005-04-18 Thread CoL
hi, Dinesh Pandey wrote, On 4/11/2005 15:39: Hi folks, Can any one give me an idea about: How to Port Oracle's user defined Package into Postgres 8.0.1. there is no Package in postgresql. You have to rewrite the logic, extract the functions from Package and recreate them for postgres. But you

Re: [SQL] VIEW / ORDER BY + UNION

2005-02-22 Thread CoL
hi, WeiShang wrote, On 2/17/2005 16:46: Hi, I have created a view like this : CREATE VIEW v1 AS (SELECT orderno,weekday,time FROM t1,t2 where t1.orderno=t2.orderno); if I create a SQL statment: (SELECT orderno FROM v1 WHERE weekday='MON' ORDER BY orderno) UNION (SELECT orderno FROM v1 WHERE

Re: [SQL] Calling a table residing in another database from Plpgsql

2005-01-09 Thread CoL
hi, [EMAIL PROTECTED] wrote, On 1/5/2005 06:13: I infact downloaded the dblink package in contrib folder. But still when i tried to use dblink in the following manner: SELECT * from dblink('host=192.168.0.50 dbname=AK1 user=akteam','Select userid from user_reg') as t (userid integer); I am getting

Re: [SQL] multi results with functions

2004-05-31 Thread CoL
hi, kasper wrote, On 5/31/2004 00:02: Hi Im trying to make a stored procedure that returns * from at table, and returns multible rows. Can you do that, and how? basically I would like to do: create or replace function test () returns record as ' select * from dummytable; ' language sql; returns

Re: [SQL] Subqueries returning more than one value?

2004-05-11 Thread CoL
hi, Adam Witney wrote, On 5/11/2004 02:09: Hi, I am using a function in a subquery, this works ok: SELECT name, (SELECT p_my_func(1)) AS id FROM test; However I would like to have the function return 2 values into the main query... Something like this: SELECT name, (SELECT p_my_func(1)) AS

Re: [SQL] Check a value in array

2004-05-04 Thread CoL
hi, Marco Lazzeri wrote: Il gio, 2004-04-29 alle 19:56, Rod Taylor ha scritto: On Thu, 2004-04-29 at 13:37, Marco Lazzeri wrote: Hi all. I have to check if a value is in an array. I've got a date array in a table and I would like to perform queries like: SELECT * FROM table WHERE date IN

Re: [SQL] isnumeric() function?

2004-05-04 Thread CoL
hi, Yudie wrote: What is isnumeric function in postgresql? I'm using psql version 7.2.2 thanks probably somebody write a function called isnumeric for you :) So it must be a user defined function. C. ---(end of broadcast)--- TIP 9: the planner

Re: [SQL] Concatenate results of a single column query

2004-04-19 Thread CoL
hi, Christoph Haller wrote: Interesting feature, but I cannot find function array_append: ERROR: AggregateCreate: function array_append(integer[], integer) does not exist try with pg 7.4 C. ---(end of broadcast)--- TIP 9: the planner will ignore

Re: [SQL] Function for numbering rows?

2004-04-19 Thread CoL
hi, Tony Reina wrote, On 4/10/2004 18:12: Simple question: Is there a function that will allow me to number the returned tuples? e.g. CREATE TABLE test ( field1 text ): INSERT INTO test VALUES ('first'); INSERT INTO test VALUES ('second'); INSERT INTO test VALUES ('third'); INSERT INTO test

Re: [SQL] problem porting MySQL SQL to Postgres

2004-04-19 Thread CoL
hi, Dan Field wrote: I've stumbled across a query I don't quite understand the error message for. This query is pulled from a working MySQL setup: SELECT DEWEY_ID, DEWEY_HUNDREDS, DEWEY_TENS, DEWEY_ONES, DEWEY_POINT_ONES, DEWEY_POINT_TENS, DEWEY_POINT_HUNDREDS,

Re: [SQL] Update is very slow on a bigger table

2004-04-19 Thread CoL
hi, Dimitar Georgievski wrote, On 4/15/2004 23:07: hi, i'm running an update procedure on a table with approximately 100,000 records. The problem is the procedure is running endlessly even when the update is very simple like in the following example: update mytable set client_id = 1 where

Re: [SQL] testing for null value in integer field?

2003-12-22 Thread CoL
try: column is null, as manual shows. Geoffrey wrote: How does one check for an unset value in an integer field? I've tried such things as: select . where intnumber = '' select .. where intnumber = ? select . where intnumber = NULL Thanks. C. ---(end of

Re: [SQL] How to specify the beginning of the month in Postgres SQL syntax?

2003-12-09 Thread CoL
hi [EMAIL PROTECTED] wrote, On 12/7/2003 5:16 PM: Hello, I need to create a view in Postgres that has a where clause of the date beginning of month. i.e.: SELECT supplier_number, Sum(amount) AS due FROM purchase_orders WHERE date '2003-12-1' AND paid = 0 GROUP BY supplier_number ORDER BY

Re: [SQL] Validity check in to_date?

2003-12-04 Thread CoL
hi, SELECT isfinite(timestamp '123.45.2003'); if this is true, the date is ok, if error, than not :) C. Alexander M. Pravking wrote: I just discovered that to_date() function does not check if supplied date is correct, giving surprising (at least for me) results: fduch=# SELECT

Re: [SQL] XML Postgres Functions

2003-12-04 Thread CoL
hi, zerobearing2 wrote: Hi all- I'm migrating to postgres from the MS SQL Server land, as I can see a great potential with postgres, I was wondering if anyone has experimented or started a project with XML inside user defined functions? I've seen the contrib/xml shipped with the distro, as I

Re: [SQL] URGENT!!! changing Column size

2003-10-27 Thread CoL
Hi, [EMAIL PROTECTED] wrote, On 10/27/2003 6:10 PM: Hi can we change the size of a column in postgres. I have a table named institution and column name is name varchar2(25), i want to change it to varchar2(50). Please let me know. 1 solution: begin; create temporary table temp as select * from

Re: [SQL] Restore deleted records

2003-08-26 Thread CoL
Hi, Konstantin Petrenko wrote, On 8/26/2003 11:37 AM: Hello. I accidentally deleted some recordes from my table. How can I restore them? Is it possible in 7.3.3? if you have a dump, or you are still in a transaction, you can rollback. C. ---(end of

Re: [SQL] Two Permance Questions

2002-09-27 Thread CoL
The select without subselect of course is better, and faster. Check your explain analyze select ... to se the performance, and to check the index usage if any. C. CN LIOU wrote: Hi! Q1. Is subquery better or join? For subquery: SELECT t1.c1,(SELECT t2.c2 FROM t2 WHERE t2.c1 = t1.c1)

[SQL] lastoid from sql

2002-09-27 Thread CoL
Hi, how can I get tha lastoid variable from sql? thx. C. ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] lastoid from sql

2002-09-27 Thread CoL
select :LASTOID; sorry! :) and thx;) CoL wrote: Hi, how can I get tha lastoid variable from sql? thx. C. ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [SQL] index problem

2001-10-18 Thread CoL
Hi, Stephan Szabo wrote: On Tue, 16 Oct 2001, CoL wrote: --- The 2 table query, where prog_data has ~8800 rowsn and index on prog_id: bash-2.04$ time echo explain select distinct prog_id,prog_ftype,prog_fcasthour,prog_date from prog_dgy_xy,prog_data where

Re: [SQL] index problem

2001-10-17 Thread CoL
=. (same table, same index, vacuumed) (made the test more than twice) It seams to be a 7.1.3 bug? i do not test yet with 7.1.2 but tomorrow i will. CoL Stephan Szabo wrote: On Mon, 15 Oct 2001, Szabo Zoltan wrote: Hi, I have that: 1) db= explain select pxygy_pid from prog_dgy_xy where