On 02/25/2016 01:58 AM, Karsten Hilbert wrote:
On Wed, Feb 24, 2016 at 04:12:22PM -0800, Adrian Klaver wrote:
This works fine, the application (GNUmed) ensures INSERTS and
UPDATES do the right thing with .is_ongoing and .ts_end.
Now the following sequence happens:
- insert row with .is_ongoin
On Wed, Feb 24, 2016 at 05:24:44PM -0700, David G. Johnston wrote:
> Then you must record the "INSERT/UPDATE time" into the table, as a
> constant, and refer to that value instead of having "now()" which happens
> to be correct at the time of the insert/update but is not correct at any
> future p
On Wed, Feb 24, 2016 at 04:12:22PM -0800, Adrian Klaver wrote:
> >This works fine, the application (GNUmed) ensures INSERTS and
> >UPDATES do the right thing with .is_ongoing and .ts_end.
> >
> >Now the following sequence happens:
> >
> >- insert row with .is_ongoing=true and .ts_end=tomorrow()
>
On Wed, Feb 24, 2016 at 3:12 PM, Karsten Hilbert
wrote:
> I have noticed another problem during pg_upgrade on a 9.1
> cluster with 9.4 as the target.
>
> Consider this sort of table
>
> create table therapy (
> pk serial primary key,
> description text,
>
On 02/24/2016 02:12 PM, Karsten Hilbert wrote:
I have noticed another problem during pg_upgrade on a 9.1
cluster with 9.4 as the target.
Consider this sort of table
create table therapy (
pk serial primary key,
description text,
is_ongoing
I have noticed another problem during pg_upgrade on a 9.1
cluster with 9.4 as the target.
Consider this sort of table
create table therapy (
pk serial primary key,
description text,
is_ongoing boolean not null,
ts_end timesta
On 11/03/2015 04:23 PM, Dane Foster wrote:
On Tue, Nov 3, 2015 at 7:09 PM, David G. Johnston
mailto:david.g.johns...@gmail.com>> wrote:
On Tue, Nov 3, 2015 at 4:55 PM, Dane Foster mailto:studdu...@gmail.com>>wrote:
Hello,
I have a design/modelling puzzle/problem. I'm trying
On Tue, Nov 3, 2015 at 7:09 PM, David G. Johnston <
david.g.johns...@gmail.com> wrote:
> On Tue, Nov 3, 2015 at 4:55 PM, Dane Foster wrote:
>
>> Hello,
>>
>> I have a design/modelling puzzle/problem. I'm trying to model a series of
>> events. So I have two tables w/ a parent child relationship. T
On Tue, Nov 3, 2015 at 4:55 PM, Dane Foster wrote:
> Hello,
>
> I have a design/modelling puzzle/problem. I'm trying to model a series of
> events. So I have two tables w/ a parent child relationship. The child
> table has the rule/constraint/etc that for every row in the parent table
> there mus
Hello,
I have a design/modelling puzzle/problem. I'm trying to model a series of
events. So I have two tables w/ a parent child relationship. The child
table has the rule/constraint/etc that for every row in the parent table
there must be at least 2 rows in the child because a series must have at
On 12/26/2014 05:18 AM, Andreas Ulbrich wrote:
On 25.12.2014 23:50, Adrian Klaver wrote:
On 12/25/2014 11:21 AM, Andreas Ulbrich wrote:
Hey.
In the first part I connect to testdb (the remote db). Here I create the
schema 'andreas'. That the search_path correct is, shows the output of
the pgpls
On 25.12.2014 23:50, Adrian Klaver wrote:
On 12/25/2014 11:21 AM, Andreas Ulbrich wrote:
Hey.
In the first part I connect to testdb (the remote db). Here I create the
schema 'andreas'. That the search_path correct is, shows the output of
the pgplsql version.
Yeah, that was a false alarm on my
On 12/25/2014 11:21 AM, Andreas Ulbrich wrote:
Hey.
In the first part I connect to testdb (the remote db). Here I create the
schema 'andreas'. That the search_path correct is, shows the output of
the pgplsql version.
Yeah, that was a false alarm on my part. Forgot about $user in the path.
Th
Hey.
In the first part I connect to testdb (the remote db). Here I create the
schema 'andreas'. That the search_path correct is, shows the output of
the pgplsql version.
Then, in the second part, I'm postgres (this db ist empty since compiling).
The usermapping says, I wont to be andreas@test
On 12/25/2014 09:27 AM, Tom Lane wrote:
Andreas Ulbrich writes:
Questions:
Wy is the check constraint function in a select called?
The search_path seams not to be set for the SQL function, is this
behavior correct?
Like Adrian, I'm a bit suspicious whether this test script is creating
the obj
Andreas Ulbrich writes:
> Questions:
> Wy is the check constraint function in a select called?
> The search_path seams not to be set for the SQL function, is this
> behavior correct?
Like Adrian, I'm a bit suspicious whether this test script is creating
the objects in the schema you think it is.
On 12/25/2014 03:31 AM, Andreas Ulbrich wrote:
Salvete!
I've made the following observation:
I have a foreign table (postgres_fdw) to a remote table B.
On the remote table is a check constraint using a SQL-function with
access to an other table.
In the remote DB both tables and the check-functi
Salvete!
I've made the following observation:
I have a foreign table (postgres_fdw) to a remote table B.
On the remote table is a check constraint using a SQL-function with
access to an other table.
In the remote DB both tables and the check-function resist in a seperate
schema "andreas".
Th
On Tue, 08 Apr 2014 15:53:48 -0600
CS_DBA wrote:
> Not sure yet (new client)... for now they simply want to force the
> template column to be a valid cust_id, if it is not null...
It seems to be a different version of the textbook exercice involving
EMPLOYEE_ID and MANAGER_ID.
--
Alberto Cabel
Based on your first question a customer id itself is not a valid designator;
you have to specify (or link) in the group as well.
Not tested but should work:
FOREIGN KEY (template, group) REFERENCES customer (cust_id, group)
Depends on whether you want to allow cross-group associations if you nee
On 04/08/2014 04:08 PM, Rob Sargent wrote:
On 04/08/2014 03:53 PM, CS_DBA wrote:
On 04/08/2014 03:41 PM, Rob Sargent wrote:
On 04/08/2014 03:36 PM, CS_DBA wrote:
On 04/08/2014 03:31 PM, Rob Sargent wrote:
On 04/08/2014 03:26 PM, CS_DBA wrote:
On 04/08/2014 03:17 PM, Rob Sargent wrote:
O
On 04/08/2014 03:53 PM, CS_DBA wrote:
On 04/08/2014 03:41 PM, Rob Sargent wrote:
On 04/08/2014 03:36 PM, CS_DBA wrote:
On 04/08/2014 03:31 PM, Rob Sargent wrote:
On 04/08/2014 03:26 PM, CS_DBA wrote:
On 04/08/2014 03:17 PM, Rob Sargent wrote:
On 04/08/2014 03:09 PM, CS_DBA wrote:
On 04/
On 04/08/2014 03:41 PM, Rob Sargent wrote:
On 04/08/2014 03:36 PM, CS_DBA wrote:
On 04/08/2014 03:31 PM, Rob Sargent wrote:
On 04/08/2014 03:26 PM, CS_DBA wrote:
On 04/08/2014 03:17 PM, Rob Sargent wrote:
On 04/08/2014 03:09 PM, CS_DBA wrote:
On 04/08/2014 02:58 PM, Rob Sargent wrote:
O
On 04/08/2014 03:36 PM, CS_DBA wrote:
On 04/08/2014 03:31 PM, Rob Sargent wrote:
On 04/08/2014 03:26 PM, CS_DBA wrote:
On 04/08/2014 03:17 PM, Rob Sargent wrote:
On 04/08/2014 03:09 PM, CS_DBA wrote:
On 04/08/2014 02:58 PM, Rob Sargent wrote:
On 04/08/2014 02:51 PM, CS_DBA wrote:
Hi All
On 04/08/2014 03:31 PM, Rob Sargent wrote:
On 04/08/2014 03:26 PM, CS_DBA wrote:
On 04/08/2014 03:17 PM, Rob Sargent wrote:
On 04/08/2014 03:09 PM, CS_DBA wrote:
On 04/08/2014 02:58 PM, Rob Sargent wrote:
On 04/08/2014 02:51 PM, CS_DBA wrote:
Hi All
we have a table like so:
customer (
On 04/08/2014 03:26 PM, CS_DBA wrote:
On 04/08/2014 03:17 PM, Rob Sargent wrote:
On 04/08/2014 03:09 PM, CS_DBA wrote:
On 04/08/2014 02:58 PM, Rob Sargent wrote:
On 04/08/2014 02:51 PM, CS_DBA wrote:
Hi All
we have a table like so:
customer (
cust_id integer not null
On 04/08/2014 03:17 PM, Rob Sargent wrote:
On 04/08/2014 03:09 PM, CS_DBA wrote:
On 04/08/2014 02:58 PM, Rob Sargent wrote:
On 04/08/2014 02:51 PM, CS_DBA wrote:
Hi All
we have a table like so:
customer (
cust_id integer not null primary key,
cust_group_id int
On 04/08/2014 03:09 PM, CS_DBA wrote:
On 04/08/2014 02:58 PM, Rob Sargent wrote:
On 04/08/2014 02:51 PM, CS_DBA wrote:
Hi All
we have a table like so:
customer (
cust_id integer not null primary key,
cust_group_id integer not null,
group_account_idinteger no
On 04/08/2014 02:58 PM, Rob Sargent wrote:
On 04/08/2014 02:51 PM, CS_DBA wrote:
Hi All
we have a table like so:
customer (
cust_id integer not null primary key,
cust_group_id integer not null,
group_account_idinteger not null,
cust_name varchar
On 04/08/2014 02:51 PM, CS_DBA wrote:
Hi All
we have a table like so:
customer (
cust_id integer not null primary key,
cust_group_id integer not null,
group_account_idinteger not null,
cust_name varchar not null,
...
)
we want to force the cust_
Hi All
we have a table like so:
customer (
cust_id integer not null primary key,
cust_group_id integer not null,
group_account_idinteger not null,
cust_name varchar not null,
...
)
we want to force the cust_group_id to be unique across all
group
On Thu, Nov 4, 2010 at 8:03 AM, Gauthier, Dave wrote:
> Is there a way to require that a check constraint be checked on insert but
> not update? Worth knowing is that my check constraint runs a PLPgsql proc
> which returns a yes/no kinf of flag which the constraint proper checks.
I think by de
On Thu, Nov 4, 2010 at 11:03 AM, Gauthier, Dave wrote:
> Is there a way to require that a check constraint be checked on insert but
> not update? Worth knowing is that my check constraint runs a PLPgsql proc
> which returns a yes/no kinf of flag which the constraint proper checks.
Use an expl
This is a longshot, but here goes...
Is there a way to require that a check constraint be checked on insert but not
update?Worth knowing is that my check constraint runs a PLPgsql proc which
returns a yes/no kinf of flag which the constraint proper checks.
Thanks !
Richard Yen writes:
> When I run my update, it fails:
>> tii=# begin; update only "public"."m_class" set date_end='2009-09-03
>> 05:38:24.030331-07',term_length='177 days 17:59:09.868431' where
>> id='2652020';
>> BEGIN
>> ERROR: new row for relation "m_class" violates check constraint
>> "end_wi
Hi All,
I encountered an odd issue regarding check constraints complaining
when they're not really violated.
For this particular machine, I am running 8.3.7, but on a machine
running 8.3.5, it seems to have succeeded. I also upgraded a third
machine from 8.3.5 to 8.3.7, and the query succeeded (
"Tim Rupp" <[EMAIL PROTECTED]> writes:
> where start_time >= '2008-01-01'::date AND start_time < '2008-01-10'::date
>
> should give the same rows as
>
> where start_time >= '2008-01-01'::date AND end_time <= '2008-01-09'::date
I think you'll need to do the same thing to the constraints as well. Y
On Jan 24, 2008 9:47 AM, Tom Lane <[EMAIL PROTECTED]> wrote:
> "Tim Rupp" <[EMAIL PROTECTED]> writes:
> > ... a bunch of inherited tables that have the following constraint
>
> > CHECK (start_time >= '2008-01-01'::date AND end_time < '2008-01-01'::date)
>
> > and when i do the same query (as in the
"Tim Rupp" <[EMAIL PROTECTED]> writes:
> ... a bunch of inherited tables that have the following constraint
> CHECK (start_time >= '2008-01-01'::date AND end_time < '2008-01-01'::date)
> and when i do the same query (as in the documentation) on the table, I
> get a bunch of sequential scans in th
Hi list, I was looking for a bit of clarification on a check
constraint that I have on some tables.
I was following the example in the partitioning documentation
http://www.postgresql.org/docs/8.2/interactive/ddl-partitioning.html
And got it to work, but when I tried to apply the same idea to my
On Tue, 1 May 2007, Dann Corbit wrote:
For postal addressing, this is a really good reference site:
http://www.columbia.edu/kermit/postal.html
Thank you. Frank did/does an outstanding job with Kermit, and that's a
very useful language for serial communications among data collecting devices
a
For postal addressing, this is a really good reference site:
http://www.columbia.edu/kermit/postal.html
---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:pgsql-general-
> [EMAIL PROTECTED] On Behalf Of Rich Shepard
> Sent: Tuesday, May 01, 2007 10:42 AM
> To: pgsql-general@postgresql.org
> Subject: [GENERAL] CHECK() Constraint on Column Using Lookup Table
>
>
On May 1, 2007, at 12:41 , Rich Shepard wrote:
I've seen the syntax for using a lookup table in a CHECK()
constraint, but
I cannot find a reference to it. It's not in Section 5.3.1 of the
8.2 docs.
I'm not sure I follow. Generally if one has a column the value of
which belongs to a lim
On Tue, 1 May 2007, Joshua D. Drake wrote:
You could use a function, or a foreign key.
Josh,
The foreign key approach will do nicely.
Thanks,
Rich
--
Richard B. Shepard, Ph.D. |The Environmental Permitting
Applied Ecosystem Services, Inc.| Accelerator(T
am Tue, dem 01.05.2007, um 10:41:44 -0700 mailte Rich Shepard folgendes:
> I've seen the syntax for using a lookup table in a CHECK() constraint, but
> I cannot find a reference to it. It's not in Section 5.3.1 of the 8.2 docs.
>
> Specifically, I want to reference a table of ISO 2-letter cod
--- Rich Shepard <[EMAIL PROTECTED]> wrote:
>I've seen the syntax for using a lookup table in a CHECK() constraint, but
> I cannot find a reference to it. It's not in Section 5.3.1 of the 8.2 docs.
>
>Specifically, I want to reference a table of ISO 2-letter codes for US
> states and Can
Rich Shepard wrote:
I've seen the syntax for using a lookup table in a CHECK() constraint,
but
I cannot find a reference to it. It's not in Section 5.3.1 of the 8.2 docs.
Specifically, I want to reference a table of ISO 2-letter codes for US
states and Canadian provinces/territories in a ta
I've seen the syntax for using a lookup table in a CHECK() constraint, but
I cannot find a reference to it. It's not in Section 5.3.1 of the 8.2 docs.
Specifically, I want to reference a table of ISO 2-letter codes for US
states and Canadian provinces/territories in a table with name and addr
The solutions provided by Mr. Glaeserman and Mr. Lane worked
perfectly. So that's how NULL works!
Thanks so much for the help.
"Michael Schmidt" <[EMAIL PROTECTED]> writes:
> ALTER TABLE "ClinData" ADD CONSTRAINT "Control_Score" CHECK
> ((("Control_Score_M" IS NULL) AND ("Control_Score_SD" IS NULL) ) OR
> (("Control_Score_M" IS NOT NULL) AND ("Control_Score_SD" >= 0.0)))
> This statement executes okay. It prevents Cont
On Jul 1, 2005, at 12:04 PM, Michael Schmidt wrote:
The constraint statement:
ALTER TABLE "ClinData" ADD CONSTRAINT "Control_Score" CHECK
((("Control_Score_M" IS NULL) AND ("Control_Score_SD" IS NULL) ) OR
(("Control_Score_M" IS NOT NULL) AND ("Control_Score_SD" >= 0.0)))
This statement execu
New to PostgreSQL and hoping for some help with a constraint I've been
struggling with for a could of days. The table includes means and standard
deviations. They should either both be null or (mean any value and
standard deviation >= 0)
The constraint statement:
ALTER TABLE "ClinData"
On Wed, 17 Mar 2004, Richard Huxton wrote:
> On Wednesday 17 March 2004 12:03, Francisco Reyes wrote:
> > I have a "comment" field in a table that I want populated if another field
> > has a certain value. Is it possible to set a check constraint for this?
> >
> > Example:
> > Let's say we have fi
On Wed, 17 Mar 2004, Stephan Szabo wrote:
> Actually, shouldn't a table level check constraint be able to do this with
> something like:
> check (purchase_type!=3 or comment is not null)
That worked Stephan.
Gregory. I think yours would work too. Saw Stephans answer and tested
before I saw your
On Wed, Mar 17, 2004 at 12:03:04 +,
Francisco Reyes <[EMAIL PROTECTED]> wrote:
> I have a "comment" field in a table that I want populated if another field
> has a certain value. Is it possible to set a check constraint for this?
>
> Example:
> Let's say we have fields
> Purchase_type smalli
I have a "comment" field in a table that I want populated if another field
has a certain value. Is it possible to set a check constraint for this?
Example:
Let's say we have fields
Purchase_type smallint check(purchase_type <4)
comment varchar
I need a check rule to something like (pseudo cod
On Wednesday 17 March 2004 12:03, Francisco Reyes wrote:
> I have a "comment" field in a table that I want populated if another field
> has a certain value. Is it possible to set a check constraint for this?
>
> Example:
> Let's say we have fields
> Purchase_type smallint check(purchase_type <4)
>
I have a "comment" field in a table that I want populated if another field
has a certain value. Is it possible to set a check constraint for this?
Example:
Let's say we have fields
Purchase_type smallint check(purchase_type <4)
comment varchar
I need a check rule to something like (pseudo c
El Lun 18 Dic 2000 12:43, Wade D. Oberpriller escribió:
> You should be able to do the following:
>
> CREATE TABLE table1 (
> field1 INTEGER CHECK ((field1 >= 0) AND (field1 <= 10))
> );
Thanks!!! Didn't know that!
--
System Administration: It's a dirty job,
but someone told I had to do i
You should be able to do the following:
CREATE TABLE table1 (
field1 INTEGER CHECK ((field1 >= 0) AND (field1 <= 10))
);
Wade Oberpriller
>
> Hi,
> how should I write a constraint that can keep an INT field with values
> between 0 and 10? Do I have to use two checks on the same field?
>
Hi,
how should I write a constraint that can keep an INT field with values
between 0 and 10? Do I have to use two checks on the same field?
TIA
--
System Administration: It's a dirty job,
but someone told I had to do it.
Dear Thomas,
I began with ver.6.4 beta. What do I have to do ? Come back to 6.3 ?
However, I tested more and the problem appear when you use "check" clause of "create
table".
Could you reproduce the situation with your PostGres 6.3 ? See the procedures below.
create table TBL (FLD1 int4, FLD2
Hi,
I have created a function "int fname(void)" in C. When I create this
function in Postgres as returning int4 and then do a
" create table dummy (level int4 check(fname() > 4));"
the creation fails saying that :
ERROR: There is no operator '>' for types 'bool' and 'int4'
You will either
64 matches
Mail list logo