[GENERAL] [ask] Return Query

2009-03-15 Thread ataherster
hai all, i'm trying create function like this CREATE OR REPLACE FUNCTION penjualan(idcb integer) RETURNS SETOF penjualan AS $BODY$ BEGIN IF ($1 IS NULL) THEN return query SELECT * FROM PENJUALAN; ELSE return query SELECT * FROM PENJUALAN WHERE IDCABANG=$1; END IF; END; $BODY$ LANGUAGE

[GENERAL] to_hex leading zeroes

2009-03-15 Thread Pedro Doria Meunier
Hi All, I'm in a bit of a pickle here with the to_hex function not returning leading zeroes ... For instance if I: SELECT to_hex(10); it returns 'a' not '0a' . Any ideas on how to overcome this? TIA, Pedro Doria Meunier GSM: +351961720188 Skype: pdoriam signature.asc Description: This is

Re: [GENERAL] to_hex leading zeroes

2009-03-15 Thread Scott Marlowe
On Sun, Mar 15, 2009 at 6:47 AM, Pedro Doria Meunier pdo...@netmadeira.com wrote: Hi All, I'm in a bit of a pickle here with the to_hex function not returning leading zeroes ... For instance if I: SELECT to_hex(10); it returns 'a' not '0a' . Have you looked at lpad()? -- Sent via

Re: [GENERAL] [ask] Return Query

2009-03-15 Thread Justin
ataherster wrote: hai all, i'm trying create function like this CREATE OR REPLACE FUNCTION penjualan(idcb integer) RETURNS SETOF penjualan AS but this function is not work with this error : ERROR: structure of query does not match function result type CONTEXT: PL/pgSQL function penjualan

Re: [GENERAL] ODBC limitation??

2009-03-15 Thread Carl Sopchak
On Saturday, March 14, 2009, Adrian Klaver wrote: On Saturday 14 March 2009 5:40:40 pm Carl Sopchak wrote: When I run the following query through psql, it executes successfully. However, when I run it through ODBC (via OpenOffice Base), I get the error SQL Status: HY000 Error code:

Re: [GENERAL] ODBC limitation??

2009-03-15 Thread Carl Sopchak
On Saturday, March 14, 2009, Dann Corbit wrote: -Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general- ow...@postgresql.org] On Behalf Of Carl Sopchak Sent: Saturday, March 14, 2009 5:41 PM To: pgsql-general@postgresql.org Subject: [GENERAL] ODBC

Re: [GENERAL] ODBC limitation??

2009-03-15 Thread Carl Sopchak
On Saturday, March 14, 2009, Adrian Klaver wrote: On Saturday 14 March 2009 5:40:40 pm Carl Sopchak wrote: When I run the following query through psql, it executes successfully. However, when I run it through ODBC (via OpenOffice Base), I get the error SQL Status: HY000 Error code:

Re: [GENERAL] [ask] Return Query

2009-03-15 Thread Tom Lane
ataherster atahers...@yahoo.co.id writes: ... but this function is not work with this error : ERROR: structure of query does not match function result type CONTEXT: PL/pgSQL function penjualan line 6 at RETURN QUERY This looks like a known limitation in plpgsql: it's not very good with

[GENERAL] Best-N aggregates

2009-03-15 Thread Oliver Kennedy
Hi, I'm looking to write an aggregate of the form compute_over_best_n ( A, B ) where I'm trying to compute a value over the first n (where n is data- dependent) values in the input table, sorted over column A. Column B contains supplemental information used to determine n (that is, when

[GENERAL] Scanning a large binary field

2009-03-15 Thread Kynn Jones
I have a C program that reads a large binary file, and uses the read information plus some user-supplied arguments to generate an in-memory data structure that is used during the remainder of the program's execution. I would like to adapt this code so that it gets the original binary data from a

Re: [GENERAL] Scanning a large binary field

2009-03-15 Thread John R Pierce
Kynn Jones wrote: I have a C program that reads a large binary file, and uses the read information plus some user-supplied arguments to generate an in-memory data structure that is used during the remainder of the program's execution. I would like to adapt this code so that it gets the

Re: [GENERAL] Scanning a large binary field

2009-03-15 Thread Kynn Jones
On Sun, Mar 15, 2009 at 5:06 PM, John R Pierce pie...@hogranch.com wrote: Kynn Jones wrote: I have a C program that reads a large binary file, and uses the read information plus some user-supplied arguments to generate an in-memory data structure that is used during the remainder of the

Re: [GENERAL] Scanning a large binary field

2009-03-15 Thread John R Pierce
Kynn Jones wrote: That's a fair question. The program in question already gets from the relational database most of the external data it needs. The only exception to this is these large amorphous blobs, as you describe them. My only reason for wanting to put the blobs in the DB as well is

[GENERAL] Re: [Pkg-postgresql-public] Postgres major version support policy on Debian

2009-03-15 Thread Cédric Villemain
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Martin Pitt a écrit : Gerfried Fuchs [2008-10-06 17:04 +0200]: I'm sorry to have done the addition of pg 8.2 initially, and propably should also be sorry for adding pg 8.3 to backports.org, I thought it would be a service to the users, It is,

Re: [GENERAL] Maximum transaction rate

2009-03-15 Thread Marco Colombo
Joshua D. Drake wrote: I understand but disabling cache is not an option for anyone I know. So I need to know the other :) Joshua D. Drake Come on, how many people/organizations do you know who really need 30+ MB/s sustained write throughtput in the disk subsystem but can't afford a

[GENERAL] Oracle to PostgreSQL

2009-03-15 Thread Greenhorn
Hi, I have almost 1300 files from Oracle (no access to oracle server). I have to create the tables and data as follows. -- start script -- file name: aa_asset_type.sql CREATE TABLE AS_ASSET_TYPE ( MAIN_TYPE CHAR(3) NOT NULL, SUB_TYPE NUMBER(3)

Re: [GENERAL] Oracle to PostgreSQL

2009-03-15 Thread John R Pierce
Greenhorn wrote: Unfortunately When I execute the above files using \i I am getting errors like ERROR: syntax error at or near ( LINE 4: SUB_TYPE NUMBER(3) NOT NULL, Obviously 'number' is not PostgreSQL data type so is 'varchar2'. What is your suggestion to

Re: [GENERAL] Oracle to PostgreSQL

2009-03-15 Thread Thomas Kellerer
John R Pierce wrote on 16.03.2009 00:41: Greenhorn wrote: Unfortunately When I execute the above files using \i I am getting errors like ERROR: syntax error at or near ( LINE 4: SUB_TYPE NUMBER(3) NOT NULL, Obviously 'number' is not PostgreSQL data type so is

Re: [GENERAL] Oracle to PostgreSQL

2009-03-15 Thread John R Pierce
Thomas Kellerer wrote: change number to numeric, and varchar2 to char and you'll likely be good. My guess would have been that varchar is the equivalent to varchar2 char does a blank padding and is different in behaviour to varchar (as it is in Oracle) geez, yeah, what you said!

[GENERAL] PostgreSQL on Webmin

2009-03-15 Thread Kostadin Solakov
Hi there! I just installed Webmin on my dedicated server and I really had hard time making all configuration that were needed to migrate my site. Anyway, now everything is working except for one thing. I can't connect to the database through PHP. Remote connection is working fine, but local

Re: [GENERAL] PostgreSQL on Webmin

2009-03-15 Thread John R Pierce
Kostadin Solakov wrote: Hi there! I just installed Webmin on my dedicated server and I really had hard time making all configuration that were needed to migrate my site. Anyway, now everything is working except for one thing. I can’t connect to the database through PHP. Remote connection is

[GENERAL] Is there any defect when use null column in postgresql?

2009-03-15 Thread leopay
I wanna if there is any defact when use null column in postgresql, e.g. performance issue

[GENERAL] is there any defect when use null column in postgresql?

2009-03-15 Thread leopay
I wanna if there is any defact when use null column in pg, e.g. performance issue

Re: [GENERAL] is there any defect when use null column in postgresql?

2009-03-15 Thread Scott Marlowe
On Sun, Mar 15, 2009 at 9:00 PM, leopay leo...@gmail.com wrote: I wanna if there is any defact when use null column in pg, e.g. performance issue none that I know of. Any more specific scenarios you're wondering about? -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To

Re: [GENERAL] is there any defect when use null column in postgresql?

2009-03-15 Thread leopay
On Mon, Mar 16, 2009 at 11:36 AM, Scott Marlowe scott.marl...@gmail.comwrote: On Sun, Mar 15, 2009 at 9:00 PM, leopay leo...@gmail.com wrote: I wanna if there is any defact when use null column in pg, e.g. performance issue none that I know of. Any more specific scenarios you're wondering

Re: [GENERAL] is there any defect when use null column in postgresql?

2009-03-15 Thread Scott Marlowe
On Sun, Mar 15, 2009 at 9:39 PM, leopay leo...@gmail.com wrote: On Mon, Mar 16, 2009 at 11:36 AM, Scott Marlowe scott.marl...@gmail.com wrote: On Sun, Mar 15, 2009 at 9:00 PM, leopay leo...@gmail.com wrote: I wanna if there is any defact when use null column in pg, e.g. performance issue

[GENERAL] pg_ctl issue

2009-03-15 Thread Jack W
I installed PostgreSql on Window2003 server under an administrator account. I can start postgresql from Windows Service. But when run the following command, it fails: C:\Program Files\PostgreSQL\8.3\binpg_ctl start -D C:\Program Files\PostgreSQL\8.3\data server starting C:\Program

[Fwd: Re: [GENERAL] [ask] Return Query]

2009-03-15 Thread ataherster
---BeginMessage--- thanks Justin, my problem resolved, but i trying to re-create table and function, i'm using PGAdmin III to Create Script table and function before delete my table and function, after that I run Create Sript without change my script and working well my question is : whether