Fix Error Msg 3625 “‘Inline XSD for FOR XML EXPLICIT’ is not yet implemented.” in SQL Server

If you’re getting error Msg 3625 in SQL Server that reads “‘Inline XSD for FOR XML EXPLICIT’ is not yet implemented“, it’s because you’re trying to add an inline schema to an XML document that you’re generating using EXPLICIT mode with the FOR XML clause.

As the message alludes to, SQL Server doesn’t yet support inline XSD schemas when using EXPLICIT mode of the FOR XML clause (at least, not at the time of this writing).

To fix this issue, either use a different mode to generate the XML with an inline schema (specifically, use either AUTO or RAW mode), or don’t generate an inline schema at all (i.e. remove XMLSCHEMA from the query).

Continue reading

Fix “START value (…) cannot be greater than MAXVALUE (…)” When Creating a Sequence in PostgreSQL

If you’re getting an error that reads something like “START value (101) cannot be greater than MAXVALUE (100)” in PostgreSQL when you’re trying to create a sequence, it’s probably because your sequence’s maximum possible value is lower than the start value.

To fix this issue, change either the start value or maximum value so that the maximum value is greater than the start value.

Continue reading

Fix “cannot insert into column… Column is an identity column defined as GENERATED ALWAYS” in PostgreSQL

If you’re getting an error in PostgreSQL that reads something like “cannot insert into column” with detail that explains that the “…is an identity column defined as GENERATED ALWAYS“, it’s probably because you’re trying to insert your own value into an identity column that was created with the GENERATED ALWAYS option, but you’re not explicitly overriding the column from auto generating its own value.

To fix this issue, use OVERRIDING SYSTEM VALUE when inserting the value.

Continue reading

Fix ERROR 1050 “Table … already exists” in MariaDB

If you’re getting an error that reads something like “ERROR 1050 (42S01) at line 22: Table ‘Pets’ already exists” when trying to create a table in MariaDB, it’s most likely because there’s already a table in the database with the same name.

To fix this issue, either change the name of the table you’re trying to create, or check the existing table to see if it’s the one you actually need.

Continue reading

6 Ways to Fix “nextval: reached maximum value of sequence” in PostgreSQL

If you’re getting an error that reads something like “nextval: reached maximum value of sequence “sequence1” (3)” in PostgreSQL, it’s probably because you’re trying to generate a new value from a sequence, but the sequence has already reached its maximum value.

We have quite a few options when it comes to dealing with this issue.

Continue reading

Fix “ERROR 1298 (HY000): Unknown or incorrect time zone…” in MySQL

If you’re getting error 1298 that reads something like “ERROR 1298 (HY000): Unknown or incorrect time zone: ‘UTC’” in MySQL, it’s probably because you’re specifying a time zone name, but your MySQL installation hasn’t yet been configured for named time zones.

To fix this issue, be sure that your MySQL installation has been configured for named time zones.

Continue reading

Fix “lastval is not yet defined in this session” When Calling the LASTVAL() Function in PostgreSQL

If you’re getting an error that reads something like “lastval is not yet defined in this session” when calling the lastval() function in PostgreSQL, it’s probably because nextval() hasn’t yet been called in the current session.

If you want to avoid this error, only call the lastval() function when you know that nextval() has been called at least once in the current session.

Continue reading