[SQL] function array_to_string(text[]) does not exist

2013-08-25 Thread Victor Sterpu
Hello When I run : SELECT array_to_string(array_agg(CONCAT(CAST (ltrv1.val_min AS CHAR), '-', CAST(ltrv1.val_max AS CHAR), ' ', ltrv1.comentarii))) FROM lab_tests_reference_values ltrv1 GROUP BY ltrv1.val_min, ltrv1.val_max, ltrv1.comentarii; I get the error: ERROR: function array_to_string(t

[SQL] ZIP function

2013-03-16 Thread Victor Sterpu
Is there a function that will give the resulting zip content for a string? Like SELECT zip('test data');? Thank you.

Re: [SQL] I need to fill up a sparse table in an view

2013-03-02 Thread Victor Yegorov
to get rid of the CTEs and write a bunch of subqueries to avoid optimization fences of CTEs, as for bigger tables this construct will be performing badly. -- Victor Y. Yegorov

[SQL] Trigger triggered from a foreign key

2012-10-19 Thread Victor Sterpu
I have this trigger that works fine. The trigger prevents the deletion of the last record. But I want skip this trigger execution when the delete is done from a external key. How can I do this? This is the fk ALTER TABLE focgdepartment ADD CONSTRAINT fk_focgdep_idfocg FOREIGN KEY (idfocg)

Re: [SQL] Need help with a special JOIN

2012-09-29 Thread Victor Sterpu
This is a way to do it, but things will change if you have many attributes/object SELECT o.*, COALESCE(a1.value, a2.value) FROM objects AS o LEFT JOIN attributes AS a1 ON (a1.object_id = o.id) LEFT JOIN attributes AS a2 ON (a2.object_id = 0); On 29.09.2012 19:02, Andreas wrote: Hi, asume I've

[SQL] Selecting data from XML

2012-07-16 Thread Victor Sterpu
If I have a XML like this can I write a query that will output the columns names and values like this? code;validFrom;validTo -- CLIN102;1980-02-23; CLIN103;1980-02-23;2012-01-01 Thank you -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make ch

[SQL] loosing data in postgres database

2011-01-24 Thread victor katemana
hi everyone, i have a problem of loosing data in my postgres database whenever i restart my machine what could be the possible problem help me out?

[SQL] failing to connect to postgresql with php

2011-01-17 Thread victor katemana
i have installed postgres 8.4 server in ubuntu 10.04, clearly following all procedures. what is disappointing me i cant establish connection to the database server when am configuring postgres with php. whenever i use this postgres database function i dont even receive an error message. the server

Re: [SQL] Seeking help with a query....

2003-03-24 Thread Victor Yegorov
w: it's just an assumption, you should write one yourself (on C for faster perfomance). Or simply use: code1 + code if your codes are of numeric type and are foreign keys to some other table's primary key. Please, give some feedback on usability of this solution. -- Victor Yegorov pgp0.pgp Description: PGP signature

[SQL] vacuum all but system tables

2003-03-19 Thread Victor Yegorov
or me, and I cannot find the original post I've seen some time ago. I'm running: `PostgreSQL 7.3.2 on i686-pc-linux-gnu, compiled by GCC 2.95.3'. Maybe someone came across with this and could help? -- Victor Yegorov pgp0.pgp Description: PGP signature

[SQL] Optimizing view

2003-03-10 Thread Victor Yegorov
n REWRITE RULES, but I can't get, how to create RULE to keep the WHERE clause and separate one query into 2, and union them after. Any suggestions? -- Victor Yegorov CREATE TABLE messages ( message_id INT4NOT NULL, target VARCHAR(99), client_id INT

[SQL] Readline ... a lot of problems...

2002-07-24 Thread Victor Hugo Germano
Hello. I'am Victor, from Brazil. I'am have a problem with postgresql. I can't use the libreadline and i don't know why. It is not working more. What kinds of flags have i put on configure script? how can i know what's the proble

[SQL] cache lookup failed

2001-09-12 Thread victor
Hi, I have this function: CREATE FUNCTION add_one (integer) RETURNS integer AS ' BEGIN RETURN $1 + 1; END; ' LANGUAGE 'plpgsql'; from postgres doc. When I try somethin like this: SELECT add_one(4); I get : ERROR: fmgr_info: function 20086: cache lookup failed please tell me what it's rong.