Re: [GENERAL] all non-PK columns from information schema

2011-11-15 Thread Tarlika Elisabeth Schmitz
On Tue, 15 Nov 2011 09:26:35 -0600 Mike Blackwell wrote: >On Tue, Nov 15, 2011 at 02:59, Tarlika Elisabeth Schmitz < >postgres...@numerixtechnology.de> wrote: > >> I'd like to select all column names for a specific table except >> those that are part of th

[GENERAL] all non-PK columns from information schema

2011-11-15 Thread Tarlika Elisabeth Schmitz
I'd like to select all column names for a specific table except those that are part of the PK. I know I need to somehow join information_schema.columns, key_column_usage and table_constraints but how? -- Best Regards, Tarlika Elisabeth Schmitz -- Sent via pgsql-general mailing list (

Re: [GENERAL] Upgrade 8.4 with contrib to 9.1

2011-11-14 Thread Tarlika Elisabeth Schmitz
On Mon, 14 Nov 2011 14:20:39 -0700 Scott Marlowe wrote: >On Mon, Nov 14, 2011 at 11:12 AM, Tarlika Elisabeth Schmitz > wrote: >> I am running 8.4 with various contrib modules (hstore-new, pg_trgm, >> fuzzystrmatch). >> >> If I wanted to upgrade to 9.1, can I /

[GENERAL] Upgrade 8.4 with contrib to 9.1

2011-11-14 Thread Tarlika Elisabeth Schmitz
Elisabeth Schmitz -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] PL/pgSQL: SELECT INTO variables - no result

2011-11-10 Thread Tarlika Elisabeth Schmitz
On Thu, 10 Nov 2011 17:46:47 -0500 "David Johnston" wrote: >-Original Message- >From: pgsql-general-ow...@postgresql.org >[mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Tarlika >Elisabeth Schmitz >Sent: Thursday, November 10, 2011 5:18 PM >To:

[GENERAL] PL/pgSQL: SELECT INTO variables - no result

2011-11-10 Thread Tarlika Elisabeth Schmitz
way I can avoid this or do I have to use different sets of variables? -- Best Regards, Tarlika Elisabeth Schmitz -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] count (DISTINCT field) OVER ()

2011-11-10 Thread Tarlika Elisabeth Schmitz
On Thu, 10 Nov 2011 10:02:36 +0100 Thomas Kellerer wrote: >Tarlika Elisabeth Schmitz, 10.11.2011 00:52: >> I would like to implement the equivalent of "count (DISTINCT id) >> OVER ()": >> >>[...] >> >> produces result: >> id, name, delta,

[GENERAL] count (DISTINCT field) OVER ()

2011-11-09 Thread Tarlika Elisabeth Schmitz
ame,delta, count (*) OVER() FROM ( SELECT DISTINCT ON (id) id, name, similarity(name, 'Tooneyvara') as delta FROM vtown WHERE similarity(name, 'Tooneyvara') > 0.1 ORDER BY id, delta DESC ) AS x ORDER by delta DESC -- Best Regards, Tarlika Elisabe

Re: [GENERAL] [PL/pgSQL] function call

2011-10-31 Thread Tarlika Elisabeth Schmitz
On Mon, 31 Oct 2011 09:41:40 -0500 Merlin Moncure wrote: >On Mon, Oct 31, 2011 at 8:31 AM, Tarlika Elisabeth Schmitz > wrote: >> I have created a function log_insert(), which is simply a shorthand >> for an INSERT table and which I want to call from various trigger >> fu

[GENERAL] [PL/pgSQL] function call

2011-10-31 Thread Tarlika Elisabeth Schmitz
s." Any help would be greatly appreciated. -- Best Regards, Tarlika Elisabeth Schmitz -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] PL/pgSQL: SELECT INTO only if result count = 1

2011-08-28 Thread Tarlika Elisabeth Schmitz
On Sat, 27 Aug 2011 18:36:14 -0400 Tom Lane wrote: >Tarlika Elisabeth Schmitz writes: >> SELECT INTO >> country_id, region_id, town_id >> country_fk, region_fk, id >> FROM town >> WHERE ...; > >> GET DIAGNOSTICS cnt = ROW_COUNT; >> RAISE DEBU

Re: [GENERAL] PL/pgSQL: SELECT INTO only if result count = 1

2011-08-27 Thread Tarlika Elisabeth Schmitz
On Sat, 27 Aug 2011 18:45:42 -0300 Osvaldo Kussama wrote: >2011/8/27, Tarlika Elisabeth Schmitz >: >> Hello, >> >> In a PL/pgSQL trigger function, I try to select a record from table >> "town" below. >> >> I am only interested in the resul

[GENERAL] PL/pgSQL: SELECT INTO only if result count = 1

2011-08-27 Thread Tarlika Elisabeth Schmitz
id serial NOT NULL, "name" character varying(60) NOT NULL, CONSTRAINT ... ) -- Best Regards, Tarlika Elisabeth Schmitz -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] unique across two tables

2011-06-23 Thread Tarlika Elisabeth Schmitz
regionfk,name), which I use in conjunction with a check constraint. The constraint operates on the alias table and the function searches the main table. The downside is that I need to mirror the logic for both tables and therefore need two separate functions (one checking town and one townalias).

Re: [GENERAL] unique across two tables

2011-06-20 Thread Tarlika Elisabeth Schmitz
On Mon, 20 Jun 2011 19:42:20 +0200 Alban Hertroys wrote: >On 20 Jun 2011, at 17:03, Tarlika Elisabeth Schmitz wrote: > >> I have two tables, town and townalias, the latter containing >> alternative town names. >> I would like to ensure that a town name is unique per >

[GENERAL] unique across two tables

2011-06-20 Thread Tarlika Elisabeth Schmitz
r NOT NULL, id serial NOT NULL, "name" character varying(50) NOT NULL, CONSTRAINT town_townalias_fk FOREIGN KEY (country_fk, region_fk, town_fk) REFERENCES town (country_fk, region_fk, id) ) -- Best Regards, Tarlika Elisabeth Schmitz -- Sent via pgsql-general mailing

Re: [GENERAL] trigger - dynamic WHERE clause

2011-05-31 Thread Tarlika Elisabeth Schmitz
On Tue, 31 May 2011 06:09:18 +0200 Pavel Stehule wrote: >2011/5/31 Tarlika Elisabeth Schmitz : >> On Mon, 30 May 2011 11:02:34 +0200 >> Pavel Stehule wrote: >> >>>> 2) I took from your blog entry >>>> (http://okbob.blogspot.com/2008/06/execute-usin

Re: [GENERAL] trigger - dynamic WHERE clause

2011-05-30 Thread Tarlika Elisabeth Schmitz
est I can come up with is a JOIN with information_schema.columns. -- Best Regards, Tarlika Elisabeth Schmitz -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] trigger - dynamic WHERE clause

2011-05-27 Thread Tarlika Elisabeth Schmitz
Hello Pavel, Thanks for taking the time to reply. On Fri, 27 May 2011 09:12:20 +0200 Pavel Stehule wrote: >Hello > >2011/5/26 Tarlika Elisabeth Schmitz : >> On Sun, 22 May 2011 20:39:01 +0200 >> Pavel Stehule wrote: >> >>>2011/5/22 Tarlika Elisabeth Schm

Re: [GENERAL] trigger - dynamic WHERE clause

2011-05-26 Thread Tarlika Elisabeth Schmitz
On Sun, 22 May 2011 20:39:01 +0200 Pavel Stehule wrote: >Hello > >2011/5/22 Tarlika Elisabeth Schmitz : >> EXECUTE 'SELECT 1 FROM ' || TG_TABLE_NAME || ' WHERE ' || whereclause >> || ' FOR UPDATE;'; >> >> I am generating the whe

[GENERAL] trigger - dynamic WHERE clause

2011-05-22 Thread Tarlika Elisabeth Schmitz
EXECUTE 'SELECT 1 FROM ' || TG_TABLE_NAME || ' WHERE ' || whereclause || ' FOR UPDATE;'; I am generating the whereclause dynamically as the number of columns queried varies. Am I right in assuming that I cannot use EXECUTE ... USING in this scenario? -- B

[GENERAL] each (hstore)

2011-05-17 Thread Tarlika Elisabeth Schmitz
On Pavel's blog, I found this statement, which does just what I need: select (each(hstore(foo))).* from foo; Excuse the daft question, but could, please, you explain what ".*" does? -- Best Regards, Tarlika Elisabeth Schmitz -- Sent via pgsql-general mailing list

Re: [GENERAL] Role for CSV import

2011-05-16 Thread Tarlika Elisabeth Schmitz
On Sun, 15 May 2011 20:05:04 +0200 Cédric Villemain wrote: >2011/5/15 Rob Sargent : >> >> >> Tarlika Elisabeth Schmitz wrote: >>> >>> I have a database that will be populated solely by CSV import. >>> There are several CSV file formats, all den

Re: [GENERAL] Role for CSV import

2011-05-15 Thread Tarlika Elisabeth Schmitz
On Sun, 15 May 2011 11:56:38 -0600 Rob Sargent wrote: >Tarlika Elisabeth Schmitz wrote: >> I have a database that will be populated solely by CSV import. >> There are several CSV file formats, all denormalized. >> >> I have created interim tables which match the CSV

[GENERAL] Role for CSV import

2011-05-15 Thread Tarlika Elisabeth Schmitz
reSQL 8.4 dbname = schema name = admin name -- Best Regards, Tarlika Elisabeth Schmitz -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general