Grokbase
x

PostgreSQL - SQL

 Topics | People | Info | Page 1 of 480: 1 2 3 > >>

[SQL] Boolean without default declared

By Jon Collette at Aug 15, 2007, 7:36 pm UTC

If a column with a boolean datatype doesn't have a default value. What type of value is set if nothing is inserted into that column? Here is my test table and the queries I have tried. I can't seem to be able to select the rows where happy has no value. Table "public.users" Column | Type |... More...

[SQL] When is a shared library unloaded?

By Jon Horsman at Aug 15, 2007, 1:16 pm UTC

I have a shared library loaded into postgresql using CREATE FUNCTION medbevent() RETURNS trigger as '/usr/lib/pgsql/libmedbevent.so' language 'C'; I'm randomly having issues with my triggers not firing (it turns out they are getting removed) and when i turned INFO logs on i saw the following... More...

Re: [NOVICE] Install two different versions of postgres which should run in parallel

By Oliver Elphick at Aug 15, 2007, 12:42 pm UTC

If you run Debian or Ubuntu you can do this with the package system. apt-get install postgresql-8.2 postgresql-7.4 The two versions are automatically installed to run on different ports. Look at the docs and manpages for the postgresql-common package to see how it works. If you can't do that, you... More...

[JDBC] Re: [NOVICE] Install two different versions of postgres which should run in parallel

By Sean Davis at Aug 15, 2007, 11:58 am UTC

You can install from source and provide the --prefix argument to the configure command. Sean ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not... More...

[SQL] populate value of column

By novice at Aug 15, 2007, 03:15 am UTC

I have a table CREATE TABLE meter meter_id integer NOT NULL, area_no integer NOT NULL, CONSTRAINT meter_pkey PRIMARY KEY (meter_id) INSERT INTO meter(meter_id, no_of_bays) VALUES (1001, 4); INSERT INTO meter(meter_id, no_of_bays) VALUES (1012, 6); select meter_id, area_no from meter; meter_id |... More...

[SQL] Best Fit SQL query statement

By Kiran at Aug 14, 2007, 1:59 pm UTC

All, Could anyone help me in writing Best Fit SQL statement. Suppose we have table t1 with coloumn t1 (text) with following rows. and if I query on 98456 the result must be 98456, However if I query on 98455 the result must be 9845 and If I query 9849 the result must be 984 Regards, Kiran... More...

[SQL] Authentification failed

By Judith Altamirano Figueroa at Aug 14, 2007, 11:40 am UTC

Hello everybody!! I'm trying in SUSE to connect to a postgres db and this is the error: Ident Authentification failed for user <<root>> I'm already created the user with createuser root, but the error persist, I would aprecciate some help, thanks in advanced ---------------------------(end of... More...

Re: [SQL] Install two different versions of postgres which should run in parallel

By gh...@fmed.uba.ar at Aug 14, 2007, 07:37 am UTC

Shure. You just have to take care about --prefix (executable path) and --with-pgport (default port) when you ./configure, and also take care of the datadir you chose when executing initdb. Good luck. Gerardo ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill... More...


Shure. You just have to take care about --prefix (executable path) and
--with-pgport (default port) when you ./configure, and also take care of
the datadir you chose when executing initdb.

Good luck.
Gerardo

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

[SQL] how to moce back in refcursor

By Christian Kindler at Aug 14, 2007, 06:17 am UTC

Hi I have never worked with cursors but for now I have to step back on special events to calculate a difference. So I have this sample code tested but I can not "move" in my cursor. I have lokke at docs but this didn't help me. Can you say how to declare my cursor to step back? Thank You Chris PS... More...

[SQL] Getting pk of the most recent row, in a group by

By Bryce Nesbitt at Aug 13, 2007, 11:19 pm UTC

I've got a table of "coupons" which have an expiration date. For each type of coupon, I'd like to get the primary key of the coupon which will expire first. # create table coupon coupon_id serial primary key, type varchar(255), expires date insert into coupon values(DEFAULT,'free','2007-01-01');... More...

[SQL] Comparing two slices within one table efficiently

By Ken Simpson at Aug 13, 2007, 7:42 pm UTC

I have a table with the following simplified form: create table t ( run_id integer, domain_id integer, mta_id integer, attribute1 integer, attribute2 integer, unique(run_id, domain_id, mta_id) The table has about 1 million rows with run_id=1, another 1 million rows with run_id=2, and so on. I need... More...

[SQL] Index usage in order by with multiple columns in order-by-clause

By Andreas Joseph Krogh at Aug 11, 2007, 8:14 pm UTC

I have the following test-case: CREATE TABLE test( name varchar PRIMARY KEY, value varchar NOT NULL, created timestamp not null create index test_lowernamevalue_idx ON test ((lower(name) || lower(value))= create index test_lowernamevaluecreated_idx ON test ((lower(name) ||=20 lower(value)),... More...

[SQL] Trigger Procedure Error: NEW used in query that is not in a rule

By Javier Fonseca V. at Aug 11, 2007, 7:07 pm UTC

Hello. I'm doing a Trigger Procedure in pl/pgSQL. It makes some kind of auditing. I think that it's working alright except for the next line: EXECUTE 'INSERT INTO ' || quote_ident(somedynamictablename) || ' SELECT new.*'; PostgreSQL keeps telling me: "ERROR: NEW used in query that is not in a... More...

[SQL] foreign key pointing to diff schema?

By gh...@fmed.uba.ar at Aug 10, 2007, 10:37 pm UTC

Hi all. Can i make a FK who points a table in a different schema? Or this is implemented via a trigger by my own? Thanks! Gerardo ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to... More...

[SQL] Increment a sequence by more than one

By stevemidgley at Aug 10, 2007, 9:00 pm UTC

Hi, I'm writing an import app in a third party language. It's going to use "copy to" to move data from STDIN to a postgres (8.2) table. There are some complexities though: it's going to copy the records to a "versioned" table first, and then at a later time the records will be copied by a different... More...

[SQL] Join optimization

By Pablo Barrón at Aug 10, 2007, 09:51 am UTC

Hi! I've been trying to optimize a query in which I join several tables, since I've seen it takes about 2 seconds, which is way too much. Well, the query is the following, I'm using LEFT OUTER JOIN just when the tables can have NULL results, plain JOIN otherwise: select ="select... More...

[SQL] Using function like where clause

By Ranieri Mazili at Aug 10, 2007, 08:00 am UTC

Hello, I have 2 questions. 1) Can I use a function that will return a string in a where clause like bellow? select * from table where my_function_making_where() and another_field = 'another_think' 2) Can I use a function that will return a string to return the list of columns that I want to show... More...

[SQL] Returnd Refcurser (<unnamed portal x> not fetchable

By Christian Kindler at Aug 10, 2007, 06:35 am UTC

Hi! I have the Problem, that a function returns a refcursor and I am not able to fetch them. I tried in several ways. Can you please tell me how to get the cursor data. Thanks Chris PS this is what I have: create table foo(sirname text, name text); insert into foo values ('Mueller', 'Marcus');... More...

[SQL] PG won't use index on ORDER BY <expression>

By Andreas Joseph Krogh at Aug 10, 2007, 03:10 am UTC

Hi all! I have problems getting PG to use an index when sorting. I have a simple table create table person( id serial primary key, firstname varchar, lastname varchar I create an index: CREATE INDEX person_lowerfullname_idx ON=20 person((lower(COALESCE(firstname, '')) || lower(COALESCE(lastname,... More...

[SQL] Indexing a field of type point

By David Cottingham at Aug 9, 2007, 5:33 pm UTC

Hi, I realise this isn't strictly an SQL question, but I figured this list might be better suited than the general one. Please let me know if not. I have a table containing a field named location, of type point, i.e. a position in two dimensions. The table has several million records in, and I need... More...

spacer
 Topics | People | Info | Page 1 of 480: 1 2 3 > >>
Home > Groups > postgresql.org > PostgreSQL - SQL