Here I'm posting a function to convert array to records.
any other suggestions are welcome
create or replace function array_to_records(int[]) RETURNS SETOF record AS
$$
DECLARE
ret_rec record;
a int;
b int;
BEGIN
b = length(array_dims($1));
a = substr(array_dims($1),4, (b-4) );
FOR
I have tried testing the perofmance on indexing array element using standard
btree and it doesn't help anything. It still costing alot.
create index idx_properties_address_4 on properties ((address_arr[4]))
does contrib/intarray effective for text array?
On 3/16/06, Oleg Bartunov wrote:
co
Is it possible to search partial word as like '%...%' in tsearch?
Yudie
Help!
Try to install plperl
./createlang plperl mydb
createlang: language installation failed: ERROR: could not access file "$libdir/plperl": No such file or directory
Back to my original question where is it possible to run a command line from a function?
I'm running postgresql 7.4.1. is it can't really be used for trigger function?
http://www.postgresql.org/docs/7.4/static/plperl-missing.html
I want to execute a command line from trigger function.
The reason is I want to execute my perl script from stored procedure.
any idea?
Yudie
How can I possible to find out what table a record belong to from record's oid?
Thanks
Yudie
On 8/5/05, Tom Lane <[EMAIL PROTECTED]> wrote:
Certainly not --- per the SQL spec, different elements of a FROM listare independent, so the datelist relation can't refer to P.
(I think SQL 2003 has a construct called LATERAL that would allowsuch things, but we don't implement that yet.)The only wa
what about something likeselect id,datelistfrom payment as p, (select * from datelist('8/1/2005, 8/5/2005')) as list
where datelist between p.date_start and p.date_end;
That's works but have to put the whole date range into the parameters before it can be joined.
This would need 2 queries whe
try select * from payment as p, (select * from datelist('8/1/2005, 8/5/2005')) as datewhere date.. = p.
The problem is the function's parameters '8/1/2005', '8/5/2005' has to refer to whatever value on the payment records.
Hi everyone,
I have a function returning set of date called datelist(date,date)
example:
select * from datelist('8/1/2005, 8/5/2005');
8/1/2005
8/2/3005
8/3/2004
8/4/2005
8/5/2005
I would like to join this function with a table
create table payment(
id int4 not null,
date_start date,
date_e
I do not believe you can do this without a subquery - you are tryingto get 2 separate pieces of information from your data
* some data about the record having MAX(rank) for each categoryand * the count of records in each category
Hi, I guess i try to answer my own question which end up with c
Hello,
I have a table, structure like this:
create table product(
sku, int4 not null,
category int4 null,
display_name varchar(100) null,
rank int4 null
)
let say example data:
sku, category, display_name
===
10001, 5, postgresql, 132
10002, 5, mysql, 243
10003, 5, oracl
> In my client be empty value for date fields ('. . ') , and I would
> like to use NULL values and empty values also.
What is your reason to put empty value ('') as alternative of null value?
---(end of broadcast)---
TIP 7: don't forget to inc
On Tue, 29 Mar 2005 16:00:37 -0500, John Burger <[EMAIL PROTECTED]> wrote:
> >> If it were me, and someone proposed a model where two-way replication
> >> was needed, I would tell them to rethink their model. It's broken.
> >
> > I would respectfully disagree that the requirement for two-way
> > r
> One way to do this is to add a write_access column to actions and use
> a constraint to force it to be true.
>Create a UNIQUE key of
> (name, write_access) for user_data and then add a FOREIGN KEY
> reference from (name, write_access) in actions to (name, write_access)
> in user_data.
Yes the
> > create index prdt_new_url_dx on prdt_new (url)
> > create index prdt_new_sku_dx on prdt_new (sku)
> > create index prdt_old_sku_dx on prdt_old (sku)
> > create index prdt_new_url_null_dx on prdt_new (url) where prdt_new.url
> > IS NULL
I added indexes & redo the analyze - Query plan looks bett
> Also, this is important, have you anayzed the table? I'm guessing no,
> since the estimates are 1,000 rows, but the has join is getting a little
> bit more than that. :)
>
> Analyze your database and then run the query again.
I analyze the table and it decrease number of rows in nested loop o
19 matches
Mail list logo