On Wed, Oct 26, 2005 at 12:58:13AM -0300, Marc G. Fournier wrote:
> Does anyone know of, or have, any comparisions of the overhead going with
> something like pl/perl or pl/php vs using pl/pgsql?
Benchmark results will probably depend on the type of processing
you're doing. I'd expect PL/pgSQL t
"Bath, David" <[EMAIL PROTECTED]> writes:
> ... Note that Sybase/MS-SQL's
> check constraint model asserts the constraint BEFORE the trigger, which
> discourages you from attempting to check and handle meaning of data!
Er, doesn't PG do it that way too?
regards, tom lane
On Wednesday 26 Oct 2005 11:52 am, Bath, David wrote:
> > This guy is not worth arguing with.
> D'Accord!
thanks all for the clarification. in case anyone is interested in the
original conversation it is here:
http://ebergen.net/wordpress/?p=83
--
regards
kg
http://www.livejournal.com/users/
tobbe wrote:
Hi.
I have a little problem.
In a system of mine i need to insert records into table [tbStat], and
if the records exist i need to update them instead and increase a
column [cQuantity] for every update.
I.e. the first insert sets cQuantity to 1, and for every other run
cQuantity i
chester c young wrote:
in php (for example) it's frequently nice to get the structure of a
table without any data, ie, pull a single row with each attribute's
value is null. I use the query (dual is a table of one row ala
Oracle):
select m.* from dual
left join mytable m on( false );
Out of c
Hi,
Can anyone tell me how to convert epoch to timestamp ?
ie reverse of :
SELECT EXTRACT( epoch FROM now() );
+--+
|date_part |
+--+
| 1130317518.61997 |
+--+
(1 row)
Regds
mallah.
---(end of broadcast)--
Rajesh Kumar Mallah wrote:
Hi,
Can anyone tell me how to convert epoch to timestamp ?
ie reverse of :
SELECT EXTRACT( epoch FROM now() );
I'd start with either Google or the manuals.
http://www.postgresql.org/docs/8.0/interactive/functions-datetime.html
Scroll down to the section on "epoc
am 26.10.2005, um 14:35:51 +0530 mailte Rajesh Kumar Mallah folgendes:
> Hi,
>
> Can anyone tell me how to convert epoch to timestamp ?
>
> ie reverse of :
>
> SELECT EXTRACT( epoch FROM now() );
> +--+
> |date_part |
> +--+
> | 1130317518.61997 |
> +---
Rajesh Kumar Mallah mentioned :
=> Can anyone tell me how to convert epoch to timestamp ?
=>
=> ie reverse of :
=>
=> SELECT EXTRACT( epoch FROM now() );
=> +--+
=> |date_part |
=> +--+
=> | 1130317518.61997 |
=> +--+
Here is one way (In m
On Wed, 26 Oct 2005, Michael Fuhr wrote:
On Wed, Oct 26, 2005 at 12:58:13AM -0300, Marc G. Fournier wrote:
Does anyone know of, or have, any comparisions of the overhead going with
something like pl/perl or pl/php vs using pl/pgsql?
Benchmark results will probably depend on the type of proces
Hi I am having some problem with function that returns SETOF RECORD
Here is my function:
CREATE OR REPLACE FUNCTION test_record(text)
RETURNS SETOF RECORD AS
$BODY$
DECLARE
p_table_name ALIAS FOR $1;
temp_rec RECORD;
v_query text;
BEGIN
v_query = 'SELECT * FROM ' || p_table_name; FOR temp_
On 10/26/05 6:34 AM, "Christian Paul B. Cosinas" <[EMAIL PROTECTED]> wrote:
> Hi I am having some problem with function that returns SETOF RECORD
>
> Here is my function:
>
> CREATE OR REPLACE FUNCTION test_record(text)
> RETURNS SETOF RECORD AS
> $BODY$
>
>
> DECLARE
> p_table_name ALIAS FOR
Consider this function:
CREATE OR REPLACE FUNCTION php_get_subfield_data_repeating(int4,
"varchar")
RETURNS SETOF "varchar" AS
$BODY$
DECLARE
aRecordID ALIAS FOR $1;
aSubFieldId ALIAS FOR $2;
returnValue record;
subFieldNumber char(3);
subFieldLetter char
On 10/26/05 8:38 AM, "Mario Splivalo" <[EMAIL PROTECTED]> wrote:
> Consider this function:
>
> CREATE OR REPLACE FUNCTION php_get_subfield_data_repeating(int4,
> "varchar")
> RETURNS SETOF "varchar" AS
> $BODY$
> DECLARE
> aRecordID ALIAS FOR $1;
> aSubFieldId ALIAS FOR $2;
>
> returnValue recor
On Wed, 2005-10-26 at 08:54 -0400, Sean Davis wrote:
> > Now, when I do this:
> >
> > biblio3=# select * from php_get_subfield_data_repeating(1,'606a');
> > php_get_subfield_data_repeating1
> > --
> > (Anđeli)
> > (ofsajd)
> > (2 rows)
>
> Does:
>
> select * from
PL/pgSQL is as *internal* as for example PL/Tcl. The two are actually
pretty similar and I would expect them to perform similar, if one knows
what and how he does.
PL/pgSQL is an external shared object, loaded on call of the first func
per backend. Same for PL/Tcl.
PL/pgSQL takes pg_proc.pro
Mario Splivalo <[EMAIL PROTECTED]> writes:
> biblio3=# select * from php_get_subfield_data_repeating(1,'606a');
> php_get_subfield_data_repeating1
> --
> (AnÄeli)
> (ofsajd)
> (2 rows)
> I have return values in parentheses.
You're getting bit by plpgsql's perha
On Tue, 2005-10-25 at 23:45, Kenneth Gonsalves wrote:
> hi,
> i was in a minor flame war with a mysql guy - his major grouse was that
> 'I wouldnt commit mission critical data to a database that needs to be
> vacuumed once a week'. So why does pg need vacuum?
The absolutely funniest thing about
On Wed, 26 Oct 2005, Mario Splivalo wrote:
> Consider this function:
>
> CREATE OR REPLACE FUNCTION php_get_subfield_data_repeating(int4,
> "varchar")
> RETURNS SETOF "varchar" AS
> $BODY$
> DECLARE
> aRecordID ALIAS FOR $1;
> aSubFieldId ALIAS FOR $2;
>
> returnValue record;
>
Hi folks
I've got a table holding item code(cs_id), supplier a/c (co_id) , and
price (cs_price).
How can I select the rows containing the lowest price for each item
code?
I've tried various forms of min() etc and know it must be simple but I'm
stumped.
Gary
--
Gary Stainburn
This email do
Hi,
I've a table like:
=> SELECT dt FROM sales WHERE id = 2;
dt
2005-10-25 21:43:35.870049
2005-10-25 21:43:36.254122
2005-10-25 21:43:36.591196
2005-10-25 21:43:36.893331
2005-10-25 21:43:37.265671
2005-10-25 21:43:37.688186
2005-10-25 22:25:35.2131
On Tue, 2005-10-25 at 23:45, Kenneth Gonsalves wrote:
> hi,
> i was in a minor flame war with a mysql guy - his major grouse was that
> 'I wouldnt commit mission critical data to a database that needs to be
> vacuumed once a week'. So why does pg need vacuum?
Oh man oh man. After reading the ar
On Wednesday 26 October 2005 4:21 pm, Gary Stainburn wrote:
> Hi folks
>
> I've got a table holding item code(cs_id), supplier a/c (co_id) , and
> price (cs_price).
>
> How can I select the rows containing the lowest price for each item
> code?
>
> I've tried various forms of min() etc and know it
On Wed, 2005-10-26 at 10:16, Volkan YAZICI wrote:
> => SELECT
> -> (SELECT count(id) FROM sales
> -> WHERE id = 2
> -> AND date_trunc('hour', dt) = '2005-10-25 21:00:00'),
> -> (SELECT count(id) FROM sales
> -> WHERE id = 2
> -> AND date_trunc('hour', dt) =
On Wed, 2005-10-26 at 11:09, Jan Wieck wrote:
> On 10/26/2005 11:19 AM, Scott Marlowe wrote:
>
> > On Tue, 2005-10-25 at 23:45, Kenneth Gonsalves wrote:
> >> hi,
> >> i was in a minor flame war with a mysql guy - his major grouse was that
> >> 'I wouldnt commit mission critical data to a database
On 10/26/2005 11:19 AM, Scott Marlowe wrote:
On Tue, 2005-10-25 at 23:45, Kenneth Gonsalves wrote:
hi,
i was in a minor flame war with a mysql guy - his major grouse was that
'I wouldnt commit mission critical data to a database that needs to be
vacuumed once a week'. So why does pg need vacu
Scott Marlowe <[EMAIL PROTECTED]> writes:
> On Tue, 2005-10-25 at 23:45, Kenneth Gonsalves wrote:
>> i was in a minor flame war with a mysql guy - his major grouse was that
>> 'I wouldnt commit mission critical data to a database that needs to be
>> vacuumed once a week'. So why does pg need vacu
> Tom Lane <[EMAIL PROTECTED]> wrote:
>> Michael Fuhr <[EMAIL PROTECTED]> writes:
> > On Tue, Oct 25, 2005 at 04:56:11PM -0700, chester c young wrote:
> >> in php (for example) it's frequently nice to get the structure of
> >> table without any data,
>
> > Have you considered "SELECT * FROM mytabl
On Wed, Oct 26, 2005 at 06:16:13PM +0300, Volkan YAZICI wrote:
> => SELECT
> -> (SELECT count(id) FROM sales
> -> WHERE id = 2
> -> AND date_trunc('hour', dt) = '2005-10-25 21:00:00'),
> -> (SELECT count(id) FROM sales
> -> WHERE id = 2
> -> AND date_trunc('h
On Wed, 2005-10-26 at 11:12, Tom Lane wrote:
> Scott Marlowe <[EMAIL PROTECTED]> writes:
> > On Tue, 2005-10-25 at 23:45, Kenneth Gonsalves wrote:
> >> i was in a minor flame war with a mysql guy - his major grouse was that
> >> 'I wouldnt commit mission critical data to a database that needs to b
chester c young <[EMAIL PROTECTED]> writes:
> i think i misled: the goal is to retrieve _one_ row where the value of
> each attribute is null.
Er, what for? There's no data content in that, by definition. Why not
retrieve zero rows and look at the metadata anyway?
regard
The trans table contains the stub for each transaction and the trans_item table contains all the items belonging to the transaction. I need to be able to pull categorized reports for items and have all of the totals less the discounts match up with the total from the stubs for a given period. Why
> Tom Lane <[EMAIL PROTECTED]> wrote:
> chester c young <[EMAIL PROTECTED]> writes:
> > i think i misled: the goal is to retrieve _one_ row where the value
> of each attribute is null.
>
> Er, what for? There's no data content in that, by definition. Why
> not retrieve zero rows and look at the
On Wed, Oct 26, 2005 at 18:16:13 +0300,
Volkan YAZICI <[EMAIL PROTECTED]> wrote:
> And I want to collect the count of sales at hour = 21 and hour = 22.
> For this purpose, I'm using below SELECT query:
>
> => SELECT
> -> (SELECT count(id) FROM sales
> -> WHERE id = 2
> -> AND
On Wed, Oct 26, 2005 at 16:38:48 +0100,
Gary Stainburn <[EMAIL PROTECTED]> wrote:
> On Wednesday 26 October 2005 4:21 pm, Gary Stainburn wrote:
> > Hi folks
> >
> > I've got a table holding item code(cs_id), supplier a/c (co_id) , and
> > price (cs_price).
> >
> > How can I select the rows contai
On Wed, 2005-10-26 at 10:40 -0400, Tom Lane wrote:
> Mario Splivalo <[EMAIL PROTECTED]> writes:
> > biblio3=# select * from php_get_subfield_data_repeating(1,'606a');
> > php_get_subfield_data_repeating1
> > --
> > (Anđeli)
> > (ofsajd)
> > (2 rows)
>
> > I have
Mario Splivalo <[EMAIL PROTECTED]> writes:
> Wo-ha, makes perfect sense. So, I'd go by with declaring the rec as
> varchar, instead as of a record. Wich is what I should do in the first
> place.
Or just return the correct field out of it.
RETURN NEXT returnValue.fieldname;
I think you ma
On Wed, 2005-10-26 at 15:45 -0400, Tom Lane wrote:
> Mario Splivalo <[EMAIL PROTECTED]> writes:
> > Wo-ha, makes perfect sense. So, I'd go by with declaring the rec as
> > varchar, instead as of a record. Wich is what I should do in the first
> > place.
>
> Or just return the correct field out of
Tyler Kellen <[EMAIL PROTECTED]> writes:
> Why is my discount total different when I
> left join the trans table to the totals?
Are you sure that trans_item.trans_id is unique and accounts for all the
existing values of trans.id? I don't see any unique index or foreign
key constraints in your \d
On Oct 21, 2005, at 9:19 AM, [EMAIL PROTECTED] wrote:
I have been trying to find a way to return more than one but
different types of
variables. How do I return more than one but mix types of variables.
Any help is appriaciated.
Thanks;
In PostgreSQL 8.1, you'll have output parameters avail
Tom,
After I wrote
> > Sybase/MS-SQL's check constraint model asserts the constraint
> > BEFORE the trigger, which discourages you from attempting to>
> > check and handle meaning of data!
you wrote (2005-10-26 17:00)
> Er, doesn't PG do it that way too?
Well, it works for me! In this case (wit
"Bath, David" <[EMAIL PROTECTED]> writes:
> you wrote (2005-10-26 17:00)
>>> Sybase/MS-SQL's check constraint model asserts the constraint
>>> BEFORE the trigger, which discourages you from attempting to>
>>> check and handle meaning of data!
>> Er, doesn't PG do it that way too?
> Well, it work
On Wednesday 26 October 2005 17:44, Scott Marlowe wrote:
> On Tue, 2005-10-25 at 23:45, Kenneth Gonsalves wrote:
> > hi,
> > i was in a minor flame war with a mysql guy - his major grouse was that
> > 'I wouldnt commit mission critical data to a database that needs to be
> > vacuumed once a week'.
hello developers,
i have facing one major problem handling sql money dataType in the java
i have tried many permutation and combination but still i dint got correct data type to use in java to pass money data
44 matches
Mail list logo