On Sat, 12 Jan 2019, David G. Johnston wrote:
Inserting new data into a table qualifies as "data change" in my mind...
David,
Then it's certainly good enough for me. ;-)
Looking at the text file which the application will replace there are
occasions when there's more than one contact on
On Sat, Jan 12, 2019 at 9:54 AM Rich Shepard wrote:
> > The problem is that check constraints are only applied at time of data
> > change.
>I thought that the check constraint applied at data entry, too.
Inserting new data into a table qualifies as "data change" in my mind...
David J.
On Sat, Jan 12, 2019 at 10:08 AM Ricardo Martin Gomez
wrote:
>
> Hi,
> In MYSQL Null date is equal '01/01/1900' or '01/01/1970', I don't remember
> but you can also use the same logic for the check_constraint.
> Regards
Why? PostgreSQL doesn't need hacks around this...
David J.
urday, January 12, 2019 1:54:47 PM
To: pgsql-general@lists.postgresql.org
Subject: Re: insert into: NULL in date column
On Sat, 12 Jan 2019, David G. Johnston wrote:
> NULL isn't the problem - a check constraint can resolve to unknown in
> which case it behaves the same as if it resolve
On Sat, 12 Jan 2019, David G. Johnston wrote:
NULL isn't the problem - a check constraint can resolve to unknown in
which case it behaves the same as if it resolved as true (i.e., its
basically a IS NOT FALSE test in the backend). This is actually a
nice feature of check constraints since for n
On Sat, Jan 12, 2019 at 9:01 AM Rich Shepard wrote:
>
> On Sat, 12 Jan 2019, David G. Johnston wrote:
>
> > Actually, you didn't ask about the check constraint, which is actually
> > horribly broken since current_date is not an immutable function.
>>
>I know that nulls cannot be validly used i
On Sat, 12 Jan 2019, David G. Johnston wrote:
Actually, you didn't ask about the check constraint, which is actually
horribly broken since current_date is not an immutable function.
David,
I know that nulls cannot be validly used in comparisons which makes the
check constraint FUBAR.
Thank
On Sat, Jan 12, 2019 at 6:43 AM Rich Shepard wrote:
>
> On Sat, 12 Jan 2019, Ricardo Martin Gomez wrote:
>
> > Hi, one question.
> > Do you put explicit "NULL" in the column value?
> > Other option is.
> > You have to delete the column "next_contact" in your INSERT clause.
> > So, if the column ha
On Sat, 12 Jan 2019, Ricardo Martin Gomez wrote:
Hi, one question.
Do you put explicit "NULL" in the column value?
Other option is.
You have to delete the column "next_contact" in your INSERT clause.
So, if the column has a default value, this value Will be inserted. Else
Null value will be inse
On Fri, 11 Jan 2019, David G. Johnston wrote:
The default does seem a bit arbitrary and pointless...
David,
That answers my question about it. Thanks again.
Best regards,
Rich
On Fri, 11 Jan 2019, David G. Johnston wrote:
VALUES (1, null, 3) is valid, VALUES (1,,3) is not.
David,
Using null occurred to me when I saw that an empty space still failed.
Thanks for clarifying and confirming.
Best regards,
Rich
k para Android<https://aka.ms/ghei36>
De: Adrian Klaver
Enviado: viernes, 11 de enero 22:09
Asunto: Re: insert into: NULL in date column
Para: Rich Shepard, pgsql-general@lists.postgresql.org
On 1/11/19 4:00 PM, Rich Shepard wrote: > On Fri, 11 Jan 2019, Ken Tanzer
wrote: > >>
On 1/11/19 4:00 PM, Rich Shepard wrote:
On Fri, 11 Jan 2019, Ken Tanzer wrote:
I think the problem is actually that you're trying to represent your NULL
dates with '', which PG doesn't like.
Ken,
That's certainly how I saw the error message.
cat test.csv
my_text,my_date,my_int
'Some Te
On Fri, Jan 11, 2019 at 4:25 PM Rob Sargent wrote:
> We don't have more context in "activities.sql" but if your OP was
> verbatim, it's keeling over on the comma ending the long text string.
> Something syntactically askew I think.
If the problem was where you described the parser would never hav
On Fri, Jan 11, 2019 at 3:56 PM Rich Shepard wrote:
>
> A table has this column definition:
>
> next_contact date DEFAULT '2020-11-06'
> CONSTRAINT valid_next_date
> CHECK (next_contact >= CURRENT_DATE),
>
> (and I don't know that it needs a default).
The default d
On Fri, Jan 11, 2019 at 5:01 PM Rich Shepard wrote:
> On Fri, 11 Jan 2019, Ken Tanzer wrote:
> > \copy my_test FROM test.csv WITH CSV HEADER
> >
> > ERROR: invalid input syntax for type date: "''"
> > CONTEXT: COPY my_test, line 4, column my_date: "''"
Right problem wrong solution since it appe
On Fri, 11 Jan 2019, Ken Tanzer wrote:
I think the problem is actually that you're trying to represent your NULL
dates with '', which PG doesn't like.
Ken,
That's certainly how I saw the error message.
cat test.csv
my_text,my_date,my_int
'Some Text','1/1/18',3
'More Text,,2
'Enough','',1
On Fri, 11 Jan 2019, Rob Sargent wrote:
Something syntactically askew I think.
Rob,
I agree that's the problem. Why there's a problem is what I need to learn.
Thanks,
Rich
On Fri, Jan 11, 2019 at 3:25 PM Rob Sargent wrote:
>
> On 1/11/19 4:21 PM, Rich Shepard wrote:
> > On Fri, 11 Jan 2019, Rob Sargent wrote:
> >
> >>> psql:activities.sql:2: ERROR: invalid input syntax for type date: ""
> >>> LINE 2: ...reaction they''ve experienced environmental issues.','','');
On 1/11/19 4:21 PM, Rich Shepard wrote:
On Fri, 11 Jan 2019, Rob Sargent wrote:
psql:activities.sql:2: ERROR: invalid input syntax for type date: ""
LINE 2: ...reaction they''ve experienced environmental issues.','','');
^
Mi
On Fri, 11 Jan 2019, Rob Sargent wrote:
psql:activities.sql:2: ERROR: invalid input syntax for type date: ""
LINE 2: ...reaction they''ve experienced environmental issues.','','');
^
Miss-matched single quotes in activities.sql?
On 1/11/19 3:56 PM, Rich Shepard wrote:
A table has this column definition:
next_contact date DEFAULT '2020-11-06'
CONSTRAINT valid_next_date
CHECK (next_contact >= CURRENT_DATE),
(and I don't know that it needs a default).
In an input statement that column is l
A table has this column definition:
next_contact date DEFAULT '2020-11-06'
CONSTRAINT valid_next_date
CHECK (next_contact >= CURRENT_DATE),
(and I don't know that it needs a default).
In an input statement that column is left empty ('') when there's no defined
date
23 matches
Mail list logo