Hello,
is it possible to change the dimension of an array? I am looking for something
like this:
SELECT change_array_dims('[1:2][1:2]', '{1,2,3,4}'::int[]);
change_array_dims
---
{{1,2},{3,4}}
and the other way around:
SELECT change_array_dims('[1:4]', '{{1,2},{3,4}}'::int[]);
Hello,
I have person to group mapping in which I want to store the time, when this
mapping is valid. I can store the valid time in an array or in seperate rows.
in rows:
create table group_mapping (
group name not null,
person integer not null,
valid_since timestamptz not null,
valid_unt
On Thu, Mar 11, 2010 at 08:38:46AM -0800, Chris Travers wrote:
> > On 3/10/2010 11:52 PM, Chris Travers wrote:
> > Which
> > i'm at a loss why nesting would help solve any problem what so ever. I
> > imagine the search path on some connections would be all inclusive so
> > ambiguous names is not s
Hello,
I'm playing with postgres in OpenVZ. When I migrate my machine with
the database from one host to another I get following errors:
2009-10-04 20:20:43 CEST PANIC: hash table "LOCK hash" corrupted
2009-10-04 20:20:43 CEST STATEMENT: begin
2009-10-04 20:20:43 CEST @ LOG: server process (P
On Thu, Aug 27, 2009 at 11:09:36AM -0700, BlackMage wrote:
>
> Hey all,
>
> I've been trying to figure this problem out with just using sql but I'm not
> sure how too. I have a table that holds events for each week but I only want
> to select events happening for the current week(Mon-Sun). So can
On Mon, Aug 24, 2009 at 05:24:59PM +0800, Fred Janon wrote:
> Hi,
>
> I am using 8.3 and pgAdmin III. I have a couple of tables using 2 DATE columns
> like 'startdate' and 'enddate' (just date, not interested in time in these
> columns). I have some queries (some using OVERLAPS) involving both 'st
Hello,
I try to create an unique index for a (time)period, and my goal is to
prevent two overlapping periods in a row.
For this I created a type with following command:
CREATE TYPE period AS
("first" timestamp with time zone,
"next" timestamp with time zone);
To use the btree index I add
On Fri, Jul 31, 2009 at 12:09:51PM -0400, Ketema Harris wrote:
> I have a table defined as
>
> CREATE TABLE mytable
> (
> carrier varchar,
> start_time timestamp with time zone,
> call_date date,
> cost numeric,
> call_length numeric
> )
>
> I want to create a query that will generate a
Hello,
I try to index histograms in my table. For this I uses the cube contrib
module in which I removed the dimension check. If the cube has more than
255 dimensions, for example 256 ^= 4 + 4 + 256 * 2 * 8 = 4104 bytes, this
data can not be stored in the gist index any more. If I try it, I get th
On Sat, Feb 14, 2009 at 05:36:11PM -0500, Ken Winter wrote:
>I'm trying to look up the columns in a constraint in pg_catalog (of
>PostgreSQL 8.0.x). I can't figure out how to "join" the elements of the
>array that lists the `attnum's of the columns in the table to the `conkey'
>arr
On Sun, Feb 01, 2009 at 11:37:52AM +0100, A B wrote:
> Hi.
> I have a table foo(id serial primary key, b int); and I want an insert
> function
>
> create or replace function insert_to_foo(bvalue integer) returns integer as
> declare
>newindex integer;
> begin
> ... insert into foo (a,b)
Hello,
is it possible to get the old value of an update, something like this:
INSERT INTO my_table (col) VALUES (2);
UPDATE my_table SET col = 4 RETURNING old.col;
Should give me the 2.
Regards,
Gerhard
signature.asc
Description: Digital signature
On Mon, Jan 19, 2009 at 08:19:06PM +0100, Reg Me Please wrote:
> Hi all.
>
> I have a maintenance PL/pgSQL function that needs to recreate a partial index
> (not a REINDEX, though).
> In the WHERE condition of the index I have one of the function arguments.
> A plain "CREATE INDEX ... WHERE ..." w
Hello,
is it possible to call a trigger for a row in a table without updating the
row? I want to do it in plpgsql.
Something like UPDATE table WHERE id = 10;
or PERFORM table.trigger('UPDATE', row) WHERE id = 10;
Regards,
Gerhard
signature.asc
Description: Digital signature
I isolated my problem a little bit:
CREATE FUNCTION get_array() RETURNS integer[] AS
$BODY$
BEGIN
RAISE INFO 'get_array';
RETURN ARRAY[1, 2];
END
$BODY$ LANGUAGE 'plpgsql' STABLE;
And now
SELECT * FROM generate_series(1,3) a(b) where array[b] <@ core.get_array();
gives me:
INFO: get_array
Hello,
I have a query like this:
SELECT * FROM table WHERE has_permission('permission_name');
and the function
CREATE FUNCTION has_permission(IN pname text, OUT is_ok boolean) RETURNING
boolean AS
$BODY$
BEGIN
SELECT has_perm INTO is_ok FROM permission WHERE title = pname;
RAISE INFO 'fun
On Thu, Jan 01, 2009 at 02:41:08PM +0100, Gerhard Heift wrote:
> Hello,
>
> I want to log with triggers or in functions, and these logs should be
> independet of the transaction. Beside i want to have the information
> which action was commited and which not.
>
> So my ide
Hello,
I want to log with triggers or in functions, and these logs should be
independet of the transaction. Beside i want to have the information
which action was commited and which not.
So my idea was to log into the same database with dblink, return the
primary keys and add them into a commit t
Hello,
how can I store an infinity value into an interval? I want to store
offsets to a timestamp, and for some cases i need +infinity and
-infinity as result.
I want to make something like this:
SELECT now() + 'infinity'::interval;
This should return 'infinity'::timestamp.
Is it possible?
Tha
On Thu, Dec 04, 2008 at 07:32:59PM +0100, Harald Fuchs wrote:
> In article <[EMAIL PROTECTED]>,
> Carson Farmer <[EMAIL PROTECTED]> writes:
>
> > date | user
> > --+-
> > 20050201 | Bill
> > 20050210 | Steve
> > 20050224 |
On Sat, Nov 22, 2008 at 10:04:48PM -0500, V S P wrote:
> Hello,
> searched documentation, FAQ and mailing list archives
> (mailing list archive search is volumous :-) )
>
> but could not find an answer:
>
> I would like to be able to update
> several rows to different values at the same time
>
>
On Fri, Nov 21, 2008 at 02:50:45PM +0200, Ciprian Dorin Craciun wrote:
> Hello all!
>
> I would like to ask some advice about the following problem
> (related to the Dehems project: http://www.dehems.eu/ ):
> * there are some clients; (the clients are in fact house holds;)
> * each
On Tue, Nov 18, 2008 at 12:36:42PM +, Sam Mason wrote:
> On Mon, Nov 17, 2008 at 11:22:47AM -0800, Lothar Behrens wrote:
> > I have a problem to find as fast as possible files that are double or
> > in other words, identical.
> > Also identifying those files that are not identical.
>
> I'd pro
Hello,
I have a function with an out variable in which I have an INSERT
statement with the same name as column. Is it possible to avoid the
replacement?
Its something like this:
CREATE FUNCTION insert_foo(IN bar integer, OUT id integer) AS
$BODY$
BEGIN
INSERT INTO t1 (id, value) VALUES (bar, b
On Sat, Nov 08, 2008 at 07:44:45AM -0500, David Spadea wrote:
> Gerhard,
>
> Check out:
>
> http://www.postgresql.org/docs/8.3/interactive/functions-datetime.html
>
> In particular, look at 'age()' or 'justify_days()', but I think age() is the
> one you want.
>
>
> SELECT age('2008-02-01'::ti
Hello,
I write funktions in pl/pgsql and want to abort it. For this I use raise
exception, to undo all changes for this transaction. Now I want to log
these exceptions somewhere.
DECLARE
a integer;
log_id integer;
BEGIN
SELECT a INTO b FROM c WHERE d = 10;
IF NOT FOUND THEN
INSERT INT
Hello,
I want to get an interval in months from two dates:
SELECT '2008-02-01'::timestamp - '2008-01-01'::timestamp AS '1 month'
Here I want '1 month' and not '31 days' as answer.
How can I do this?
Regards,
Gerhard
signature.asc
Description: Digital signature
On Fri, Nov 07, 2008 at 11:15:07AM +0100, Thomas Kellerer wrote:
> Hi,
>
> are there any plans to support updating a tuple using a sub-select in one of
> the future versions.
>
> e.g, something like:
>
> UPDATE report_table
> SET (order_count,order_value) = (SELECT count(*), sum(amount)
>
On Fri, Nov 07, 2008 at 02:31:42PM +0100, Thomas Kellerer wrote:
> Gerhard Heift, 07.11.2008 13:35:
>>> are there any plans to support updating a tuple using a sub-select in one
>>> of the future versions.
>>>
>>> e.g, something like:
>>>
>>&g
On Fri, Nov 07, 2008 at 11:15:07AM +0100, Thomas Kellerer wrote:
> Hi,
>
> are there any plans to support updating a tuple using a sub-select in one of
> the future versions.
>
> e.g, something like:
>
> UPDATE report_table
> SET (order_count,order_value) = (SELECT count(*), sum(amount)
>
Hello,
I have a small problem with my table: I have a table for my cash and i
do several actions in it. I receive money in different forms, I expend
money in different forms etc. And do each action I have various foreign
keys. But they are not all in use in every column. I don't know how I
can str
31 matches
Mail list logo